From: Andi Kleen Date: Tue, 26 Sep 2006 08:52:41 +0000 (+0200) Subject: [PATCH] Initialize argument registers for 32bit signal handlers. X-Git-Tag: firefly_0821_release~33451^2~13 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=536e3ee4fed13d2d4bbf1b775174aba0cadf6aba;p=firefly-linux-kernel-4.4.55.git [PATCH] Initialize argument registers for 32bit signal handlers. In case the user space was compiled with -mregparm=3 Following i386. Pointed out by Albert Cahalan Signed-off-by: Andi Kleen --- diff --git a/arch/x86_64/ia32/ia32_signal.c b/arch/x86_64/ia32/ia32_signal.c index 2d20f8304b31..ced15012a3d7 100644 --- a/arch/x86_64/ia32/ia32_signal.c +++ b/arch/x86_64/ia32/ia32_signal.c @@ -478,6 +478,11 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka, regs->rsp = (unsigned long) frame; regs->rip = (unsigned long) ka->sa.sa_handler; + /* Make -mregparm=3 work */ + regs->rax = sig; + regs->rdx = 0; + regs->rcx = 0; + asm volatile("movl %0,%%ds" :: "r" (__USER32_DS)); asm volatile("movl %0,%%es" :: "r" (__USER32_DS));