[PATCH] powerpc: fix altivec_unavailable_exception Oopses

STALE7479d

3 messages, 3 authors, 2006-02-22 · open the first message on its own page

[PATCH] powerpc: fix altivec_unavailable_exception Oopses

From: Alan Curry <hidden>
Date: 2006-02-21 23:39:18

altivec_unavailable_exception is called without setting r3... it looks like
the r3 that actually gets passed in as struct pt_regs *regs is the
undisturbed value of r3 at the time the altivec instruction was encountered.
The user actually gets to choose the pt_regs printed in the Oops!

After applying the following patch to 2.6.16-rc4, I can no longer cause an
Oops by executing an altivec instruction with CONFIG_ALTIVEC=n. The same
change would probably also be good for arch/ppc/kernel/head.S to fix the same
Oops in 2.6.15.4, though I haven't tested that.
--- arch/powerpc/kernel/head_32.S.orig	2006-02-21 15:58:18.000000000 -0500
+++ arch/powerpc/kernel/head_32.S	2006-02-21 15:59:23.000000000 -0500
@@ -714,6 +714,7 @@
 #ifdef CONFIG_ALTIVEC
 	bne	load_up_altivec		/* if from user, just load it up */
 #endif /* CONFIG_ALTIVEC */
+	addi	r3,r1,STACK_FRAME_OVERHEAD
 	EXC_XFER_EE_LITE(0xf20, altivec_unavailable_exception)
 
 PerformanceMonitor:

Re: [PATCH] powerpc: fix altivec_unavailable_exception Oopses

From: Kumar Gala <hidden>
Date: 2006-02-22 00:52:13

On Feb 21, 2006, at 5:39 PM, Alan Curry wrote:
quoted hunk
altivec_unavailable_exception is called without setting r3... it  
looks like
the r3 that actually gets passed in as struct pt_regs *regs is the
undisturbed value of r3 at the time the altivec instruction was  
encountered.
The user actually gets to choose the pt_regs printed in the Oops!

After applying the following patch to 2.6.16-rc4, I can no longer  
cause an
Oops by executing an altivec instruction with CONFIG_ALTIVEC=n. The  
same
change would probably also be good for arch/ppc/kernel/head.S to  
fix the same
Oops in 2.6.15.4, though I haven't tested that.
--- arch/powerpc/kernel/head_32.S.orig	2006-02-21  
15:58:18.000000000 -0500
+++ arch/powerpc/kernel/head_32.S	2006-02-21 15:59:23.000000000 -0500
@@ -714,6 +714,7 @@
 #ifdef CONFIG_ALTIVEC
 	bne	load_up_altivec		/* if from user, just load it up */
 #endif /* CONFIG_ALTIVEC */
+	addi	r3,r1,STACK_FRAME_OVERHEAD
 	EXC_XFER_EE_LITE(0xf20, altivec_unavailable_exception)

 PerformanceMonitor:
Would you mine providing a patch for arch/ppc/kernel/head.S and  
adding a signed-off-by line.

- k

Re: [PATCH] powerpc: fix altivec_unavailable_exception Oopses

From: Paul Mackerras <hidden>
Date: 2006-02-22 11:46:43

Alan Curry writes:
altivec_unavailable_exception is called without setting r3... it looks like
the r3 that actually gets passed in as struct pt_regs *regs is the
undisturbed value of r3 at the time the altivec instruction was encountered.
Nice catch!

Thanks,
Paul.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help