[kernel] r17187 - in dists/squeeze/linux-2.6/debian: . patches/debian patches/series

Dann Frazier dannf at alioth.debian.org
Sun Apr 3 22:42:58 UTC 2011


Author: dannf
Date: Sun Apr  3 22:42:47 2011
New Revision: 17187

Log:
[powerpc] Revert kexec fix from 2.6.32.34 to avoid ABI change

Added:
   dists/squeeze/linux-2.6/debian/patches/debian/revert-powerpc-kexec-ABI-change-in-2.6.32.34.patch
Modified:
   dists/squeeze/linux-2.6/debian/changelog
   dists/squeeze/linux-2.6/debian/patches/series/33

Modified: dists/squeeze/linux-2.6/debian/changelog
==============================================================================
--- dists/squeeze/linux-2.6/debian/changelog	Sun Apr  3 20:30:24 2011	(r17186)
+++ dists/squeeze/linux-2.6/debian/changelog	Sun Apr  3 22:42:47 2011	(r17187)
@@ -16,6 +16,7 @@
     This fixes a panic caused by a regression introduced by the fix
     for CVE-2011-0711.
   * [powerpc] Revert kdump fix from 2.6.32.34 (FTBFS)
+  * [powerpc] Revert kexec fix from 2.6.32.34 to avoid ABI change
   * irda: validate peer name and attribute lengths (CVE-2011-1180)
 
  -- dann frazier <dannf at debian.org>  Thu, 31 Mar 2011 18:43:14 -0600

Added: dists/squeeze/linux-2.6/debian/patches/debian/revert-powerpc-kexec-ABI-change-in-2.6.32.34.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/debian/revert-powerpc-kexec-ABI-change-in-2.6.32.34.patch	Sun Apr  3 22:42:47 2011	(r17187)
@@ -0,0 +1,197 @@
+diff -urpN linux-2.6.32.36.orig/arch/powerpc/include/asm/kexec.h linux-2.6.32.36/arch/powerpc/include/asm/kexec.h
+--- linux-2.6.32.36.orig/arch/powerpc/include/asm/kexec.h	2011-03-27 12:31:47.000000000 -0600
++++ linux-2.6.32.36/arch/powerpc/include/asm/kexec.h	2011-04-03 16:31:12.128214057 -0600
+@@ -31,10 +31,6 @@
+ #define KEXEC_ARCH KEXEC_ARCH_PPC
+ #endif
+ 
+-#define KEXEC_STATE_NONE 0
+-#define KEXEC_STATE_IRQS_OFF 1
+-#define KEXEC_STATE_REAL_MODE 2
+-
+ #ifndef __ASSEMBLY__
+ #include <linux/cpumask.h>
+ #include <asm/reg.h>
+diff -urpN linux-2.6.32.36.orig/arch/powerpc/include/asm/paca.h linux-2.6.32.36/arch/powerpc/include/asm/paca.h
+--- linux-2.6.32.36.orig/arch/powerpc/include/asm/paca.h	2011-03-27 12:31:47.000000000 -0600
++++ linux-2.6.32.36/arch/powerpc/include/asm/paca.h	2011-04-03 16:31:12.128214057 -0600
+@@ -56,7 +56,7 @@ struct paca_struct {
+ 	struct lppaca *lppaca_ptr;	/* Pointer to LpPaca for PLIC */
+ #endif /* CONFIG_PPC_BOOK3S */
+ 	/*
+-	 * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c
++	 * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c 
+ 	 * load lock_token and paca_index with a single lwz
+ 	 * instruction.  They must travel together and be properly
+ 	 * aligned.
+@@ -76,7 +76,6 @@ struct paca_struct {
+ 	s16 hw_cpu_id;			/* Physical processor number */
+ 	u8 cpu_start;			/* At startup, processor spins until */
+ 					/* this becomes non-zero. */
+-	u8 kexec_state;         /* set when kexec down has irqs off */
+ #ifdef CONFIG_PPC_STD_MMU_64
+ 	struct slb_shadow *slb_shadow_ptr;
+ 
+diff -urpN linux-2.6.32.36.orig/arch/powerpc/kernel/asm-offsets.c linux-2.6.32.36/arch/powerpc/kernel/asm-offsets.c
+--- linux-2.6.32.36.orig/arch/powerpc/kernel/asm-offsets.c	2011-03-27 12:31:47.000000000 -0600
++++ linux-2.6.32.36/arch/powerpc/kernel/asm-offsets.c	2011-04-03 16:31:12.128214057 -0600
+@@ -183,7 +183,6 @@ int main(void)
+ #endif /* CONFIG_PPC_STD_MMU_64 */
+ 	DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp));
+ 	DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id));
+-	DEFINE(PACAKEXECSTATE, offsetof(struct paca_struct, kexec_state));
+ 	DEFINE(PACA_STARTPURR, offsetof(struct paca_struct, startpurr));
+ 	DEFINE(PACA_STARTSPURR, offsetof(struct paca_struct, startspurr));
+ 	DEFINE(PACA_USER_TIME, offsetof(struct paca_struct, user_time));
+diff -urpN linux-2.6.32.36.orig/arch/powerpc/kernel/machine_kexec_64.c linux-2.6.32.36/arch/powerpc/kernel/machine_kexec_64.c
+--- linux-2.6.32.36.orig/arch/powerpc/kernel/machine_kexec_64.c	2011-03-27 12:31:47.000000000 -0600
++++ linux-2.6.32.36/arch/powerpc/kernel/machine_kexec_64.c	2011-04-03 16:31:12.128214057 -0600
+@@ -156,23 +156,16 @@ void kexec_copy_flush(struct kimage *ima
+ 
+ #ifdef CONFIG_SMP
+ 
+-static int kexec_all_irq_disabled;
+-
++/* FIXME: we should schedule this function to be called on all cpus based
++ * on calling the interrupts, but we would like to call it off irq level
++ * so that the interrupt controller is clean.
++ */
+ static void kexec_smp_down(void *arg)
+ {
+-	local_irq_disable();
+-	mb(); /* make sure our irqs are disabled before we say they are */
+-	get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF;
+-	while (kexec_all_irq_disabled == 0)
+-		cpu_relax();
+-	mb(); /* make sure all irqs are disabled before this */
+-	/*
+-	 * Now every CPU has IRQs off, we can clear out any pending
+-	 * IPIs and be sure that no more will come in after this.
+-	 */
+ 	if (ppc_md.kexec_cpu_down)
+ 		ppc_md.kexec_cpu_down(0, 1);
+ 
++	local_irq_disable();
+ 	kexec_smp_wait();
+ 	/* NOTREACHED */
+ }
+@@ -200,18 +193,20 @@ static void wake_offline_cpus(void)
+ 	}
+ }
+ 
+-static void kexec_prepare_cpus_wait(int wait_state)
++static void kexec_prepare_cpus(void)
+ {
+ 	int my_cpu, i, notified=-1;
+ 
+ 	wake_offline_cpus();
++	smp_call_function(kexec_smp_down, NULL, /* wait */0);
+ 	my_cpu = get_cpu();
+-	/* Make sure each CPU has atleast made it to the state we need */
++
++	/* check the others cpus are now down (via paca hw cpu id == -1) */
+ 	for (i=0; i < NR_CPUS; i++) {
+ 		if (i == my_cpu)
+ 			continue;
+ 
+-		while (paca[i].kexec_state < wait_state) {
++		while (paca[i].hw_cpu_id != -1) {
+ 			barrier();
+ 			if (!cpu_possible(i)) {
+ 				printk("kexec: cpu %d hw_cpu_id %d is not"
+@@ -231,35 +226,20 @@ static void kexec_prepare_cpus_wait(int
+ 			}
+ 			if (i != notified) {
+ 				printk( "kexec: waiting for cpu %d (physical"
+-						" %d) to enter %i state\n",
+-					i, paca[i].hw_cpu_id, wait_state);
++						" %d) to go down\n",
++						i, paca[i].hw_cpu_id);
+ 				notified = i;
+ 			}
+ 		}
+ 	}
+-	mb();
+-}
+-
+-static void kexec_prepare_cpus(void)
+-{
+-
+-	smp_call_function(kexec_smp_down, NULL, /* wait */0);
+-	local_irq_disable();
+-	mb(); /* make sure IRQs are disabled before we say they are */
+-	get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF;
+-
+-	kexec_prepare_cpus_wait(KEXEC_STATE_IRQS_OFF);
+-	/* we are sure every CPU has IRQs off at this point */
+-	kexec_all_irq_disabled = 1;
+ 
+ 	/* after we tell the others to go down */
+ 	if (ppc_md.kexec_cpu_down)
+ 		ppc_md.kexec_cpu_down(0, 0);
+ 
+-/* Before removing MMU mapings make sure all CPUs have entered real mode */
+-	kexec_prepare_cpus_wait(KEXEC_STATE_REAL_MODE);
+-
+ 	put_cpu();
++
++	local_irq_disable();
+ }
+ 
+ #else /* ! SMP */
+diff -urpN linux-2.6.32.36.orig/arch/powerpc/kernel/misc_64.S linux-2.6.32.36/arch/powerpc/kernel/misc_64.S
+--- linux-2.6.32.36.orig/arch/powerpc/kernel/misc_64.S	2011-03-27 12:31:47.000000000 -0600
++++ linux-2.6.32.36/arch/powerpc/kernel/misc_64.S	2011-04-03 16:31:12.128214057 -0600
+@@ -24,7 +24,6 @@
+ #include <asm/asm-offsets.h>
+ #include <asm/cputable.h>
+ #include <asm/thread_info.h>
+-#include <asm/kexec.h>
+ 
+ 	.text
+ 
+@@ -472,10 +471,6 @@ _GLOBAL(kexec_wait)
+ 1:	mflr	r5
+ 	addi	r5,r5,kexec_flag-1b
+ 
+-	li      r4,KEXEC_STATE_REAL_MODE
+-	stb     r4,PACAKEXECSTATE(r13)
+-	SYNC
+-
+ 99:	HMT_LOW
+ #ifdef CONFIG_KEXEC		/* use no memory without kexec */
+ 	lwz	r4,0(r5)
+@@ -499,11 +494,14 @@ kexec_flag:
+  * note: this is a terminal routine, it does not save lr
+  *
+  * get phys id from paca
++ * set paca id to -1 to say we got here
+  * switch to real mode
+  * join other cpus in kexec_wait(phys_id)
+  */
+ _GLOBAL(kexec_smp_wait)
+ 	lhz	r3,PACAHWCPUID(r13)
++	li	r4,-1
++	sth	r4,PACAHWCPUID(r13)	/* let others know we left */
+ 	bl	real_mode
+ 	b	.kexec_wait
+ 
+diff -urpN linux-2.6.32.36.orig/arch/powerpc/kernel/paca.c linux-2.6.32.36/arch/powerpc/kernel/paca.c
+--- linux-2.6.32.36.orig/arch/powerpc/kernel/paca.c	2011-03-27 12:31:47.000000000 -0600
++++ linux-2.6.32.36/arch/powerpc/kernel/paca.c	2011-04-03 16:31:12.128214057 -0600
+@@ -14,7 +14,6 @@
+ #include <asm/paca.h>
+ #include <asm/sections.h>
+ #include <asm/pgtable.h>
+-#include <asm/kexec.h>
+ 
+ /* This symbol is provided by the linker - let it fill in the paca
+  * field correctly */
+@@ -98,7 +97,6 @@ void __init initialise_pacas(void)
+ 		new_paca->kernelbase = (unsigned long) _stext;
+ 		new_paca->kernel_msr = MSR_KERNEL;
+ 		new_paca->hw_cpu_id = 0xffff;
+-		new_paca->kexec_state = KEXEC_STATE_NONE;
+ 		new_paca->__current = &init_task;
+ #ifdef CONFIG_PPC_STD_MMU_64
+ 		new_paca->slb_shadow_ptr = &slb_shadow[cpu];

Modified: dists/squeeze/linux-2.6/debian/patches/series/33
==============================================================================
--- dists/squeeze/linux-2.6/debian/patches/series/33	Sun Apr  3 20:30:24 2011	(r17186)
+++ dists/squeeze/linux-2.6/debian/patches/series/33	Sun Apr  3 22:42:47 2011	(r17187)
@@ -6,3 +6,4 @@
 + debian/revert-powerpc-kdump-fix-in-2.6.32.34.patch
 + bugfix/x86/Save-cr4-to-mmu_cr4_features-at-boot-time.patch
 + bugfix/all/irda-validate-peer-name-and-attribute-lengths.patch
++ debian/revert-powerpc-kexec-ABI-change-in-2.6.32.34.patch



More information about the Kernel-svn-changes mailing list