summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '0045-x86-spec-ctrl-Rename-SCF_ist_wrmsr-to-SCF_ist_sc_msr.patch')
-rw-r--r--0045-x86-spec-ctrl-Rename-SCF_ist_wrmsr-to-SCF_ist_sc_msr.patch110
1 files changed, 110 insertions, 0 deletions
diff --git a/0045-x86-spec-ctrl-Rename-SCF_ist_wrmsr-to-SCF_ist_sc_msr.patch b/0045-x86-spec-ctrl-Rename-SCF_ist_wrmsr-to-SCF_ist_sc_msr.patch
new file mode 100644
index 0000000..5b841a6
--- /dev/null
+++ b/0045-x86-spec-ctrl-Rename-SCF_ist_wrmsr-to-SCF_ist_sc_msr.patch
@@ -0,0 +1,110 @@
+From 31aa2a20bfefc3a8a200da54a56471bf99f9630e Mon Sep 17 00:00:00 2001
+From: Andrew Cooper <andrew.cooper3@citrix.com>
+Date: Tue, 28 Jun 2022 14:36:56 +0100
+Subject: [PATCH 45/51] x86/spec-ctrl: Rename SCF_ist_wrmsr to SCF_ist_sc_msr
+
+We are about to introduce SCF_ist_ibpb, at which point SCF_ist_wrmsr becomes
+ambiguous.
+
+No functional change.
+
+This is part of XSA-407.
+
+Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
+Reviewed-by: Jan Beulich <jbeulich@suse.com>
+(cherry picked from commit 76d6a36f645dfdbad8830559d4d52caf36efc75e)
+---
+ xen/arch/x86/spec_ctrl.c | 6 +++---
+ xen/include/asm-x86/spec_ctrl.h | 4 ++--
+ xen/include/asm-x86/spec_ctrl_asm.h | 8 ++++----
+ 3 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
+index 7e646680f1c7..89f95c083e1b 100644
+--- a/xen/arch/x86/spec_ctrl.c
++++ b/xen/arch/x86/spec_ctrl.c
+@@ -1115,7 +1115,7 @@ void __init init_speculation_mitigations(void)
+ {
+ if ( opt_msr_sc_pv )
+ {
+- default_spec_ctrl_flags |= SCF_ist_wrmsr;
++ default_spec_ctrl_flags |= SCF_ist_sc_msr;
+ setup_force_cpu_cap(X86_FEATURE_SC_MSR_PV);
+ }
+
+@@ -1126,7 +1126,7 @@ void __init init_speculation_mitigations(void)
+ * Xen's value is not restored atomically. An early NMI hitting
+ * the VMExit path needs to restore Xen's value for safety.
+ */
+- default_spec_ctrl_flags |= SCF_ist_wrmsr;
++ default_spec_ctrl_flags |= SCF_ist_sc_msr;
+ setup_force_cpu_cap(X86_FEATURE_SC_MSR_HVM);
+ }
+ }
+@@ -1139,7 +1139,7 @@ void __init init_speculation_mitigations(void)
+ * on real hardware matches the availability of MSR_SPEC_CTRL in the
+ * first place.
+ *
+- * No need for SCF_ist_wrmsr because Xen's value is restored
++ * No need for SCF_ist_sc_msr because Xen's value is restored
+ * atomically WRT NMIs in the VMExit path.
+ *
+ * TODO: Adjust cpu_has_svm_spec_ctrl to be usable earlier on boot.
+diff --git a/xen/include/asm-x86/spec_ctrl.h b/xen/include/asm-x86/spec_ctrl.h
+index 3cd72e40305f..f8f0ac47e759 100644
+--- a/xen/include/asm-x86/spec_ctrl.h
++++ b/xen/include/asm-x86/spec_ctrl.h
+@@ -31,7 +31,7 @@
+ * context switched per domain, and some inhibited in the S3 path.
+ */
+ #define SCF_use_shadow (1 << 0)
+-#define SCF_ist_wrmsr (1 << 1)
++#define SCF_ist_sc_msr (1 << 1)
+ #define SCF_ist_rsb (1 << 2)
+ #define SCF_verw (1 << 3)
+
+@@ -46,7 +46,7 @@
+ * These are the controls to inhibit on the S3 resume path until microcode has
+ * been reloaded.
+ */
+-#define SCF_IST_MASK (SCF_ist_wrmsr)
++#define SCF_IST_MASK (SCF_ist_sc_msr)
+
+ /*
+ * Some speculative protections are per-domain. These settings are merged
+diff --git a/xen/include/asm-x86/spec_ctrl_asm.h b/xen/include/asm-x86/spec_ctrl_asm.h
+index 66b00d511fc6..0ff1b118f882 100644
+--- a/xen/include/asm-x86/spec_ctrl_asm.h
++++ b/xen/include/asm-x86/spec_ctrl_asm.h
+@@ -266,8 +266,8 @@
+
+ .L\@_skip_rsb:
+
+- test $SCF_ist_wrmsr, %al
+- jz .L\@_skip_wrmsr
++ test $SCF_ist_sc_msr, %al
++ jz .L\@_skip_msr_spec_ctrl
+
+ xor %edx, %edx
+ testb $3, UREGS_cs(%rsp)
+@@ -290,7 +290,7 @@ UNLIKELY_DISPATCH_LABEL(\@_serialise):
+ * to speculate around the WRMSR. As a result, we need a dispatch
+ * serialising instruction in the else clause.
+ */
+-.L\@_skip_wrmsr:
++.L\@_skip_msr_spec_ctrl:
+ lfence
+ UNLIKELY_END(\@_serialise)
+ .endm
+@@ -301,7 +301,7 @@ UNLIKELY_DISPATCH_LABEL(\@_serialise):
+ * Requires %rbx=stack_end
+ * Clobbers %rax, %rcx, %rdx
+ */
+- testb $SCF_ist_wrmsr, STACK_CPUINFO_FIELD(spec_ctrl_flags)(%rbx)
++ testb $SCF_ist_sc_msr, STACK_CPUINFO_FIELD(spec_ctrl_flags)(%rbx)
+ jz .L\@_skip
+
+ DO_SPEC_CTRL_EXIT_TO_XEN
+--
+2.35.1
+