* [RFC PATCH v3 1/8] KVM: x86: SVM: Emulate reads and writes to shadow stack MSRs
2023-08-17 18:18 [RFC PATCH v3 0/8] SVM guest shadow stack support John Allen
@ 2023-08-17 18:18 ` John Allen
2023-08-17 18:18 ` [RFC PATCH v3 2/8] KVM: x86: SVM: Update dump_vmcb with shadow stack save area additions John Allen
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: John Allen @ 2023-08-17 18:18 UTC (permalink / raw)
To: kvm
Cc: linux-kernel, pbonzini, weijiang.yang, rick.p.edgecombe, seanjc,
x86, thomas.lendacky, bp, John Allen
Set up interception of shadow stack MSRs. In the event that shadow stack
is unsupported on the host or the MSRs are otherwise inaccessible, the
interception code will return an error. In certain circumstances such as
host initiated MSR reads or writes, the interception code will get or
set the requested MSR value.
Signed-off-by: John Allen <john.allen@amd.com>
---
v3:
- Updated to depend on the new x86 common msr handling introduced in
v5 of Weijiang Yang's series:
https://lore.kernel.org/all/20230803042732.88515-12-weijiang.yang@intel.com/
---
arch/x86/kvm/svm/svm.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 8652e86fbfb2..57864e83f634 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -2833,6 +2833,15 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
if (guest_cpuid_is_intel(vcpu))
msr_info->data |= (u64)svm->sysenter_esp_hi << 32;
break;
+ case MSR_IA32_S_CET:
+ msr_info->data = svm->vmcb->save.s_cet;
+ break;
+ case MSR_IA32_INT_SSP_TAB:
+ msr_info->data = svm->vmcb->save.isst_addr;
+ break;
+ case MSR_KVM_GUEST_SSP:
+ msr_info->data = svm->vmcb->save.ssp;
+ break;
case MSR_TSC_AUX:
msr_info->data = svm->tsc_aux;
break;
@@ -3050,6 +3059,15 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr)
svm->vmcb01.ptr->save.sysenter_esp = (u32)data;
svm->sysenter_esp_hi = guest_cpuid_is_intel(vcpu) ? (data >> 32) : 0;
break;
+ case MSR_IA32_S_CET:
+ svm->vmcb->save.s_cet = data;
+ break;
+ case MSR_IA32_INT_SSP_TAB:
+ svm->vmcb->save.isst_addr = data;
+ break;
+ case MSR_KVM_GUEST_SSP:
+ svm->vmcb->save.ssp = data;
+ break;
case MSR_TSC_AUX:
/*
* TSC_AUX is usually changed only during boot and never read
--
2.39.1
^ permalink raw reply [flat|nested] 9+ messages in thread* [RFC PATCH v3 2/8] KVM: x86: SVM: Update dump_vmcb with shadow stack save area additions
2023-08-17 18:18 [RFC PATCH v3 0/8] SVM guest shadow stack support John Allen
2023-08-17 18:18 ` [RFC PATCH v3 1/8] KVM: x86: SVM: Emulate reads and writes to shadow stack MSRs John Allen
@ 2023-08-17 18:18 ` John Allen
2023-08-17 18:18 ` [RFC PATCH v3 3/8] KVM: x86: SVM: Pass through shadow stack MSRs John Allen
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: John Allen @ 2023-08-17 18:18 UTC (permalink / raw)
To: kvm
Cc: linux-kernel, pbonzini, weijiang.yang, rick.p.edgecombe, seanjc,
x86, thomas.lendacky, bp, John Allen
Add shadow stack VMCB save area fields to dump_vmcb. Only include S_CET,
SSP, and ISST_ADDR. Since there currently isn't support to decrypt and
dump the SEV-ES save area, exclude PL0_SSP, PL1_SSP, PL2_SSP, PL3_SSP, and
U_CET which are only inlcuded in the SEV-ES save area.
Signed-off-by: John Allen <john.allen@amd.com>
---
arch/x86/kvm/svm/svm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 57864e83f634..1ac5b51c3f2c 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -3386,6 +3386,10 @@ static void dump_vmcb(struct kvm_vcpu *vcpu)
"rip:", save->rip, "rflags:", save->rflags);
pr_err("%-15s %016llx %-13s %016llx\n",
"rsp:", save->rsp, "rax:", save->rax);
+ pr_err("%-15s %016llx %-13s %016llx\n",
+ "s_cet:", save->s_cet, "ssp:", save->ssp);
+ pr_err("%-15s %016llx\n",
+ "isst_addr:", save->isst_addr);
pr_err("%-15s %016llx %-13s %016llx\n",
"star:", save01->star, "lstar:", save01->lstar);
pr_err("%-15s %016llx %-13s %016llx\n",
--
2.39.1
^ permalink raw reply [flat|nested] 9+ messages in thread* [RFC PATCH v3 3/8] KVM: x86: SVM: Pass through shadow stack MSRs
2023-08-17 18:18 [RFC PATCH v3 0/8] SVM guest shadow stack support John Allen
2023-08-17 18:18 ` [RFC PATCH v3 1/8] KVM: x86: SVM: Emulate reads and writes to shadow stack MSRs John Allen
2023-08-17 18:18 ` [RFC PATCH v3 2/8] KVM: x86: SVM: Update dump_vmcb with shadow stack save area additions John Allen
@ 2023-08-17 18:18 ` John Allen
2023-08-17 18:18 ` [RFC PATCH v3 4/8] KVM: SVM: Rename vmplX_ssp -> plX_ssp John Allen
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: John Allen @ 2023-08-17 18:18 UTC (permalink / raw)
To: kvm
Cc: linux-kernel, pbonzini, weijiang.yang, rick.p.edgecombe, seanjc,
x86, thomas.lendacky, bp, John Allen
If kvm supports shadow stack, pass through shadow stack MSRs to improve
guest performance.
Signed-off-by: John Allen <john.allen@amd.com>
---
v3:
- Conditionally pass through MSRs depending on both host and guest
shadow stack support.
---
arch/x86/kvm/svm/svm.c | 26 ++++++++++++++++++++++++++
arch/x86/kvm/svm/svm.h | 2 +-
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 1ac5b51c3f2c..dd67f435cd33 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -140,6 +140,13 @@ static const struct svm_direct_access_msrs {
{ .index = X2APIC_MSR(APIC_TMICT), .always = false },
{ .index = X2APIC_MSR(APIC_TMCCT), .always = false },
{ .index = X2APIC_MSR(APIC_TDCR), .always = false },
+ { .index = MSR_IA32_U_CET, .always = false },
+ { .index = MSR_IA32_S_CET, .always = false },
+ { .index = MSR_IA32_INT_SSP_TAB, .always = false },
+ { .index = MSR_IA32_PL0_SSP, .always = false },
+ { .index = MSR_IA32_PL1_SSP, .always = false },
+ { .index = MSR_IA32_PL2_SSP, .always = false },
+ { .index = MSR_IA32_PL3_SSP, .always = false },
{ .index = MSR_INVALID, .always = false },
};
@@ -1205,6 +1212,25 @@ static inline void init_vmcb_after_set_cpuid(struct kvm_vcpu *vcpu)
set_msr_interception(vcpu, svm->msrpm, MSR_IA32_SYSENTER_EIP, 1, 1);
set_msr_interception(vcpu, svm->msrpm, MSR_IA32_SYSENTER_ESP, 1, 1);
}
+
+ if (kvm_cpu_cap_has(X86_FEATURE_SHSTK)) {
+ bool shstk_enabled = guest_cpuid_has(vcpu, X86_FEATURE_SHSTK);
+
+ set_msr_interception(vcpu, svm->msrpm, MSR_IA32_U_CET,
+ shstk_enabled, shstk_enabled);
+ set_msr_interception(vcpu, svm->msrpm, MSR_IA32_S_CET,
+ shstk_enabled, shstk_enabled);
+ set_msr_interception(vcpu, svm->msrpm, MSR_IA32_INT_SSP_TAB,
+ shstk_enabled, shstk_enabled);
+ set_msr_interception(vcpu, svm->msrpm, MSR_IA32_PL0_SSP,
+ shstk_enabled, shstk_enabled);
+ set_msr_interception(vcpu, svm->msrpm, MSR_IA32_PL1_SSP,
+ shstk_enabled, shstk_enabled);
+ set_msr_interception(vcpu, svm->msrpm, MSR_IA32_PL2_SSP,
+ shstk_enabled, shstk_enabled);
+ set_msr_interception(vcpu, svm->msrpm, MSR_IA32_PL3_SSP,
+ shstk_enabled, shstk_enabled);
+ }
}
static void init_vmcb(struct kvm_vcpu *vcpu)
diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h
index 800ca1776b59..f824dde86e96 100644
--- a/arch/x86/kvm/svm/svm.h
+++ b/arch/x86/kvm/svm/svm.h
@@ -29,7 +29,7 @@
#define IOPM_SIZE PAGE_SIZE * 3
#define MSRPM_SIZE PAGE_SIZE * 2
-#define MAX_DIRECT_ACCESS_MSRS 46
+#define MAX_DIRECT_ACCESS_MSRS 53
#define MSRPM_OFFSETS 32
extern u32 msrpm_offsets[MSRPM_OFFSETS] __read_mostly;
extern bool npt_enabled;
--
2.39.1
^ permalink raw reply [flat|nested] 9+ messages in thread* [RFC PATCH v3 4/8] KVM: SVM: Rename vmplX_ssp -> plX_ssp
2023-08-17 18:18 [RFC PATCH v3 0/8] SVM guest shadow stack support John Allen
` (2 preceding siblings ...)
2023-08-17 18:18 ` [RFC PATCH v3 3/8] KVM: x86: SVM: Pass through shadow stack MSRs John Allen
@ 2023-08-17 18:18 ` John Allen
2023-08-17 18:18 ` [RFC PATCH v3 5/8] KVM: SVM: Save shadow stack host state on VMRUN John Allen
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: John Allen @ 2023-08-17 18:18 UTC (permalink / raw)
To: kvm
Cc: linux-kernel, pbonzini, weijiang.yang, rick.p.edgecombe, seanjc,
x86, thomas.lendacky, bp, John Allen
Rename SEV-ES save area SSP fields to be consistent with the APM.
Signed-off-by: John Allen <john.allen@amd.com>
---
v3:
- New in v3.
---
arch/x86/include/asm/svm.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h
index 72ebd5e4e975..d14536761309 100644
--- a/arch/x86/include/asm/svm.h
+++ b/arch/x86/include/asm/svm.h
@@ -361,10 +361,10 @@ struct sev_es_save_area {
struct vmcb_seg ldtr;
struct vmcb_seg idtr;
struct vmcb_seg tr;
- u64 vmpl0_ssp;
- u64 vmpl1_ssp;
- u64 vmpl2_ssp;
- u64 vmpl3_ssp;
+ u64 pl0_ssp;
+ u64 pl1_ssp;
+ u64 pl2_ssp;
+ u64 pl3_ssp;
u64 u_cet;
u8 reserved_0xc8[2];
u8 vmpl;
--
2.39.1
^ permalink raw reply [flat|nested] 9+ messages in thread* [RFC PATCH v3 5/8] KVM: SVM: Save shadow stack host state on VMRUN
2023-08-17 18:18 [RFC PATCH v3 0/8] SVM guest shadow stack support John Allen
` (3 preceding siblings ...)
2023-08-17 18:18 ` [RFC PATCH v3 4/8] KVM: SVM: Rename vmplX_ssp -> plX_ssp John Allen
@ 2023-08-17 18:18 ` John Allen
2023-08-17 18:18 ` [RFC PATCH v3 6/8] KVM: SVM: Add MSR_IA32_XSS to the GHCB for hypervisor kernel John Allen
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: John Allen @ 2023-08-17 18:18 UTC (permalink / raw)
To: kvm
Cc: linux-kernel, pbonzini, weijiang.yang, rick.p.edgecombe, seanjc,
x86, thomas.lendacky, bp, John Allen
When running as an SEV-ES guest, the PL0_SSP, PL1_SSP, PL2_SSP, PL3_SSP,
and U_CET fields in the VMCB save area are type B, meaning the host
state is automatically loaded on a VMEXIT, but is not saved on a VMRUN.
The other shadow stack MSRs, S_CET, SSP, and ISST_ADDR are type A,
meaning they are loaded on VMEXIT and saved on VMRUN. PL0_SSP, PL1_SSP,
and PL2_SSP are currently unused. Manually save the other type B host
MSR values before VMRUN.
Signed-off-by: John Allen <john.allen@amd.com>
---
v3:
- Don't save unused PL0_SSP, PL1_SSP, and PL2_SSP MSRs.
---
arch/x86/kvm/svm/sev.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
index 2cd15783dfb9..021ead4dd201 100644
--- a/arch/x86/kvm/svm/sev.c
+++ b/arch/x86/kvm/svm/sev.c
@@ -3097,6 +3097,15 @@ void sev_es_prepare_switch_to_guest(struct sev_es_save_area *hostsa)
hostsa->dr2_addr_mask = amd_get_dr_addr_mask(2);
hostsa->dr3_addr_mask = amd_get_dr_addr_mask(3);
}
+
+ if (boot_cpu_has(X86_FEATURE_SHSTK)) {
+ /*
+ * MSR_IA32_U_CET and MSR_IA32_PL3_SSP are restored on VMEXIT,
+ * save the current host values.
+ */
+ rdmsrl(MSR_IA32_U_CET, hostsa->u_cet);
+ rdmsrl(MSR_IA32_PL3_SSP, hostsa->pl3_ssp);
+ }
}
void sev_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector)
--
2.39.1
^ permalink raw reply [flat|nested] 9+ messages in thread* [RFC PATCH v3 6/8] KVM: SVM: Add MSR_IA32_XSS to the GHCB for hypervisor kernel
2023-08-17 18:18 [RFC PATCH v3 0/8] SVM guest shadow stack support John Allen
` (4 preceding siblings ...)
2023-08-17 18:18 ` [RFC PATCH v3 5/8] KVM: SVM: Save shadow stack host state on VMRUN John Allen
@ 2023-08-17 18:18 ` John Allen
2023-08-17 18:18 ` [RFC PATCH v3 7/8] x86/sev-es: Include XSS value in GHCB CPUID request John Allen
2023-08-17 18:18 ` [RFC PATCH v3 8/8] KVM: SVM: Add CET features to supported_xss John Allen
7 siblings, 0 replies; 9+ messages in thread
From: John Allen @ 2023-08-17 18:18 UTC (permalink / raw)
To: kvm
Cc: linux-kernel, pbonzini, weijiang.yang, rick.p.edgecombe, seanjc,
x86, thomas.lendacky, bp, John Allen
When a guest issues a cpuid instruction for Fn0000000D_x0B
(CetUserOffset), KVM will intercept and need to access the guest
MSR_IA32_XSS value. For SEV-ES, this is encrypted and needs to be
included in the GHCB to be visible to the hypervisor.
Signed-off-by: John Allen <john.allen@amd.com>
---
arch/x86/include/asm/svm.h | 1 +
arch/x86/kvm/svm/sev.c | 12 ++++++++++--
arch/x86/kvm/svm/svm.c | 1 +
arch/x86/kvm/svm/svm.h | 2 +-
4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h
index d14536761309..890ec51eb9d6 100644
--- a/arch/x86/include/asm/svm.h
+++ b/arch/x86/include/asm/svm.h
@@ -678,5 +678,6 @@ DEFINE_GHCB_ACCESSORS(sw_exit_info_1)
DEFINE_GHCB_ACCESSORS(sw_exit_info_2)
DEFINE_GHCB_ACCESSORS(sw_scratch)
DEFINE_GHCB_ACCESSORS(xcr0)
+DEFINE_GHCB_ACCESSORS(xss)
#endif
diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
index 021ead4dd201..5db76675b416 100644
--- a/arch/x86/kvm/svm/sev.c
+++ b/arch/x86/kvm/svm/sev.c
@@ -2442,8 +2442,13 @@ static void sev_es_sync_from_ghcb(struct vcpu_svm *svm)
svm->vmcb->save.cpl = ghcb_get_cpl_if_valid(ghcb);
- if (ghcb_xcr0_is_valid(ghcb)) {
- vcpu->arch.xcr0 = ghcb_get_xcr0(ghcb);
+ if (ghcb_xcr0_is_valid(ghcb) || ghcb_xss_is_valid(ghcb)) {
+ if (ghcb_xcr0_is_valid(ghcb))
+ vcpu->arch.xcr0 = ghcb_get_xcr0(ghcb);
+
+ if (ghcb_xss_is_valid(ghcb))
+ vcpu->arch.ia32_xss = ghcb_get_xss(ghcb);
+
kvm_update_cpuid_runtime(vcpu);
}
@@ -3031,6 +3036,9 @@ static void sev_es_init_vmcb(struct vcpu_svm *svm)
if (guest_cpuid_has(&svm->vcpu, X86_FEATURE_RDTSCP))
svm_clr_intercept(svm, INTERCEPT_RDTSCP);
}
+
+ if (kvm_caps.supported_xss)
+ set_msr_interception(vcpu, svm->msrpm, MSR_IA32_XSS, 1, 1);
}
void sev_init_vmcb(struct vcpu_svm *svm)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index dd67f435cd33..683bf18b965d 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -147,6 +147,7 @@ static const struct svm_direct_access_msrs {
{ .index = MSR_IA32_PL1_SSP, .always = false },
{ .index = MSR_IA32_PL2_SSP, .always = false },
{ .index = MSR_IA32_PL3_SSP, .always = false },
+ { .index = MSR_IA32_XSS, .always = false },
{ .index = MSR_INVALID, .always = false },
};
diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h
index f824dde86e96..87b6831bac42 100644
--- a/arch/x86/kvm/svm/svm.h
+++ b/arch/x86/kvm/svm/svm.h
@@ -29,7 +29,7 @@
#define IOPM_SIZE PAGE_SIZE * 3
#define MSRPM_SIZE PAGE_SIZE * 2
-#define MAX_DIRECT_ACCESS_MSRS 53
+#define MAX_DIRECT_ACCESS_MSRS 54
#define MSRPM_OFFSETS 32
extern u32 msrpm_offsets[MSRPM_OFFSETS] __read_mostly;
extern bool npt_enabled;
--
2.39.1
^ permalink raw reply [flat|nested] 9+ messages in thread* [RFC PATCH v3 7/8] x86/sev-es: Include XSS value in GHCB CPUID request
2023-08-17 18:18 [RFC PATCH v3 0/8] SVM guest shadow stack support John Allen
` (5 preceding siblings ...)
2023-08-17 18:18 ` [RFC PATCH v3 6/8] KVM: SVM: Add MSR_IA32_XSS to the GHCB for hypervisor kernel John Allen
@ 2023-08-17 18:18 ` John Allen
2023-08-17 18:18 ` [RFC PATCH v3 8/8] KVM: SVM: Add CET features to supported_xss John Allen
7 siblings, 0 replies; 9+ messages in thread
From: John Allen @ 2023-08-17 18:18 UTC (permalink / raw)
To: kvm
Cc: linux-kernel, pbonzini, weijiang.yang, rick.p.edgecombe, seanjc,
x86, thomas.lendacky, bp, John Allen
When a guest issues a cpuid instruction for Fn0000000D_x0B (CetUserOffset), the
hypervisor may intercept and access the guest XSS value. For SEV-ES, this is
encrypted and needs to be included in the GHCB to be visible to the hypervisor.
The rdmsr instruction needs to be called directly as the code may be used in
early boot in which case the rdmsr wrappers should be avoided as they are
incompatible with the decompression boot phase.
Signed-off-by: John Allen <john.allen@amd.com>
---
v3:
- New in v3. Merged KVM support series and this single patch for guest
kernel support.
---
arch/x86/kernel/sev-shared.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/arch/x86/kernel/sev-shared.c b/arch/x86/kernel/sev-shared.c
index 2eabccde94fb..e38a1d049bc1 100644
--- a/arch/x86/kernel/sev-shared.c
+++ b/arch/x86/kernel/sev-shared.c
@@ -890,6 +890,21 @@ static enum es_result vc_handle_cpuid(struct ghcb *ghcb,
/* xgetbv will cause #GP - use reset value for xcr0 */
ghcb_set_xcr0(ghcb, 1);
+ if (has_cpuflag(X86_FEATURE_SHSTK) && regs->ax == 0xd && regs->cx <= 1) {
+ unsigned long lo, hi;
+ u64 xss;
+
+ /*
+ * Since vc_handle_cpuid may be used during early boot, the
+ * rdmsr wrappers are incompatible and should not be used.
+ * Invoke the instruction directly.
+ */
+ asm volatile("rdmsr" : "=a" (lo), "=d" (hi)
+ : "c" (MSR_IA32_XSS));
+ xss = (hi << 32) | lo;
+ ghcb_set_xss(ghcb, xss);
+ }
+
ret = sev_es_ghcb_hv_call(ghcb, ctxt, SVM_EXIT_CPUID, 0, 0);
if (ret != ES_OK)
return ret;
--
2.39.1
^ permalink raw reply [flat|nested] 9+ messages in thread* [RFC PATCH v3 8/8] KVM: SVM: Add CET features to supported_xss
2023-08-17 18:18 [RFC PATCH v3 0/8] SVM guest shadow stack support John Allen
` (6 preceding siblings ...)
2023-08-17 18:18 ` [RFC PATCH v3 7/8] x86/sev-es: Include XSS value in GHCB CPUID request John Allen
@ 2023-08-17 18:18 ` John Allen
7 siblings, 0 replies; 9+ messages in thread
From: John Allen @ 2023-08-17 18:18 UTC (permalink / raw)
To: kvm
Cc: linux-kernel, pbonzini, weijiang.yang, rick.p.edgecombe, seanjc,
x86, thomas.lendacky, bp, John Allen
If the CPU supports CET, add CET XSAVES feature bits to the
supported_xss mask.
Signed-off-by: John Allen <john.allen@amd.com>
---
v2:
- Remove curly braces around if statement
---
arch/x86/kvm/svm/svm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 683bf18b965d..685f8715a716 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -5105,6 +5105,10 @@ static __init void svm_set_cpu_caps(void)
boot_cpu_has(X86_FEATURE_AMD_SSBD))
kvm_cpu_cap_set(X86_FEATURE_VIRT_SSBD);
+ if (kvm_cpu_cap_has(X86_FEATURE_SHSTK))
+ kvm_caps.supported_xss |= XFEATURE_MASK_CET_USER |
+ XFEATURE_MASK_CET_KERNEL;
+
if (enable_pmu) {
/*
* Enumerate support for PERFCTR_CORE if and only if KVM has
--
2.39.1
^ permalink raw reply [flat|nested] 9+ messages in thread