[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <27a14f56-3d5a-9d66-83be-e5893d5f0a9e@intel.com>
Date: Wed, 9 Aug 2023 11:05:03 +0800
From: "Yang, Weijiang" <weijiang.yang@...el.com>
To: Paolo Bonzini <pbonzini@...hat.com>
CC: <rick.p.edgecombe@...el.com>, <chao.gao@...el.com>,
<binbin.wu@...ux.intel.com>, <seanjc@...gle.com>,
<peterz@...radead.org>, <john.allen@....com>,
<kvm@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v5 11/19] KVM:VMX: Emulate read and write to CET MSRs
On 8/5/2023 5:40 AM, Paolo Bonzini wrote:
> On 8/3/23 06:27, Yang Weijiang wrote:
>> + if (msr_info->index == MSR_KVM_GUEST_SSP)
>> + msr_info->data = vmcs_readl(GUEST_SSP);
>
> Accesses to MSR_KVM_(GUEST_)SSP must be rejected unless host-initiated.
Yes, it's kept, in v5 it's folded in:
+static bool kvm_cet_is_msr_accessible(struct kvm_vcpu *vcpu,
+struct msr_data *msr)
+{
+if (is_shadow_stack_msr(msr->index)) {
+if (!kvm_cpu_cap_has(X86_FEATURE_SHSTK))
+return false;
+
+if (msr->index == MSR_KVM_GUEST_SSP)
+return msr->host_initiated;
+
+return msr->host_initiated ||
+guest_cpuid_has(vcpu, X86_FEATURE_SHSTK);
+}
+
+if (!kvm_cpu_cap_has(X86_FEATURE_SHSTK) &&
+!kvm_cpu_cap_has(X86_FEATURE_IBT))
+return false;
+
+return msr->host_initiated ||
+guest_cpuid_has(vcpu, X86_FEATURE_IBT) ||
+guest_cpuid_has(vcpu, X86_FEATURE_SHSTK); }
+
> Paolo
>
Powered by blists - more mailing lists