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