Re: [PATCH 19/61] KVM: VMX: Add helpers to query Intel PT mode

From: Paolo Bonzini
Date: Tue Feb 25 2020 - 09:54:31 EST


On 24/02/20 23:18, Sean Christopherson wrote:
>>> {
>>> u32 vmexit_ctrl = vmcs_config.vmexit_ctrl;
>>> - if (pt_mode == PT_MODE_SYSTEM)
>>> + if (vmx_pt_mode_is_system())
>> ... and here? I.e. to cover the currently unsupported 'host-only' mode.
> Hmm, good question. I don't think so? On VM-Enter, RTIT_CTL would need to
> be loaded to disable PT. Clearing RTIT_CTL on VM-Exit would be redundant
> at that point[1]. And AIUI, the PIP for VM-Enter/VM-Exit isn't needed
> because there is no context switch from the decoder's perspective.

How does host-only mode differ from "host-guest but don't expose PT to
the guest"? So I would say that host-only mode is a special case of
host-guest, not of system mode.

Paolo