Skip to contentSkip to conversation

x86/hpet: replace disabling of legacy broadcast

PATCH In review Jan Beulich 1 participant 1 message Mar 27, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 x86/hpet: replace disabling of legacy broadcast

... by the call to hpet_disable() added in the immediately preceding patch.

In order to retain the behavior intended by c/s 23776:0ddb4481f883, implement one of the alternative options pointed out there: remove CPUs from the online map in __stop_this_cpu() (and hence doing so in stop_this_cpu() is no longer needed).

xen/arch/x86/crash.c +0 -3
@@ -61,9 +61,6 @@ static void nmi_shootdown_cpus(void)
 
     local_irq_disable();
 
-    if ( hpet_broadcast_is_available() )
-        hpet_disable_legacy_broadcast();
-
     crashing_cpu = smp_processor_id();
     local_irq_count(crashing_cpu) = 0;
 
xen/arch/x86/hpet.c +4 -0
@@ -783,7 +783,11 @@ void hpet_disable(void)
     u32 id;
 
     if ( !hpet_boot_cfg )
+    {
+        if ( hpet_broadcast_is_available() )
+            hpet_disable_legacy_broadcast();
         return;
+    }
 
     hpet_write32(*hpet_boot_cfg & ~HPET_CFG_ENABLE, HPET_CFG);
 
xen/arch/x86/smp.c +2 -1
@@ -349,12 +349,13 @@ void __stop_this_cpu(void)
      */
     clts();
     asm volatile ( "fninit" );
+
+    cpumask_clear_cpu(smp_processor_id(), &cpu_online_map);
 }
 
 static void stop_this_cpu(void *dummy)
 {
     __stop_this_cpu();
-    cpumask_clear_cpu(smp_processor_id(), &cpu_online_map);
     for ( ; ; )
         halt();
 }

x86/hpet: replace disabling of legacy broadcast

... by the call to hpet_disable() added in the immediately preceding patch.

In order to retain the behavior intended by c/s 23776:0ddb4481f883, implement one of the alternative options pointed out there: remove CPUs from the online map in __stop_this_cpu() (and hence doing so in stop_this_cpu() is no longer needed).

xen/arch/x86/crash.c +0 -3
@@ -61,9 +61,6 @@ static void nmi_shootdown_cpus(void)
 
     local_irq_disable();
 
-    if ( hpet_broadcast_is_available() )
-        hpet_disable_legacy_broadcast();
-
     crashing_cpu = smp_processor_id();
     local_irq_count(crashing_cpu) = 0;
 
xen/arch/x86/hpet.c +4 -0
@@ -783,7 +783,11 @@ void hpet_disable(void)
     u32 id;
 
     if ( !hpet_boot_cfg )
+    {
+        if ( hpet_broadcast_is_available() )
+            hpet_disable_legacy_broadcast();
         return;
+    }
 
     hpet_write32(*hpet_boot_cfg & ~HPET_CFG_ENABLE, HPET_CFG);
 
xen/arch/x86/smp.c +2 -1
@@ -349,12 +349,13 @@ void __stop_this_cpu(void)
      */
     clts();
     asm volatile ( "fninit" );
+
+    cpumask_clear_cpu(smp_processor_id(), &cpu_online_map);
 }
 
 static void stop_this_cpu(void *dummy)
 {
     __stop_this_cpu();
-    cpumask_clear_cpu(smp_processor_id(), &cpu_online_map);
     for ( ; ; )
         halt();
 }

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel