[PATCH 1/2] MIPS: asm: signal.h: Fix traditional signal handling for o32 on 64-bit kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



CONFIG_TRAD_SIGNALS is used to denote that legacy signal handlers are
supported (ie !SA_SIGINFO). However, this symbol is only available on
32-bit kernels, so o32 running on 64-bit kernels with !SA_SIGINFO was
treated as if SA_SIGINFO was set so there was extra overhead setting up
the signal handling code within the kernel. o32 should work in the same
way for both 32-bit and 64-bit kernels so we fix the sig_uses_siginfo
definition to allow traditional signal handling for o32 even on 64-bit
kernels. This has been tested booting a MIPS32R6 userland on a 64-bit
MIPS64R6 kernel.

Signed-off-by: Markos Chandras <markos.chandras@xxxxxxxxxx>
---
 arch/mips/include/asm/signal.h | 8 +++-----
 arch/mips/kernel/signal.c      | 2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/mips/include/asm/signal.h b/arch/mips/include/asm/signal.h
index 003e273eff4c..cedc53b0ab69 100644
--- a/arch/mips/include/asm/signal.h
+++ b/arch/mips/include/asm/signal.h
@@ -12,11 +12,9 @@
 #include <uapi/asm/signal.h>
 
 
-#ifdef CONFIG_TRAD_SIGNALS
-#define sig_uses_siginfo(ka)	((ka)->sa.sa_flags & SA_SIGINFO)
-#else
-#define sig_uses_siginfo(ka)	(1)
-#endif
+#define sig_uses_siginfo(abi, ka)		\
+	(((ka)->sa.sa_flags & SA_SIGINFO) ||	\
+	 (!config_enabled(CONFIG_TRAD_SIGNALS) && !(abi)->setup_frame))
 
 #include <asm/sigcontext.h>
 #include <asm/siginfo.h>
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index 359fb5829f66..be3ac5f7cbbb 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -801,7 +801,7 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
 		regs->regs[0] = 0;		/* Don't deal with this again.	*/
 	}
 
-	if (sig_uses_siginfo(&ksig->ka))
+	if (sig_uses_siginfo(abi, &ksig->ka))
 		ret = abi->setup_rt_frame(vdso + abi->rt_signal_return_offset,
 					  ksig, regs, oldset);
 	else
-- 
2.5.0





[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux