[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aIc3+5Srw/QGWngL@intel.com>
Date: Mon, 28 Jul 2025 16:42:35 +0800
From: Chao Gao <chao.gao@...el.com>
To: Xin Li <xin@...or.com>
CC: <kvm@...r.kernel.org>, <linux-kernel@...r.kernel.org>, <x86@...nel.org>,
<seanjc@...gle.com>, <pbonzini@...hat.com>, <dave.hansen@...el.com>,
<rick.p.edgecombe@...el.com>, <mlevitsk@...hat.com>, <john.allen@....com>,
<weijiang.yang@...el.com>, <minipli@...ecurity.net>, Thomas Gleixner
<tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov
<bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>, "H. Peter Anvin"
<hpa@...or.com>
Subject: Re: [PATCH v11 21/23] KVM: nVMX: Enable CET support for nested guest
On Sun, Jul 27, 2025 at 11:30:28PM -0700, Xin Li wrote:
>> @@ -2515,6 +2537,30 @@ static void prepare_vmcs02_early(struct vcpu_vmx *vmx, struct loaded_vmcs *vmcs0
>> }
>> }
>> +static inline void cet_vmcs_fields_get(struct kvm_vcpu *vcpu, u64 *ssp,
>> + u64 *s_cet, u64 *ssp_tbl)
>> +{
>> + if (guest_cpu_cap_has(vcpu, X86_FEATURE_SHSTK)) {
>> + *ssp = vmcs_readl(GUEST_SSP);
>> + *ssp_tbl = vmcs_readl(GUEST_INTR_SSP_TABLE);
>> + }
>> + if (guest_cpu_cap_has(vcpu, X86_FEATURE_IBT) ||
>> + guest_cpu_cap_has(vcpu, X86_FEATURE_SHSTK))
>> + *s_cet = vmcs_readl(GUEST_S_CET);
>> +}
>> +
>> +static inline void cet_vmcs_fields_set(struct kvm_vcpu *vcpu, u64 ssp,
>> + u64 s_cet, u64 ssp_tbl)
>> +{
>> + if (guest_cpu_cap_has(vcpu, X86_FEATURE_SHSTK)) {
>> + vmcs_writel(GUEST_SSP, ssp);
>> + vmcs_writel(GUEST_INTR_SSP_TABLE, ssp_tbl);
>> + }
>> + if (guest_cpu_cap_has(vcpu, X86_FEATURE_IBT) ||
>> + guest_cpu_cap_has(vcpu, X86_FEATURE_SHSTK))
>> + vmcs_writel(GUEST_S_CET, s_cet);
>> +}
>> +
>> static void prepare_vmcs02_rare(struct vcpu_vmx *vmx, struct vmcs12 *vmcs12)
>> {
>> struct hv_enlightened_vmcs *hv_evmcs = nested_vmx_evmcs(vmx);
>
>
>The order of the arguments is a bit of weird to me, I would move s_cet
>before ssp. Then it is consistent with the order in
>https://lore.kernel.org/kvm/20250704085027.182163-13-chao.gao@intel.com/
Sure. I can reorder the arguments.
Powered by blists - more mailing lists