Re: [PATCH v15 14/41] KVM: VMX: Emulate read and write to CET MSRs

Xiaoyao Li
2025-09-16T08:10:28Z

On 9/16/2025 3:48 PM, Chao Gao wrote:
> On Tue, Sep 16, 2025 at 03:07:06PM +0800, Xiaoyao Li wrote:
>> On 9/13/2025 7:22 AM, Sean Christopherson wrote:
>>> From: Yang Weijiang <weijiang.yang@intel.com>
>>>
>>> Add emulation interface for CET MSR access. The emulation code is split
>>> into common part and vendor specific part. The former does common checks
>>> for MSRs, e.g., accessibility, data validity etc., then passes operation
>>> to either XSAVE-managed MSRs via the helpers or CET VMCS fields.
>>>
>>> SSP can only be read via RDSSP. Writing even requires destructive and
>>> potentially faulting operations such as SAVEPREVSSP/RSTORSSP or
>>> SETSSBSY/CLRSSBSY. Let the host use a pseudo-MSR that is just a wrapper
>>> for the GUEST_SSP field of the VMCS.
>>>
>>> Suggested-by: Sean Christopherson <seanjc@google.com>
>>> Signed-off-by: Yang Weijiang <weijiang.yang@intel.com>
>>> Tested-by: Mathias Krause <minipli@grsecurity.net>
>>> Tested-by: John Allen <john.allen@amd.com>
>>> Tested-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
>>> Signed-off-by: Chao Gao <chao.gao@intel.com>
>>> [sean: drop call to kvm_set_xstate_msr() for S_CET, consolidate code]
>>
>> Is the change/update of "drop call to kvm_set_xstate_msr() for S_CET" true
>> for this patch?
>
> v14 has that call, but it is incorrect. So Sean dropped it. See v14:
>
> https://lore.kernel.org/kvm/20250909093953.202028-12-chao.gao@intel.com/

Sorry, my fault. I missed it somehow, when bouncing between the 3 MSR
handlers.

>>
>>> Signed-off-by: Sean Christopherson <seanjc@google.com>
>>
>> Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>