x86/levelling: Pass a vcpu rather than a domain to ctxt_switch_levelling()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 22 Aug 2016 16:39:44 +0000 (17:39 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 1 Sep 2016 10:41:05 +0000 (11:41 +0100)
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>
xen/arch/x86/cpu/amd.c
xen/arch/x86/cpu/common.c
xen/arch/x86/cpu/intel.c
xen/arch/x86/domain.c
xen/include/asm-x86/processor.h

index 9c298f891e855ca9b425038bb179a24e3010291e..784fa40c1d66d3adade7b6e9cc4b334449e35b28 100644 (file)
@@ -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;
index 577a01fe53b4879e0326d240e056740e161fa004..a5cfe5299b3fdf8630c1c28437e8f70e56658a70 100644 (file)
@@ -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;
index fe4736edc781087a2f919134cc796a3232c670d6..3491638931a1807598e92ad4fe5f4b9d5532851c 100644 (file)
@@ -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) {
index 1133ea2226d758c1a8e08fe230e575abe8c3832a..7ca1b660f2c6f3cf351fe06d4532c611ce03d806 100644 (file)
@@ -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);
index 487ae28a14da355b0761b6c966ddcc42c099cd16..3e6e35573adfa822f51dbd7554a033d0655323f0 100644 (file)
@@ -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;