XPTI being a speculation mitigation feels better to be initialized in
spec_ctrl_init_domain().
No functional change intended, although the call to spec_ctrl_init_domain() in
arch_domain_create() needs to be moved ahead of pv_domain_initialise() for
d->->arch.pv.xpti to be correctly set.
Move it ahead of most of the initialization functions, since
spec_ctrl_init_domain() doesn't depend on any member in the struct domain being
set.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
is_pv_domain(d) ? __HYPERVISOR_COMPAT_VIRT_START : ~0u;
#endif
+ spec_ctrl_init_domain(d);
+
if ( (rc = paging_domain_init(d)) != 0 )
goto fail;
paging_initialised = true;
d->arch.msr_relaxed = config->arch.misc_flags & XEN_X86_MSR_RELAXED;
- spec_ctrl_init_domain(d);
-
return 0;
fail:
d->arch.ctxt_switch = &pv_csw;
- d->arch.pv.xpti = is_hardware_domain(d) ? opt_xpti_hwdom : opt_xpti_domu;
-
if ( !is_pv_32bit_domain(d) && use_invpcid && cpu_has_pcid )
switch ( ACCESS_ONCE(opt_pcid) )
{
(ibpb ? SCF_entry_ibpb : 0) |
(bhb ? SCF_entry_bhb : 0) |
0;
+
+ if ( pv )
+ d->arch.pv.xpti = is_hardware_domain(d) ? opt_xpti_hwdom
+ : opt_xpti_domu;
}
void __init init_speculation_mitigations(void)