Skip to content

Commit 066abfe

Browse files
committed
[fix] bug in read_guest_memory
1 parent 1e35ea0 commit 066abfe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vmx/vcpu.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ impl<H: AxVCpuHal> VmxVcpu<H> {
348348
if let Some(hpa) = H::EPTTranslator::guest_phys_to_host_phys(gpa) {
349349
let hva_ptr = H::PagingHandler::phys_to_virt(hpa).as_ptr();
350350
for i in 0..read_size {
351-
content.push(unsafe { hva_ptr.add(pgoff + i).read() });
351+
content.push(unsafe { hva_ptr.add(i).read() });
352352
}
353353
} else {
354354
return ax_err!(BadAddress);
@@ -1382,7 +1382,7 @@ impl<H: AxVCpuHal> AxArchVCpu for VmxVcpu<H> {
13821382
}
13831383
}
13841384
}
1385-
VmxExitReason::EPT_VIOLATION => {
1385+
VmxExitReason::EPT_VIOLATION | VmxExitReason::TRIPLE_FAULT => {
13861386
let ept_info = self.nested_page_fault_info()?;
13871387

13881388
warn!("VMX EPT-Exit: {:#x?} of {:#x?}", ept_info, exit_info);

0 commit comments

Comments
 (0)