mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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:
1 parent
b2c0dc44b3
commit
7f69bf4898
4 files changed
+4
-6
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||