mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
x86/levelling: Pass a vcpu rather than a domain to ctxt_switch_levelling()
A subsequent change needs to special-case OSXSAVE handling, which is per-vcpu rather than per-domain. No functional change. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
3b7cac5232
commit
33b23e5ab3
5 files changed
+8
-6
No files matched your search
@@ -203,9 +203,10 @@ static void __init noinline probe_masking_msrs(void)
|
||||
* used to context switch to the default host state (by the cpu bringup-code,
|
||||
* crash path, etc).
|
||||
*/
|
||||
static void amd_ctxt_switch_levelling(const struct domain *nextd)
|
||||
static void amd_ctxt_switch_levelling(const struct vcpu *next)
|
||||
{
|
||||
struct cpuidmasks *these_masks = &this_cpu(cpuidmasks);
|
||||
const struct domain *nextd = next ? next->domain : NULL;
|
||||
const struct cpuidmasks *masks =
|
||||
(nextd && is_pv_domain(nextd) && nextd->arch.pv_domain.cpuidmasks)
|
||||
? nextd->arch.pv_domain.cpuidmasks : &cpuidmask_defaults;
|
||||
|
||||
@@ -90,11 +90,11 @@ static const struct cpu_dev default_cpu = {
|
||||
};
|
||||
static const struct cpu_dev *this_cpu = &default_cpu;
|
||||
|
||||
static void default_ctxt_switch_levelling(const struct domain *nextd)
|
||||
static void default_ctxt_switch_levelling(const struct vcpu *next)
|
||||
{
|
||||
/* Nop */
|
||||
}
|
||||
void (* __read_mostly ctxt_switch_levelling)(const struct domain *nextd) =
|
||||
void (* __read_mostly ctxt_switch_levelling)(const struct vcpu *next) =
|
||||
default_ctxt_switch_levelling;
|
||||
|
||||
bool_t opt_cpu_info;
|
||||
|
||||
@@ -151,9 +151,10 @@ static void __init probe_masking_msrs(void)
|
||||
* used to context switch to the default host state (by the cpu bringup-code,
|
||||
* crash path, etc).
|
||||
*/
|
||||
static void intel_ctxt_switch_levelling(const struct domain *nextd)
|
||||
static void intel_ctxt_switch_levelling(const struct vcpu *next)
|
||||
{
|
||||
struct cpuidmasks *these_masks = &this_cpu(cpuidmasks);
|
||||
const struct domain *nextd = next ? next->domain : NULL;
|
||||
const struct cpuidmasks *masks;
|
||||
|
||||
if (cpu_has_cpuid_faulting) {
|
||||
|
||||
@@ -2130,7 +2130,7 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
|
||||
load_segments(next);
|
||||
}
|
||||
|
||||
ctxt_switch_levelling(nextd);
|
||||
ctxt_switch_levelling(next);
|
||||
}
|
||||
|
||||
context_saved(prev);
|
||||
|
||||
@@ -217,7 +217,7 @@ extern struct cpuinfo_x86 boot_cpu_data;
|
||||
extern struct cpuinfo_x86 cpu_data[];
|
||||
#define current_cpu_data cpu_data[smp_processor_id()]
|
||||
|
||||
extern void (*ctxt_switch_levelling)(const struct domain *nextd);
|
||||
extern void (*ctxt_switch_levelling)(const struct vcpu *next);
|
||||
|
||||
extern u64 host_pat;
|
||||
extern bool_t opt_cpu_info;
|
||||
|
||||