-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement MMIO gap #38
Conversation
Signed-off-by: Simon LUCIDO <[email protected]>
An arbitrary value for the gap size has been chosen for now. Signed-off-by: Nils Ponsard <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase the PR and remove the code formatting part and we'll get that merged.
/// Size of the MMIO gap | ||
const MMIO_GAP_SIZE: usize = 32 << 20; | ||
/// Start of the MMIO gap | ||
const MMIO_GAP_START: usize = MMIO_GAP_END - MMIO_GAP_SIZE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, placing the MMIO gap under 32 bits is meant for supporting 32-bit architecture. The PCI memory hole (Which MMIO is taking advantage of) is a legacy burden that's carried over to support MMIO based devices on 32-bit CPUs.
It does not matter where you place it, and at the end of the 32-bit address space is fine. But you should know that this could be placed e.g. way further in the 64-bit address space, and leave RAM unfragmented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to support 32bit OSes ? Then we could instead use something like an allocator to place the MMIO devices after the guest's memory ?
&mut self, | ||
console_path: Option<String> | ||
) -> Result<()> { | ||
pub fn configure_console(&mut self, console_path: Option<String>) -> Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unneeded reformatting.
mem_size_mb: u32, | ||
kernel_path: &str, | ||
console: Option<String>, | ||
) -> Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
replaced by #41 |
This PR adds a GAP at the end of 32-bit guest memory space to allocate MMIO devices.
The sizes is an arbitrary one, I didn't find any resource explaining which size to choose.
This PR fixes #34.