<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"> arch/i386/kernel/cpu/mcheck/non-fatal.c |    4 -
 arch/i386/power/Makefile                |    2 
 arch/i386/power/smp.c                   |   80 --------------------------------
 kernel/power/Makefile                   |    2 
 kernel/power/atomic_copy.c              |   36 ++------------
 kernel/power/process.c                  |   74 -----------------------------
 kernel/power/suspend.c                  |   12 ----
 kernel/power/suspend2-smp.c             |   12 ----
 kernel/power/suspend2-smp.h             |    7 --
 mm/highmem.c                            |    6 --
 10 files changed, 11 insertions(+), 224 deletions(-)
diff -ruNp 904-hotplug-cpu.patch-old/arch/i386/kernel/cpu/mcheck/non-fatal.c 904-hotplug-cpu.patch-new/arch/i386/kernel/cpu/mcheck/non-fatal.c
--- 904-hotplug-cpu.patch-old/arch/i386/kernel/cpu/mcheck/non-fatal.c	2005-07-22 14:00:04.000000000 +1000
+++ 904-hotplug-cpu.patch-new/arch/i386/kernel/cpu/mcheck/non-fatal.c	2005-07-22 06:27:24.000000000 +1000
@@ -17,7 +17,6 @@
 #include &lt;linux/interrupt.h&gt;
 #include &lt;linux/smp.h&gt;
 #include &lt;linux/module.h&gt;
-#include &lt;linux/suspend.h&gt;
 
 #include &lt;asm/processor.h&gt; 
 #include &lt;asm/system.h&gt;
