Skip to content

Commit

Permalink
hypervisor: mshv: handle GPA intercept
Browse files Browse the repository at this point in the history
We will start receiving GPA intercepts. For our use cases they are
handled the same way as UNMAPPED GPA intercepts.

Put in some logging to distinguish the two cases.

Signed-off-by: Wei Liu <[email protected]>
  • Loading branch information
liuw committed Jul 4, 2024
1 parent 519476e commit 14b45e4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hypervisor/src/mshv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,13 +638,18 @@ impl cpu::Vcpu for MshvVcpu {
Ok(cpu::VmExit::Ignore)
}
#[cfg(target_arch = "x86_64")]
hv_message_type_HVMSG_UNMAPPED_GPA => {
msg_type @ (hv_message_type_HVMSG_UNMAPPED_GPA
| hv_message_type_HVMSG_GPA_INTERCEPT) => {
let info = x.to_memory_info().unwrap();
let insn_len = info.instruction_byte_count as usize;
let gva = info.guest_virtual_address;
let gpa = info.guest_physical_address;

debug!("Exit ({:?}) GVA {:x} GPA {:x}", msg_type, gva, gpa);

let mut context = MshvEmulatorContext {
vcpu: self,
map: (info.guest_virtual_address, info.guest_physical_address),
map: (gva, gpa),
};

// Create a new emulator.
Expand Down

0 comments on commit 14b45e4

Please sign in to comment.