x86/spec-ctrl: Rework init_shadow_spec_ctrl_state() to take an info pointer

We're going to want to reuse it for a remote stack shortly.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Andrew Cooper committed 2025-08-15 11:13:41 +01:00
1 parent b2c0dc44b3
commit 7f69bf4898
4 files changed
+4 -6

No files matched your search

+1 -3
View File
@@ -99,10 +99,8 @@ extern bool opt_bp_spec_reduce;
*/
extern paddr_t l1tf_addr_mask, l1tf_safe_maddr;
static inline void init_shadow_spec_ctrl_state(void)
static inline void init_shadow_spec_ctrl_state(struct cpu_info *info)
{
struct cpu_info *info = get_cpu_info();
info->shadow_spec_ctrl = 0;
info->xen_spec_ctrl = default_xen_spec_ctrl;
info->scf = default_scf;
+1 -1
View File
@@ -1126,7 +1126,7 @@ void asmlinkage __init noreturn __start_xen(void)
/* Critical region without exception handling. Any fault is deadly! */
init_shadow_spec_ctrl_state();
init_shadow_spec_ctrl_state(info);
percpu_init_areas();
+1 -1
View File
@@ -332,7 +332,7 @@ void asmlinkage start_secondary(void)
set_current(idle_vcpu[cpu]);
this_cpu(curr_vcpu) = idle_vcpu[cpu];
rdmsrl(MSR_EFER, this_cpu(efer));
init_shadow_spec_ctrl_state();
init_shadow_spec_ctrl_state(info);
/*
* Just as during early bootstrap, it is convenient here to disable
+1 -1
View File
@@ -2226,7 +2226,7 @@ void __init init_speculation_mitigations(void)
opt_eager_fpu = should_use_eager_fpu();
/* (Re)init BSP state now that default_scf has been calculated. */
init_shadow_spec_ctrl_state();
init_shadow_spec_ctrl_state(get_cpu_info());
/*
* For microcoded IBRS only (i.e. Intel, pre eIBRS), it is recommended to
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.