@@ -59,8 +58,7 @@ static DECLARE_WORK(mce_work, mce_work_f
 
 static void mce_work_fn(void *data)
 { 
-	if (!test_suspend_state(SUSPEND_RUNNING))
-		on_each_cpu(mce_checkregs, NULL, 1, 1);
+	on_each_cpu(mce_checkregs, NULL, 1, 1);
 	schedule_delayed_work(&amp;mce_work, MCE_RATE);
 } 
 
diff -ruNp 904-hotplug-cpu.patch-old/arch/i386/power/Makefile 904-hotplug-cpu.patch-new/arch/i386/power/Makefile
--- 904-hotplug-cpu.patch-old/arch/i386/power/Makefile	2005-07-22 14:00:05.000000000 +1000
+++ 904-hotplug-cpu.patch-new/arch/i386/power/Makefile	2005-07-22 06:36:08.000000000 +1000
@@ -1,2 +1,2 @@
-obj-$(CONFIG_PM)		+= cpu.o smp.o
+obj-$(CONFIG_PM)		+= cpu.o
 obj-$(CONFIG_SOFTWARE_SUSPEND)	+= swsusp.o
diff -ruNp 904-hotplug-cpu.patch-old/arch/i386/power/smp.c 904-hotplug-cpu.patch-new/arch/i386/power/smp.c
--- 904-hotplug-cpu.patch-old/arch/i386/power/smp.c	2005-07-22 14:00:05.000000000 +1000
+++ 904-hotplug-cpu.patch-new/arch/i386/power/smp.c	2005-07-22 06:35:58.000000000 +1000
@@ -1,86 +1,6 @@
-//#ifdef CONFIG_SMP
 #include &lt;linux/suspend.h&gt;
-#include &lt;linux/irq.h&gt;
 #include &lt;asm/tlbflush.h&gt;
 #include &lt;asm/suspend2.h&gt;
 
-extern atomic_t suspend_cpu_counter __nosavedata;
-unsigned char * my_saved_context __nosavedata;
-static unsigned long c_loops_per_jiffy_ref[NR_CPUS] __nosavedata;
 
-struct suspend2_saved_context suspend2_saved_contexts[NR_CPUS];
-struct suspend2_saved_context suspend2_saved_context;	/* temporary storage */
-cpumask_t saved_affinity[NR_IRQS];
 
-/*
- * Save and restore processor state for secondary processors.
- * IRQs (and therefore preemption) are already disabled 
- * when we enter here (IPI).
- */
-
-static volatile int loop __nosavedata;
-
-void __smp_suspend_lowlevel(void * data)
-{
-	__asm__( "movl %%ecx,%%cr3\n" ::"c"(__pa(swsusp_pg_dir)));
-
-	if (test_suspend_state(SUSPEND_NOW_RESUMING)) {
-		BUG_ON(!irqs_disabled());
-		kernel_fpu_begin();
-		c_loops_per_jiffy_ref[raw_smp_processor_id()] = current_cpu_data.loops_per_jiffy;
-		atomic_inc(&amp;suspend_cpu_counter);
-
-		/* Only image copied back while we spin in this loop. Our
-		 * task info should not be looked at while this is happening
-		 * (which smp_processor_id() will do( */
-		while (test_suspend_state(SUSPEND_FREEZE_SMP)) { 
-			cpu_relax();
-			barrier();
-		}
-
-		while (atomic_read(&amp;suspend_cpu_counter) != raw_smp_processor_id()) {
-			cpu_relax();
-			barrier();
-		}
-	       	my_saved_context = (unsigned char *) (suspend2_saved_contexts + raw_smp_processor_id());
-		for (loop = sizeof(struct suspend2_saved_context); loop--; loop)
-			*(((unsigned char *) &amp;suspend2_saved_context) + loop - 1) = *(my_saved_context + loop - 1);
-		suspend2_arch_restore_processor_context();
-#ifdef CONFIG_SMP
-		cpu_clear(raw_smp_processor_id(), per_cpu(cpu_tlbstate, raw_smp_processor_id()).active_mm-&gt;cpu_vm_mask);
-#endif
-		load_cr3(swapper_pg_dir);
-		wbinvd();
-		__flush_tlb_all();
-		current_cpu_data.loops_per_jiffy = c_loops_per_jiffy_ref[raw_smp_processor_id()];
-		mtrr_restore_one_cpu();
-		atomic_dec(&amp;suspend_cpu_counter);
-	} else {	/* suspending */
-		BUG_ON(!irqs_disabled());
-		/* 
-		 *Save context and go back to idling.
-		 * Note that we cannot leave the processor
-		 * here. It must be able to receive IPIs if
-		 * the LZF compression driver (eg) does a
-		 * vfree after compressing the kernel etc
-		 */
-		while (test_suspend_state(SUSPEND_FREEZE_SMP) &amp;&amp;
-			(atomic_read(&amp;suspend_cpu_counter) != (raw_smp_processor_id() - 1))) {
-			cpu_relax();
-			barrier();
-		}
-		suspend2_arch_save_processor_context();
-		my_saved_context = (unsigned char *) (suspend2_saved_contexts + raw_smp_processor_id());
-		for (loop = sizeof(struct suspend2_saved_context); loop--; loop)
-			*(my_saved_context + loop - 1) = *(((unsigned char *) &amp;suspend2_saved_context) + loop - 1);
-		atomic_inc(&amp;suspend_cpu_counter);
-		/* Now spin until the atomic copy of the kernel is made. */
-		while (test_suspend_state(SUSPEND_FREEZE_SMP)) {
-			cpu_relax();
-			barrier();
-		}
-		atomic_dec(&amp;suspend_cpu_counter);
-		kernel_fpu_end();
-	}
-}
-//#endif
diff -ruNp 904-hotplug-cpu.patch-old/kernel/power/atomic_copy.c 904-hotplug-cpu.patch-new/kernel/power/atomic_copy.c
--- 904-hotplug-cpu.patch-old/kernel/power/atomic_copy.c	2005-07-22 14:00:05.000000000 +1000
+++ 904-hotplug-cpu.patch-new/kernel/power/atomic_copy.c	2005-07-22 06:53:53.000000000 +1000
@@ -1,32 +1,11 @@
 /*
- * SMP support:
- * CPU enters this routine during suspend. All other CPUs enter
- * __smp_suspend_lowlevel. The one through
- * which the suspend is initiated (which, for simplicity, is always CPU 0)
- * sends the others here using an IPI during do_suspend2_pre_copy. They
- * remain here until after the atomic copy of the kernel is made, to ensure
- * that they don't mess with memory in the meantime (even just idling will
- * do that). Once the atomic copy is made, they are free to carry on idling.
- * Note that we must let them go, because if we're using compression, the
- * vfree calls in the compressors will result in IPIs being called and hanging
- * because the CPUs are still here.
- *
- * At resume time, we do a similar thing. CPU 0 sends the others in here using
- * an IPI. It then copies the original kernel back, restores its own processor
- * context and flushes local tlbs before freeing the others to do the same.
- * They can then go back to idling while CPU 0 reloads pageset 2, cleans up
- * and unfreezes the processes.
- *
- * (Remember that freezing and thawing processes also uses IPIs, as may
- * decompressing the data. Again, therefore, we cannot leave the other processors
- * in here).
- * 
  * At the moment, we do nothing about APICs, even though the code is there.
  */
 
 #include &lt;linux/suspend.h&gt;
 #include &lt;linux/highmem.h&gt;
 #include &lt;linux/kthread.h&gt;
+#include &lt;linux/irq.h&gt;
 #include &lt;asm/setup.h&gt;
 #include &lt;asm/suspend2.h&gt;
 #include &lt;asm/param.h&gt;
@@ -39,7 +18,6 @@
 #include "plugins.h"
 #include "atomic_copy.h"
 #include "suspend2.h"
-#include "suspend2-smp.h"
 #include "checksum.h"
 
 volatile static int state1 __nosavedata = 0;
@@ -57,6 +35,9 @@ __nosavedata char resume_commandline[COM
 
 static atomic_t atomic_copy_hold;
 
+struct suspend2_saved_context suspend2_saved_context;	/* temporary storage */
+cpumask_t saved_affinity[NR_IRQS];
+
 /**
  * copyback_prepare
  * Functionality   : Preparatory steps for copying the original kernel back.
@@ -90,9 +71,6 @@ static void copyback_prepare(void)
 
 	suspend2_map_atomic_copy_pages();
 
-	/* Get other cpus ready to restore their original contexts */
-	smp_suspend();
-
 	local_irq_disable();
 
 	preempt_disable();
@@ -160,9 +138,6 @@ static void suspend2_pre_copy(void)
 {
 	suspend2_arch_pre_copy();
 
-	/* Save other cpu contexts */
-	smp_suspend();
-
 	suspend_drivers_suspend(SUSPEND_DRIVERS_IRQS_ENABLED);
 
 	mb();
@@ -413,8 +388,7 @@ int __suspend_atomic_restore(void *data)
 	while atomic_read(&amp;atomic_copy_hold)
 		schedule();
 
-	/* Suspend always runs on processor 0 */
-	ensure_on_processor_zero();
+	disable_nonboot_cpus();
 
 	suspend2_prepare_status(DONT_CLEAR_BAR, "Freezing processes");
 	
diff -ruNp 904-hotplug-cpu.patch-old/kernel/power/Makefile 904-hotplug-cpu.patch-new/kernel/power/Makefile
--- 904-hotplug-cpu.patch-old/kernel/power/Makefile	2005-07-22 14:00:05.000000000 +1000
+++ 904-hotplug-cpu.patch-new/kernel/power/Makefile	2005-07-22 06:37:40.000000000 +1000
@@ -19,8 +19,6 @@ suspend_core-objs := io.o pagedir.o prep
 		userspace-nofreeze.o \
 		power_off.o atomic_copy.o
 
-obj-$(CONFIG_SMP)			+= suspend2-smp.o
-
 obj-$(CONFIG_SUSPEND2)			+= suspend_core.o
 obj-$(CONFIG_CRYPTO)			+= compression.o encryption.o
 
diff -ruNp 904-hotplug-cpu.patch-old/kernel/power/process.c 904-hotplug-cpu.patch-new/kernel/power/process.c
--- 904-hotplug-cpu.patch-old/kernel/power/process.c	2005-07-22 14:00:04.000000000 +1000
+++ 904-hotplug-cpu.patch-new/kernel/power/process.c	2005-07-22 06:29:46.000000000 +1000
@@ -127,56 +127,6 @@ void refrigerator(void)
 }
 
 
-#ifdef CONFIG_SMP
-static void __smp_pause(void * data)
-{
-	atomic_inc(&amp;suspend_cpu_counter);
-	while(test_suspend_state(SUSPEND_FREEZE_SMP)) {
-		cpu_relax();
-		barrier();
-	}
-	local_flush_tlb();
-	atomic_dec(&amp;suspend_cpu_counter);
-}
-
-void smp_pause(void)
-{
-	set_suspend_state(SUSPEND_FREEZE_SMP);
-	smp_call_function(__smp_pause, NULL, 0, 0);
-
-	while (atomic_read(&amp;suspend_cpu_counter) &lt; (num_online_cpus() - 1)) {
-		cpu_relax();
-		barrier();
-	}
-}
-
-void smp_continue(void)
-{
-	clear_suspend_state(SUSPEND_FREEZE_SMP);
-		
-	while (atomic_read(&amp;suspend_cpu_counter)) {
-		cpu_relax();
-		barrier();
-	}
-}
-
-extern void __smp_suspend_lowlevel(void * info);
-
-void smp_suspend(void)
-{
-	set_suspend_state(SUSPEND_FREEZE_SMP);
-	smp_call_function(__smp_suspend_lowlevel, NULL, 0, 0);
-
-	while (atomic_read(&amp;suspend_cpu_counter) &lt; (num_online_cpus() - 1)) {
-		cpu_relax();
-		barrier();
-	}
-}
-#else
-#define smp_pause() do { } while(0)
-#define smp_continue() do { } while(0)
-#define smp_suspend() do { } while(0)
-#endif
 
 /*
  * num_to_be_frozen
@@ -239,16 +189,8 @@ static int freeze_threads(int type, int 
 	do {
 		int numsignalled = 0;
 
-		/* 
-		 * Pause the other processors so we can safely
-		 * change threads' flags
-		 */
-		smp_pause();
-
-		if (test_result_state(SUSPEND_ABORTED)) {
-			smp_continue();
+		if (test_result_state(SUSPEND_ABORTED))
 			return 1;
-		}
 
 		preempt_disable();
 
@@ -290,11 +232,6 @@ static int freeze_threads(int type, int 
 
 		read_unlock(&amp;tasklist_lock);
 
-		/* 
-		 * Let the processes run.
-		 */		
-		smp_continue();
-
 		preempt_enable();
 
 		local_irq_enable();
@@ -439,13 +376,6 @@ void thaw_processes(int which_threads)
 
 	clear_suspend_state(SUSPEND_DISABLE_SYNCING);
 	
-	/* 
-	 * Pause the other processors so we can safely
-	 * change threads' flags
-	 */
-
-	smp_pause();
-
 	preempt_disable();
 	
 	local_irq_disable();
@@ -464,8 +394,6 @@ void thaw_processes(int which_threads)
 
 	read_unlock(&amp;tasklist_lock);
 
-	smp_continue();
-	
 	preempt_enable();
 
 	local_irq_enable();
diff -ruNp 904-hotplug-cpu.patch-old/kernel/power/suspend2-smp.c 904-hotplug-cpu.patch-new/kernel/power/suspend2-smp.c
--- 904-hotplug-cpu.patch-old/kernel/power/suspend2-smp.c	2005-07-22 14:00:05.000000000 +1000
+++ 904-hotplug-cpu.patch-new/kernel/power/suspend2-smp.c	1970-01-01 10:00:00.000000000 +1000
@@ -1,12 +0,0 @@
-#include &lt;linux/sched.h&gt;
-
-void ensure_on_processor_zero(void)
-{
-	set_cpus_allowed(current, cpumask_of_cpu(0));
-	BUG_ON(smp_processor_id() != 0);
-}
-
-void return_to_all_processors(void)
-{
-	set_cpus_allowed(current, CPU_MASK_ALL);
-}
diff -ruNp 904-hotplug-cpu.patch-old/kernel/power/suspend2-smp.h 904-hotplug-cpu.patch-new/kernel/power/suspend2-smp.h
--- 904-hotplug-cpu.patch-old/kernel/power/suspend2-smp.h	2005-07-22 14:00:05.000000000 +1000
+++ 904-hotplug-cpu.patch-new/kernel/power/suspend2-smp.h	1970-01-01 10:00:00.000000000 +1000
@@ -1,7 +0,0 @@
-#ifdef CONFIG_SMP
-extern void ensure_on_processor_zero(void);
-extern void return_to_all_processors(void);
-#else
-#define ensure_on_processor_zero() do { } while(0)
-#define return_to_all_processors() do { } while(0)
-#endif
diff -ruNp 904-hotplug-cpu.patch-old/kernel/power/suspend.c 904-hotplug-cpu.patch-new/kernel/power/suspend.c
--- 904-hotplug-cpu.patch-old/kernel/power/suspend.c	2005-07-22 14:00:05.000000000 +1000
+++ 904-hotplug-cpu.patch-new/kernel/power/suspend.c	2005-07-22 10:25:07.000000000 +1000
@@ -109,7 +109,6 @@
 #include "suspend2_common.h"
 #include "extent.h"
 #include "power_off.h"
-#include "suspend2-smp.h"
 #include "atomic_copy.h"
  
 #ifdef  CONFIG_X86
@@ -300,13 +299,6 @@ int save_image_part1(void)
 	
 	suspend2_unmap_atomic_copy_pages();
 
-	/* 
-	 * Other processors have waited for me to make the atomic copy of the 
-	 * kernel
-	 */
-
-	smp_continue();
-	
 #ifdef CONFIG_X86
 	kernel_fpu_end();
 #endif
@@ -588,7 +580,7 @@ static inline int suspend2_init(void)
 	if (allocate_bitmaps())
 		return 0;
 	
-	ensure_on_processor_zero();
+	disable_nonboot_cpus();
 
 	return 1;
 }
@@ -637,7 +629,7 @@ void inline suspend2_cleanup(void)
 
 	suspend2_cleanup_console();
 
-	return_to_all_processors();
+	enable_nonboot_cpus();
 }
 
 /*
diff -ruNp 904-hotplug-cpu.patch-old/mm/highmem.c 904-hotplug-cpu.patch-new/mm/highmem.c
--- 904-hotplug-cpu.patch-old/mm/highmem.c	2005-07-22 14:00:04.000000000 +1000
+++ 904-hotplug-cpu.patch-new/mm/highmem.c	2005-07-22 06:25:09.000000000 +1000
@@ -26,7 +26,6 @@
 #include &lt;linux/init.h&gt;
 #include &lt;linux/hash.h&gt;
 #include &lt;linux/highmem.h&gt;
-#include &lt;linux/suspend.h&gt;
 #include &lt;asm/tlbflush.h&gt;
 
 static mempool_t *page_pool, *isa_page_pool;
@@ -96,10 +95,7 @@ static void flush_all_zero_pkmaps(void)
 
 		set_page_address(page, NULL);
 	}
-	if (test_suspend_state(SUSPEND_FREEZE_SMP))
-		__flush_tlb();
-	else
-		flush_tlb_kernel_range(PKMAP_ADDR(0), PKMAP_ADDR(LAST_PKMAP));
+	flush_tlb_kernel_range(PKMAP_ADDR(0), PKMAP_ADDR(LAST_PKMAP));
 }
 
 static inline unsigned long map_new_virtual(struct page *page)
</pre></body></html>