Comments (10)
I think there are some users of the mapping function that expect it to return an error if the entry is already present even if that entry contains the same frame. Changing this behavior would be a breaking change and a subtle one.
from x86_64.
We get this error when we try to change the page flags, which isn't right, we should only return this error if the frame address's are different.
Is there a reason why you aren't using Mapper::update_flags
if you only want to change the flags and not the frame?
Also why do we return the user inputted frame and not the previously mapped frame ?
from x86_64.
Sorry, I didn't see this function !
But maybe we should use the update_flags implicitly ?
from x86_64.
Yes I'm okay, but also why do we have Mapper::update_flags but not Mapper::get_flags, I think it would be a cool addition
from x86_64.
Yes I'm okay, but also why do we have Mapper::update_flags but not Mapper::get_flags, I think it would be a cool addition
That sounds reasonable to me. Feel free to open a PR :)
from x86_64.
Yes I'm okay, but also why do we have Mapper::update_flags but not Mapper::get_flags, I think it would be a cool addition
The Mapper
trait is about updating the page tables, i.e. creating or changing some mappings. We have a separate trait called Translate
for inspecting the page tables without modification. For example, you can use the Translate::translate
to get all the information about a virtual page, including its flags.
from x86_64.
Okay thanks !
Well I guess my issue is useless... So I can close it...
Although I think it's not really straight forward...
from x86_64.
Although I think it's not really straight forward...
Do you think it's mainly a documentation issue or do you see a way how we could make the API itself simpler?
from x86_64.
The API should change, because I think the update_flags and get_flags should be on the same object
But we can also just add in comments for the update_flags function:
/// See Translate::get_flags to get the flags on a specific page/frame
from x86_64.
You can check the docs for a specific page table type to see all supported methods, e.g. https://docs.rs/x86_64/latest/x86_64/structures/paging/mapper/struct.OffsetPageTable.html. Keeping the traits separate allows creating custom read-only or write-only page table types.
But we can also just add in comments for the update_flags function:
/// See Translate::get_flags to get the flags on a specific page/frame
I agree that such a comment would be useful. Could you submit a PR?
from x86_64.
Related Issues (20)
- Create a Security Policy
- Mutable references in page table implementation? HOT 1
- IDT and page table code causing trouble in Confidential Computing space HOT 1
- Hash pin workflow dependencies HOT 9
- `Descriptor::tss_segment` too restrictive? HOT 2
- recursive page table with recursive index 511 is unsound HOT 7
- How can I set 2MiB page frame in my Page Directory Table? HOT 1
- How do I map to a virtualized physical address? HOT 1
- Enable OpenSSF Scorecard Action HOT 2
- [Question] Is there a reason to not support pagemaps level 5 ? HOT 2
- Trait for Entry handler function types? HOT 2
- Should we add an register abstraction? How should it work with and ?
- `VirtAddr` arithmetic may panic HOT 2
- Should have a way to construct an `InterruptStackFrameValue`? HOT 3
- A `VirtualAddr` panic is triggered when the page table called `clean_up` HOT 3
- `Sealed::DEBUG_STR` is publicly accessible HOT 10
- PageTable: Handling of pages without the present flag set HOT 2
- `Mapper::unmap` should be unsafe HOT 4
- CR8 (task priority) register HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from x86_64.