-
Notifications
You must be signed in to change notification settings - Fork 9
Perform host address translation via QMP if available #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
base: main
Are you sure you want to change the base?
Conversation
Heuristics using the largest allocation chunk are often insufficient
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 really like the conceptual idea. I think it would be better to not add host_start into mapping, but instead, rename remap_start to remap_base, and use it as an absolute value. Then, there's no difference between using QMP or not, you just know that remap_base is address within the QEMU process virtual address space. But aside from this, I'm quite excited to get this merged in.
| )?; | ||
|
|
||
| info!("qemu memory map found {:?}", qemu_map); | ||
| if let Some(qemu_map) = &biggest_map { |
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.
Why are we changing this?
| Ok((gpa, hva)) if gpa == mapping.range_start => | ||
| mapping.host_start = Some(hva), | ||
| _ => { | ||
| log::warn!("failed to parse host address from {line:?}"); |
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.
Does this ever happen? If it does happen rarely, it might be better to throw an error, instead of silently ignoring and falling back to the largest map offset.
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.
Thanks for the changes! Would be great if you could have a look at the suggestions and then we can merge it in 👍 🔥
| cmdline: &str, | ||
| qemu_map: &CTup2<Address, umem>, | ||
| ) -> Result<MemoryMap<(Address, umem)>> { | ||
| let qemu_map = || match qemu_map { |
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.
Why does this have to be a function that we resolve later in the different code paths? Can't we just error out immediately?
Heuristics using the largest allocation chunk are often insufficient - for example if the VM has a large memory-mapped VFIO device attached.