Re: [PATCH v3 8/9] KVM: x86: Disable Intel Processor Trace when VMXON in L1 guest
From: Paolo Bonzini
Date: Thu Nov 30 2017 - 07:22:47 EST
On 27/11/2017 21:24, Luwei Kang wrote:
>
> + if (pt_mode == PT_MODE_HOST_GUEST) {
> + vmx->pt_desc.guest.ctl &= ~RTIT_CTL_TRACEEN;
> + pt_disable_intercept_for_msr(FALSE);
> + vmcs_write64(GUEST_IA32_RTIT_CTL, vmx->pt_desc.guest.ctl);
> + }
> +
Using vmx_set_msr would be nicer. Alternatively, extract this:
+ pt_disable_intercept_for_msr(data & RTIT_CTL_TRACEEN);
+ vmcs_write64(GUEST_IA32_RTIT_CTL, data);
+ vmx->pt_desc.guest.ctl = data;
into a new function vmx_set_rtit_ctl(vcpu, data), and call it here.
Thanks,
Paolo