File xsa456-0o.patch of Package xen.33138
# Commit 45dac88e78e8a2d9d8738eef884fe6730faf9e67
# Date 2024-04-09 16:37:30 +0100
# Author Andrew Cooper <andrew.cooper3@citrix.com>
# Committer Andrew Cooper <andrew.cooper3@citrix.com>
x86/spec-ctrl: Widen the {xen,last,default}_spec_ctrl fields
Right now, they're all bytes, but MSR_SPEC_CTRL has been steadily gaining new
features.
No functional change.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -66,7 +66,7 @@ bool __read_mostly opt_branch_harden = t
static bool __initdata opt_lock_harden;
bool __initdata bsp_delay_spec_ctrl;
-uint8_t __read_mostly default_xen_spec_ctrl;
+unsigned int __read_mostly default_xen_spec_ctrl;
uint8_t __read_mostly default_scf;
paddr_t __read_mostly l1tf_addr_mask, __read_mostly l1tf_safe_maddr;
--- a/xen/include/asm-x86/current.h
+++ b/xen/include/asm-x86/current.h
@@ -55,7 +55,7 @@ struct cpu_info {
/* See asm-x86/spec_ctrl_asm.h for usage. */
unsigned int shadow_spec_ctrl;
- uint8_t xen_spec_ctrl;
+ unsigned int xen_spec_ctrl;
uint8_t scf; /* SCF_* */
/*
@@ -73,7 +73,7 @@ struct cpu_info {
*/
bool use_pv_cr3;
- unsigned long __pad;
+ /* unsigned long __pad; */
/* get_stack_bottom() must be 16-byte aligned */
};
--- a/xen/include/asm-x86/spec_ctrl.h
+++ b/xen/include/asm-x86/spec_ctrl.h
@@ -94,7 +94,7 @@ extern int8_t opt_l1d_flush;
extern bool opt_branch_harden;
extern bool bsp_delay_spec_ctrl;
-extern uint8_t default_xen_spec_ctrl;
+extern unsigned int default_xen_spec_ctrl;
extern uint8_t default_scf;
extern int8_t opt_xpti_hwdom, opt_xpti_domu;
--- a/xen/include/asm-x86/spec_ctrl_asm.h
+++ b/xen/include/asm-x86/spec_ctrl_asm.h
@@ -155,7 +155,7 @@
andb $~SCF_use_shadow, CPUINFO_scf(%rsp)
/* Load Xen's intended value. */
- movzbl CPUINFO_xen_spec_ctrl(%rsp), %eax
+ mov CPUINFO_xen_spec_ctrl(%rsp), %eax
wrmsr
.endm
@@ -224,10 +224,10 @@
setnz %al
not %eax
and %al, STACK_CPUINFO_FIELD(scf)(%r14)
- movzbl STACK_CPUINFO_FIELD(xen_spec_ctrl)(%r14), %eax
+ mov STACK_CPUINFO_FIELD(xen_spec_ctrl)(%r14), %eax
.else
andb $~SCF_use_shadow, CPUINFO_scf(%rsp)
- movzbl CPUINFO_xen_spec_ctrl(%rsp), %eax
+ mov CPUINFO_xen_spec_ctrl(%rsp), %eax
.endif
wrmsr
@@ -425,7 +425,7 @@
/* Load Xen's intended value. */
mov $MSR_SPEC_CTRL, %ecx
- movzbl STACK_CPUINFO_FIELD(xen_spec_ctrl)(%r14), %eax
+ mov STACK_CPUINFO_FIELD(xen_spec_ctrl)(%r14), %eax
wrmsr
.L\@_skip_msr_spec_ctrl: