MapPerms: Consistency between map and iomap - #577
Conversation
|
seL4 reference for write only run time error. |
|
Apologies, you will need to rebase affter: #581 |
21b79bc to
7787f27
Compare
| fn read(&self) -> bool { | ||
| self.perms & SysMapPerms::Read as u8 != 0 | ||
| self.perms.read() | ||
| } | ||
|
|
||
| fn write(&self) -> bool { | ||
| self.perms & SysMapPerms::Write as u8 != 0 | ||
| self.perms.write() | ||
| } | ||
|
|
||
| fn execute(&self) -> bool { | ||
| self.perms & SysMapPerms::Execute as u8 != 0 | ||
| self.perms.execute() | ||
| } |
There was a problem hiding this comment.
Instead: map.perms().read? Since type of perms is the same in both cases? Then don't need these extra methods? Or does that get ugly?
There was a problem hiding this comment.
I think I made it work lmk if you're happy with the design, it scales better while still allowing the map and the iomap to define their own types around the common FrameRights.
| }; | ||
| Ok(SysIOMapPerms(frame_rights)) | ||
| } | ||
| pub fn read(self) -> bool { |
There was a problem hiding this comment.
Spacing between functions
dreamliner787-9
left a comment
There was a problem hiding this comment.
Looks good from me apart from Julia's comments
Actually can you add this reference into https://github.com/seL4/microkit/pull/577/changes#diff-5fc8f1c29b8f90ae6c6d27410e489ac4d389486ec4c31f3323604cbab3f1cf1fR334 |
This commit unifies the way VM rights are encoded in the sdf. Previously normal map perms were represented as a raw u8 while the iomap perms were represented as a proper type. Preserves existing correct behaviour. The tool will now error if a write execute mapping was created, which seL4 treats as a runtime error. Signed-off-by: Callum <c.berry@student.unsw.edu.au>
7787f27 to
047342f
Compare
This commit unifies the way VM rights are encoded in the sdf. Previously normal map perms were represented as a raw u8 enum while the iomap perms were represented as a proper type.
This uses a base enum for the vm rights and then uses a context specific struct around the base rights depending on if the perms are for a iomap or map entry.
This preserves existing correct behaviour, (I believe seL4 would reject the WriteExecute case where the tool would previously accept this for normal frames leading to a runtime error.)