Skip to contentSkip to conversation

x86: two small cleanup patches

PATCH In review Wei Liu 3 participants 7 messages Apr 6, 2018

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

cover x86: two small cleanup patches

Wei Liu (2):
x86/cpu: get more information out from *_init_levelling
x86: remove unused parameter from smp_prepare_cpus

 xen/arch/x86/cpu/amd.c   | 9 +++++----
 xen/arch/x86/cpu/intel.c | 9 +++++----
 xen/arch/x86/setup.c     | 2 +-
 xen/arch/x86/smpboot.c   | 2 +-
 xen/include/xen/smp.h    | 2 +-
 5 files changed, 13 insertions(+), 11 deletions(-)
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
author
#1 lore raw

PATCH 1/2 x86/cpu: get more information out from *_init_levelling

---
 xen/arch/x86/cpu/amd.c   | 9 +++++----
 xen/arch/x86/cpu/intel.c | 9 +++++----
 2 files changed, 10 insertions(+), 8 deletions(-)
xen/arch/x86/cpu/amd.c +5 -4
index fc9677f020..6e3d0ae2b0 100644
@@ -265,7 +265,7 @@ static void __init noinline amd_init_levelling(void)
 	const struct cpuidmask *m = NULL;
 
 	if (probe_cpuid_faulting())
-		return;
+		goto out;
 
 	probe_masking_msrs();
 
@@ -341,6 +341,10 @@ static void __init noinline amd_init_levelling(void)
 		cpuidmask_defaults._6c &= (~0ULL << 32) | ecx;
 	}
 
+	if (levelling_caps)
+		ctxt_switch_masking = amd_ctxt_switch_masking;
+
+out:
 	if (opt_cpu_info) {
 		printk(XENLOG_INFO "Levelling caps: %#x\n", levelling_caps);
 		printk(XENLOG_INFO
@@ -354,9 +358,6 @@ static void __init noinline amd_init_levelling(void)
 		       (uint32_t)cpuidmask_defaults._7ab0,
 		       (uint32_t)cpuidmask_defaults._6c);
 	}
-
-	if (levelling_caps)
-		ctxt_switch_masking = amd_ctxt_switch_masking;
 }
 
 /*
xen/arch/x86/cpu/intel.c +5 -4
index 9477965321..4be760788c 100644
@@ -166,7 +166,7 @@ static void intel_ctxt_switch_masking(const struct vcpu *next)
 static void __init noinline intel_init_levelling(void)
 {
 	if (probe_cpuid_faulting())
-		return;
+		goto out;
 
 	probe_masking_msrs();
 
@@ -207,6 +207,10 @@ static void __init noinline intel_init_levelling(void)
 		cpuidmask_defaults.Da1 &= (~0ULL << 32) | eax;
 	}
 
+	if (levelling_caps)
+		ctxt_switch_masking = intel_ctxt_switch_masking;
+
+out:
 	if (opt_cpu_info) {
 		printk(XENLOG_INFO "Levelling caps: %#x\n", levelling_caps);
 
@@ -220,9 +224,6 @@ static void __init noinline intel_init_levelling(void)
 			       (uint32_t)cpuidmask_defaults.e1cd,
 			       (uint32_t)cpuidmask_defaults.Da1);
 	}
-
-	if (levelling_caps)
-		ctxt_switch_masking = intel_ctxt_switch_masking;
 }
 
 static void early_init_intel(struct cpuinfo_x86 *c)
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
author
#4 lore raw

PATCH 2/2 x86: remove unused parameter from smp_prepare_cpus

In reply to Wei Liu
---
 xen/arch/x86/setup.c   | 2 +-
 xen/arch/x86/smpboot.c | 2 +-
 xen/include/xen/smp.h  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
xen/arch/x86/setup.c +1 -1
index c0b97a748a..49cf963d7a 100644
@@ -1576,7 +1576,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     iommu_setup();    /* setup iommu if available */
 
-    smp_prepare_cpus(max_cpus);
+    smp_prepare_cpus();
 
     spin_debug_enable();
 
xen/arch/x86/smpboot.c +1 -1
index 98873df429..5daa7936aa 100644
@@ -1030,7 +1030,7 @@ static struct notifier_block cpu_smpboot_nfb = {
     .notifier_call = cpu_smpboot_callback
 };
 
-void __init smp_prepare_cpus(unsigned int max_cpus)
+void __init smp_prepare_cpus(void)
 {
     int rc;
 
xen/include/xen/smp.h +1 -1
index c55f57f09e..a64c9b3882 100644
@@ -17,7 +17,7 @@ extern void smp_send_state_dump(unsigned int cpu);
 /*
  * Prepare machine for booting other CPUs.
  */
-extern void smp_prepare_cpus(unsigned int max_cpus);
+extern void smp_prepare_cpus(void);
 
 /*
  * Final polishing of CPUs
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#2 lore raw

Re: [PATCH for-4.11 1/2] x86/cpu: get more information out from *_init_levelling

In reply to Wei Liu
Quoted 1 line · Wei Liu

For what purpose?  This is very deliberate that, if faulting is available, levelling never gets touched.

Levelling, as a mechanism, is strictly inferior to faulting.  On Intel, the sets of hardware with levelling and faulting are disjoint.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

author
#3 lore raw

Re: [PATCH for-4.11 1/2] x86/cpu: get more information out from *_init_levelling

In reply to Andrew Cooper
Quoted 9 lines · Andrew Cooper
Quoted 1 line · Wei Liu

For what purpose?  This is very deliberate that, if faulting is available, levelling never gets touched.

Levelling, as a mechanism, is strictly inferior to faulting.  On Intel, the sets of hardware with levelling and faulting are disjoint.

AFAICT levelling_caps is changed by probe_cpuid_faulting. That's what I'm getting at.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel