[kernel] r11089 - in dists/sid/linux-2.6/debian: . patches/bugfix/hppa patches/series

Kyle McMartin kyle at alioth.debian.org
Thu Apr 17 18:09:51 UTC 2008


Author: kyle
Date: Thu Apr 17 18:09:50 2008
New Revision: 11089

Log:
hppa fixes on request from tbm

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/hppa/
   dists/sid/linux-2.6/debian/patches/bugfix/hppa/fix-signal-trampoline-cache-flushing.patch
   dists/sid/linux-2.6/debian/patches/bugfix/hppa/parisc-futex-special-case-cmpxchg-null-in-kernel-space.patch
   dists/sid/linux-2.6/debian/patches/bugfix/hppa/parisc-pdc_console-fix-bizarre-panic-on-boot.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/6

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	(original)
+++ dists/sid/linux-2.6/debian/changelog	Thu Apr 17 18:09:50 2008
@@ -9,6 +9,11 @@
   * [arm/iop32x] Do not build the ARTOP PATA driver (PATA_ARTOP).
   * [arm/iop32x] Enable MTD_CMDLINE_PARTS.
 
+  [ Kyle McMartin ]
+  * [hppa] fix pdc_console panic at boot
+  * [hppa] properly flush user signal tramps
+  * [hppa] special case futex cmpxchg on kernel space NULL
+
  -- Martin Michlmayr <tbm at cyrius.com>  Fri, 28 Mar 2008 10:40:29 +0100
 
 linux-2.6 (2.6.24-5) unstable; urgency=low

Added: dists/sid/linux-2.6/debian/patches/bugfix/hppa/fix-signal-trampoline-cache-flushing.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/hppa/fix-signal-trampoline-cache-flushing.patch	Thu Apr 17 18:09:50 2008
@@ -0,0 +1,33 @@
+-stable review patch.  If anyone has any objections, please let us know.
+---------------------
+
+From: Kyle McMartin <kyle at mcmartin.ca>
+
+upstream commit: cf39cc3b56bc4a562db6242d3069f65034ec7549
+
+The signal trampolines were accidently flushing the kernel I$ instead of
+the users.  Fix that up, and also add a missing user D$ flush while
+we're at it.
+
+Signed-off-by: Kyle McMartin <kyle at mcmartin.ca>
+Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
+Signed-off-by: Chris Wright <chrisw at sous-sol.org>
+---
+ arch/parisc/kernel/signal.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/parisc/kernel/signal.c
++++ b/arch/parisc/kernel/signal.c
+@@ -534,7 +534,8 @@ insert_restart_trampoline(struct pt_regs
+ 		 * Flushing one cacheline is cheap.
+ 		 * "sync" on bigger (> 4 way) boxes is not.
+ 		 */
+-		flush_icache_range(regs->gr[30], regs->gr[30] + 4);
++		flush_user_dcache_range(regs->gr[30], regs->gr[30] + 4);
++		flush_user_icache_range(regs->gr[30], regs->gr[30] + 4);
+ 
+ 		regs->gr[31] = regs->gr[30] + 8;
+ 		/* Preserve original r28. */
+
+-- 
+

Added: dists/sid/linux-2.6/debian/patches/bugfix/hppa/parisc-futex-special-case-cmpxchg-null-in-kernel-space.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/hppa/parisc-futex-special-case-cmpxchg-null-in-kernel-space.patch	Thu Apr 17 18:09:50 2008
@@ -0,0 +1,61 @@
+-stable review patch.  If anyone has any objections, please let us know.
+---------------------
+
+From: Kyle McMartin <kyle at shortfin.cabal.ca>
+
+upstream commit: c20a84c91048c76c1379011c96b1a5cee5c7d9a0
+
+commit f9e77acd4060fefbb60a351cdb8d30fca27fe194
+Author: Thomas Gleixner <tglx at linutronix.de>
+Date:   Sun Feb 24 02:10:05 2008 +0000
+
+    futex: runtime enable pi and robust functionality
+ 
+
+which was backported to stable based on mainline Commit
+a0c1e9073ef7428a14309cba010633a6cd6719ea added code to futex.c
+to detect whether futex_atomic_cmpxchg_inatomic was implemented at run
+time:
+
++       curval = cmpxchg_futex_value_locked(NULL, 0, 0);
++       if (curval == -EFAULT)
++               futex_cmpxchg_enabled = 1;
+
+This is bogus on parisc, since page zero in kernel virtual space is the
+gateway page for syscall entry, and should not be read from the kernel.
+(That, and we really don't like the kernel faulting on its own address
+ space...)
+
+Signed-off-by: Kyle McMartin <kyle at mcmartin.ca>
+Signed-off-by: James Bottomley <James.Bottomley at HansenPartnership.com>
+Signed-off-by: Chris Wright <chrisw at sous-sol.org>
+---
+ include/asm-parisc/futex.h |   10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+--- a/include/asm-parisc/futex.h
++++ b/include/asm-parisc/futex.h
+@@ -56,6 +56,12 @@ futex_atomic_cmpxchg_inatomic(int __user
+ 	int err = 0;
+ 	int uval;
+ 
++	/* futex.c wants to do a cmpxchg_inatomic on kernel NULL, which is
++	 * our gateway page, and causes no end of trouble...
++	 */
++	if (segment_eq(KERNEL_DS, get_fs()) && !uaddr)
++		return -EFAULT;
++
+ 	if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
+ 		return -EFAULT;
+ 
+@@ -67,5 +73,5 @@ futex_atomic_cmpxchg_inatomic(int __user
+ 	return uval;
+ }
+ 
+-#endif
+-#endif
++#endif /*__KERNEL__*/
++#endif /*_ASM_PARISC_FUTEX_H*/
+
+-- 
+

Added: dists/sid/linux-2.6/debian/patches/bugfix/hppa/parisc-pdc_console-fix-bizarre-panic-on-boot.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/hppa/parisc-pdc_console-fix-bizarre-panic-on-boot.patch	Thu Apr 17 18:09:50 2008
@@ -0,0 +1,156 @@
+-stable review patch.  If anyone has any objections, please let us know.
+---------------------
+
+From: Kyle McMartin <kyle at shortfin.cabal.ca>
+
+upstream commit ef1afd4d79f0479960ff36bb5fe6ec6eba1ebff2
+
+commit 721fdf34167580ff98263c74cead8871d76936e6
+Author: Kyle McMartin <kyle at shortfin.cabal.ca>
+Date:   Thu Dec 6 09:32:15 2007 -0800
+
+    [PARISC] print more than one character at a time for pdc console
+
+introduced a subtle bug by accidentally removing the "static" from
+iodc_dbuf. This resulted in, what appeared to be, a trap without
+*current set to a task. Probably the result of a trap in real mode
+while calling firmware.
+
+Also do other misc clean ups. Since the only input from firmware is non
+blocking, share iodc_dbuf between input and output, and spinlock the
+only callers.
+
+[jejb: fixed up rejections against the stable tree]
+
+Signed-off-by: Kyle McMartin <kyle at parisc-linux.org>
+Signed-off-by: James Bottomley <James.Bottomley at HansenPartnership.com>
+Signed-off-by: Chris Wright <chrisw at sous-sol.org>
+---
+ arch/parisc/kernel/firmware.c |   27 +++++++++++++++++----------
+ arch/parisc/kernel/pdc_cons.c |   19 +++++++++++++++++--
+ include/asm-parisc/pdc.h      |    3 +--
+ 3 files changed, 35 insertions(+), 14 deletions(-)
+
+--- a/arch/parisc/kernel/firmware.c
++++ b/arch/parisc/kernel/firmware.c
+@@ -1080,6 +1080,9 @@ void pdc_io_reset_devices(void)
+ 	spin_unlock_irqrestore(&pdc_lock, flags);
+ }
+ 
++/* locked by pdc_console_lock */
++static int __attribute__((aligned(8)))   iodc_retbuf[32];
++static char __attribute__((aligned(64))) iodc_dbuf[4096];
+ 
+ /**
+  * pdc_iodc_print - Console print using IODC.
+@@ -1091,24 +1094,20 @@ void pdc_io_reset_devices(void)
+  * Since the HP console requires CR+LF to perform a 'newline', we translate
+  * "\n" to "\r\n".
+  */
+-int pdc_iodc_print(unsigned char *str, unsigned count)
++int pdc_iodc_print(const unsigned char *str, unsigned count)
+ {
+-	/* XXX Should we spinlock posx usage */
+ 	static int posx;        /* for simple TAB-Simulation... */
+-	int __attribute__((aligned(8)))   iodc_retbuf[32];
+-	char __attribute__((aligned(64))) iodc_dbuf[4096];
+ 	unsigned int i;
+ 	unsigned long flags;
+ 
+-	memset(iodc_dbuf, 0, 4096);
+-	for (i = 0; i < count && i < 2048;) {
++	for (i = 0; i < count && i < 79;) {
+ 		switch(str[i]) {
+ 		case '\n':
+ 			iodc_dbuf[i+0] = '\r';
+ 			iodc_dbuf[i+1] = '\n';
+ 			i += 2;
+ 			posx = 0;
+-			break;
++			goto print;
+ 		case '\t':
+ 			while (posx & 7) {
+ 				iodc_dbuf[i] = ' ';
+@@ -1124,6 +1123,16 @@ int pdc_iodc_print(unsigned char *str, u
+ 		}
+ 	}
+ 
++	/* if we're at the end of line, and not already inserting a newline,
++	 * insert one anyway. iodc console doesn't claim to support >79 char
++	 * lines. don't account for this in the return value.
++	 */
++	if (i == 79 && iodc_dbuf[i-1] != '\n') {
++		iodc_dbuf[i+0] = '\r';
++		iodc_dbuf[i+1] = '\n';
++	}
++
++print:
+         spin_lock_irqsave(&pdc_lock, flags);
+         real32_call(PAGE0->mem_cons.iodc_io,
+                     (unsigned long)PAGE0->mem_cons.hpa, ENTRY_IO_COUT,
+@@ -1142,11 +1151,9 @@ int pdc_iodc_print(unsigned char *str, u
+  */
+ int pdc_iodc_getc(void)
+ {
+-	unsigned long flags;
+-        static int __attribute__((aligned(8)))   iodc_retbuf[32];
+-        static char __attribute__((aligned(64))) iodc_dbuf[4096];
+ 	int ch;
+ 	int status;
++	unsigned long flags;
+ 
+ 	/* Bail if no console input device. */
+ 	if (!PAGE0->mem_kbd.iodc_io)
+--- a/arch/parisc/kernel/pdc_cons.c
++++ b/arch/parisc/kernel/pdc_cons.c
+@@ -52,10 +52,18 @@
+ #include <linux/tty.h>
+ #include <asm/pdc.h>		/* for iodc_call() proto and friends */
+ 
++static spinlock_t pdc_console_lock = SPIN_LOCK_UNLOCKED;
+ 
+ static void pdc_console_write(struct console *co, const char *s, unsigned count)
+ {
+-	pdc_iodc_print(s, count);
++	int i = 0;
++	unsigned long flags;
++
++	spin_lock_irqsave(&pdc_console_lock, flags);
++	do {
++		i += pdc_iodc_print(s + i, count - i);
++	} while (i < count);
++	spin_unlock_irqrestore(&pdc_console_lock, flags);
+ }
+ 
+ void pdc_printf(const char *fmt, ...)
+@@ -73,7 +81,14 @@ void pdc_printf(const char *fmt, ...)
+ 
+ int pdc_console_poll_key(struct console *co)
+ {
+-	return pdc_iodc_getc();
++	int c;
++	unsigned long flags;
++
++	spin_lock_irqsave(&pdc_console_lock, flags);
++	c = pdc_iodc_getc();
++	spin_unlock_irqrestore(&pdc_console_lock, flags);
++
++	return c;
+ }
+ 
+ static int pdc_console_setup(struct console *co, char *options)
+--- a/include/asm-parisc/pdc.h
++++ b/include/asm-parisc/pdc.h
+@@ -645,8 +645,7 @@ int pdc_soft_power_button(int sw_control
+ void pdc_io_reset(void);
+ void pdc_io_reset_devices(void);
+ int pdc_iodc_getc(void);
+-int pdc_iodc_print(unsigned char *str, unsigned count);
+-void pdc_printf(const char *fmt, ...);
++int pdc_iodc_print(const unsigned char *str, unsigned count);
+ 
+ void pdc_emergency_unlock(void);
+ int pdc_sti_call(unsigned long func, unsigned long flags,
+
+-- 
+

Modified: dists/sid/linux-2.6/debian/patches/series/6
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/6	(original)
+++ dists/sid/linux-2.6/debian/patches/series/6	Thu Apr 17 18:09:50 2008
@@ -1 +1,4 @@
 + bugfix/arm/add-oabi-shim-for-fstatat64.patch
++ bugfix/hppa/fix-signal-trampoline-cache-flushing.patch
++ bugfix/hppa/parisc-futex-special-case-cmpxchg-null-in-kernel-space.patch
++ bugfix/hppa/parisc-pdc_console-fix-bizarre-panic-on-boot.patch



More information about the Kernel-svn-changes mailing list