Skip to content

Commit fdd2db5

Browse files
ahunter6sean-jc
authored andcommitted
KVM: VMX: Allow toggling bits in MSR_IA32_RTIT_CTL when enable bit is cleared
Allow toggling other bits in MSR_IA32_RTIT_CTL if the enable bit is being cleared, the existing logic simply ignores the enable bit. E.g. KVM will incorrectly reject a write of '0' to stop tracing. Fixes: bf8c55d ("KVM: x86: Implement Intel PT MSRs read/write emulation") Signed-off-by: Adrian Hunter <[email protected]> [sean: rework changelog, drop stable@] Reviewed-by: Xiaoyao Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 04bc93c commit fdd2db5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/x86/kvm/vmx/vmx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,8 @@ static int vmx_rtit_ctl_check(struct kvm_vcpu *vcpu, u64 data)
16361636
* result in a #GP unless the same write also clears TraceEn.
16371637
*/
16381638
if ((vmx->pt_desc.guest.ctl & RTIT_CTL_TRACEEN) &&
1639-
((vmx->pt_desc.guest.ctl ^ data) & ~RTIT_CTL_TRACEEN))
1639+
(data & RTIT_CTL_TRACEEN) &&
1640+
data != vmx->pt_desc.guest.ctl)
16401641
return 1;
16411642

16421643
/*

0 commit comments

Comments
 (0)