Skip to content

Commit 44c248e

Browse files
authored
virt_mshv_vtl/mshv: Fix a hardcoded VTL oversight (#1634)
There's technically a chance we could be requesting a translation for VTL 1, as unlikely as it may be.
1 parent 7ba54cc commit 44c248e

File tree

1 file changed

+2
-4
lines changed
  • openhcl/virt_mshv_vtl/src/processor/mshv

1 file changed

+2
-4
lines changed

openhcl/virt_mshv_vtl/src/processor/mshv/x64.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,8 +1290,6 @@ impl<T: CpuIo> EmulatorSupport for UhEmulationState<'_, '_, T, HypervisorBackedX
12901290
}
12911291
};
12921292

1293-
let target_vtl = self.vtl;
1294-
12951293
// The translation will be used, so set the appropriate page table bits
12961294
// (the access/dirty bit).
12971295
//
@@ -1309,7 +1307,7 @@ impl<T: CpuIo> EmulatorSupport for UhEmulationState<'_, '_, T, HypervisorBackedX
13091307
assert!(!control_flags.privilege_exempt());
13101308

13111309
// Do the translation using the current VTL.
1312-
control_flags.set_input_vtl(target_vtl.into());
1310+
control_flags.set_input_vtl(self.vtl.into());
13131311

13141312
match self
13151313
.vp
@@ -1321,7 +1319,7 @@ impl<T: CpuIo> EmulatorSupport for UhEmulationState<'_, '_, T, HypervisorBackedX
13211319
gpa_page,
13221320
overlay_page,
13231321
}) => {
1324-
self.vp.mark_tlb_locked(Vtl::Vtl2, GuestVtl::Vtl0);
1322+
self.vp.mark_tlb_locked(Vtl::Vtl2, self.vtl);
13251323
Ok(Ok(EmuTranslateResult {
13261324
gpa: (gpa_page << hvdef::HV_PAGE_SHIFT) + (gva & (HV_PAGE_SIZE - 1)),
13271325
overlay_page: Some(overlay_page),

0 commit comments

Comments
 (0)