change LBR control VMWRITE length

This commit is contained in:
sina 2026-04-23 18:52:41 +02:00
parent 54c2a9923b
commit d930b3341d
2 changed files with 7 additions and 7 deletions

View file

@ -1500,8 +1500,8 @@ HvGetAndStoreDebugctl(UINT64 * StoreDebugctl)
VOID
HvSetDebugctl(UINT64 Value)
{
VmxVmwrite64(VMCS_GUEST_DEBUGCTL, Value & 0xFFFFFFFF);
VmxVmwrite64(VMCS_GUEST_DEBUGCTL_HIGH, Value >> 32);
VmxVmwrite32(VMCS_GUEST_DEBUGCTL, Value & 0xFFFFFFFF);
VmxVmwrite32(VMCS_GUEST_DEBUGCTL_HIGH, Value >> 32);
}
/**

View file

@ -94,6 +94,11 @@ DpcRoutineDisableLbr(KDPC * Dpc, PVOID DeferredContext, PVOID SystemArgument1, P
//
CurrentRequest = &g_LbrRequestState[CurrentCore];
//
// Disable LBR on all cores from VMX-root mode by VMCALL
//
LbrStopLbr(CurrentRequest, TRUE, TRUE);
//
// Check if the initialization is being done for hypervisor environment or not
// If it is, then we need to perform some additional steps to enable LBR in VMX
@ -108,11 +113,6 @@ DpcRoutineDisableLbr(KDPC * Dpc, PVOID DeferredContext, PVOID SystemArgument1, P
g_Callbacks.VmFuncSetLoadDebugControlsVmcallOnTargetCore(FALSE);
}
//
// Disable LBR on all cores from VMX-root mode by VMCALL
//
LbrStopLbr(CurrentRequest, TRUE, TRUE);
//
// Wait for all DPCs to synchronize at this point
//