Skip to contentSkip to conversation

x86: only set warm_reset_vector for NMI

PATCH In review Yinghai Lu 1 participant 3 messages Feb 27, 2009 x86

lore
Share & tools
lore

Yinghai Lu

author
#0 lore raw

PATCH 1/1 x86: only set warm_reset_vector for NMI

Impact: cleanup

don't need to set that for INIT etc

---
 arch/x86/kernel/smpboot.c |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
arch/x86/kernel/smpboot.c +11 -6
Index: linux-2.6/arch/x86/kernel/smpboot.c
===================================================================
@@ -609,7 +609,7 @@ wakeup_secondary_cpu_via_nmi(int logical
 	return (send_status | accept_status);
 }
 
-int __devinit
+static int __devinit
 wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip)
 {
 	unsigned long send_status, accept_status = 0;
@@ -816,11 +816,14 @@ do_rest:
 
 	atomic_set(&init_deasserted, 0);
 
-	if (get_uv_system_type() != UV_NON_UNIQUE_APIC) {
+	if (apic->wakeup_secondary_cpu == wakeup_secondary_cpu_via_nmi) {
 
 		pr_debug("Setting warm reset code and vector.\n");
 
 		smpboot_setup_warm_reset_vector(start_ip);
+	}
+
+	if (get_uv_system_type() != UV_NON_UNIQUE_APIC) {
 		/*
 		 * Be paranoid about clearing APIC errors.
 		*/
@@ -893,10 +896,12 @@ do_rest:
 	/* mark "stuck" area as not stuck */
 	*((volatile unsigned long *)trampoline_base) = 0;
 
-	/*
-	 * Cleanup possible dangling ends...
-	 */
-	smpboot_restore_warm_reset_vector();
+	if (apic->wakeup_secondary_cpu == wakeup_secondary_cpu_via_nmi) {
+		/*
+		 * Cleanup possible dangling ends...
+		 */
+		smpboot_restore_warm_reset_vector();
+	}
 
 	return boot_error;
 }
author
#1 lore raw

please discard this one. it doesn't consider system with integrated apic.

YH

Quoted 57 lines · Yinghai Lu

Impact: cleanup

don't need to set that for INIT etc

---
 arch/x86/kernel/smpboot.c |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

Index: linux-2.6/arch/x86/kernel/smpboot.c
===================================================================

arch/x86/kernel/smpboot.c +11 -6
@@ -609,7 +609,7 @@ wakeup_secondary_cpu_via_nmi(int logical
 	return (send_status | accept_status);
 }
 
-int __devinit
+static int __devinit
 wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip)
 {
 	unsigned long send_status, accept_status = 0;
@@ -816,11 +816,14 @@ do_rest:
 
 	atomic_set(&init_deasserted, 0);
 
-	if (get_uv_system_type() != UV_NON_UNIQUE_APIC) {
+	if (apic->wakeup_secondary_cpu == wakeup_secondary_cpu_via_nmi) {
 
 		pr_debug("Setting warm reset code and vector.\n");
 
 		smpboot_setup_warm_reset_vector(start_ip);
+	}
+
+	if (get_uv_system_type() != UV_NON_UNIQUE_APIC) {
 		/*
 		 * Be paranoid about clearing APIC errors.
 		*/
@@ -893,10 +896,12 @@ do_rest:
 	/* mark "stuck" area as not stuck */
 	*((volatile unsigned long *)trampoline_base) = 0;
 
-	/*
-	 * Cleanup possible dangling ends...
-	 */
-	smpboot_restore_warm_reset_vector();
+	if (apic->wakeup_secondary_cpu == wakeup_secondary_cpu_via_nmi) {
+		/*
+		 * Cleanup possible dangling ends...
+		 */
+		smpboot_restore_warm_reset_vector();
+	}
 
 	return boot_error;
 }
author
#2 lore raw

it doesn't consider system with integrated apic.

==>
it doesn't consider system without integrated apic.

Quoted 64 lines · Yinghai Lu

please discard this one. it doesn't consider system with integrated apic.

YH

Quoted 57 lines · Yinghai Lu

Impact: cleanup

don't need to set that for INIT etc

---
 arch/x86/kernel/smpboot.c |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

Index: linux-2.6/arch/x86/kernel/smpboot.c
===================================================================

arch/x86/kernel/smpboot.c +11 -6
@@ -609,7 +609,7 @@ wakeup_secondary_cpu_via_nmi(int logical
 	return (send_status | accept_status);
 }
 
-int __devinit
+static int __devinit
 wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip)
 {
 	unsigned long send_status, accept_status = 0;
@@ -816,11 +816,14 @@ do_rest:
 
 	atomic_set(&init_deasserted, 0);
 
-	if (get_uv_system_type() != UV_NON_UNIQUE_APIC) {
+	if (apic->wakeup_secondary_cpu == wakeup_secondary_cpu_via_nmi) {
 
 		pr_debug("Setting warm reset code and vector.\n");
 
 		smpboot_setup_warm_reset_vector(start_ip);
+	}
+
+	if (get_uv_system_type() != UV_NON_UNIQUE_APIC) {
 		/*
 		 * Be paranoid about clearing APIC errors.
 		*/
@@ -893,10 +896,12 @@ do_rest:
 	/* mark "stuck" area as not stuck */
 	*((volatile unsigned long *)trampoline_base) = 0;
 
-	/*
-	 * Cleanup possible dangling ends...
-	 */
-	smpboot_restore_warm_reset_vector();
+	if (apic->wakeup_secondary_cpu == wakeup_secondary_cpu_via_nmi) {
+		/*
+		 * Cleanup possible dangling ends...
+		 */
+		smpboot_restore_warm_reset_vector();
+	}
 
 	return boot_error;
 }