Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933370AbbLVRLK (ORCPT ); Tue, 22 Dec 2015 12:11:10 -0500 Received: from foss.arm.com ([217.140.101.70]:54815 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753269AbbLVRIM (ORCPT ); Tue, 22 Dec 2015 12:08:12 -0500 Date: Tue, 22 Dec 2015 17:08:06 +0000 From: Catalin Marinas To: Yury Norov Cc: arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, pinskia@gmail.com, Prasun.Kapoor@caviumnetworks.com, schwab@suse.de, broonie@kernel.org, Nathan_Lynch@mentor.com, agraf@suse.de, klimov.linux@gmail.com, jan.dakinevich@gmail.com, ddaney.cavm@gmail.com, bamvor.zhangjian@huawei.com, philipp.tomsich@theobroma-systems.com, joseph@codesourcery.com, christoph.muellner@theobroma-systems.com Subject: Re: [PATCH v6 17/20] arm64: ilp32: introduce ilp32-specific handlers for sigframe Message-ID: <20151222170806.GC1302@e104818-lin.cambridge.arm.com> References: <1450215766-14765-1-git-send-email-ynorov@caviumnetworks.com> <1450215766-14765-18-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1450215766-14765-18-git-send-email-ynorov@caviumnetworks.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3674 Lines: 115 On Wed, Dec 16, 2015 at 12:42:43AM +0300, Yury Norov wrote: > diff --git a/arch/arm64/kernel/entry_ilp32.S b/arch/arm64/kernel/entry_ilp32.S > new file mode 100644 > index 0000000..424060f > --- /dev/null > +++ b/arch/arm64/kernel/entry_ilp32.S > @@ -0,0 +1,32 @@ > +/* > + * ILP32 system call wrappers > + * > + * Copyright (C) 2015 Cavium Networks. > + * Author: Yury Norov > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program. If not, see . > + */ > + > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +ENTRY(ilp32_sys_rt_sigreturn_wrapper) > + mov x0, sp > + b ilp32_sys_rt_sigreturn > +ENDPROC(ilp32_sys_rt_sigreturn_wrapper) Do you need all these header includes? > diff --git a/arch/arm64/kernel/signal_ilp32.c b/arch/arm64/kernel/signal_ilp32.c > new file mode 100644 > index 0000000..d38434b > --- /dev/null > +++ b/arch/arm64/kernel/signal_ilp32.c > @@ -0,0 +1,126 @@ > +/* > + * Based on arch/arm/kernel/signal.c > + * > + * Copyright (C) 2015 Cavium Networks. And missing extra copyright lines. > + * Yury Norov > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program. If not, see . > + */ > + > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +struct ilp32_rt_sigframe { > + struct compat_siginfo info; > + struct sigframe sig; > +}; > + > +asmlinkage int ilp32_sys_rt_sigreturn(struct pt_regs *regs) > +{ > + struct ilp32_rt_sigframe __user *frame; > + > + /* Always make any pending restarted system calls return -EINTR */ > + current->restart_block.fn = do_no_restart_syscall; > + > + /* > + * Since we stacked the signal on a 64-bit boundary, > + * then 'sp' should be word aligned here. If it's > + * not, then the user is trying to mess with us. > + */ The stack alignment is still 128-bit even with ILP32 (architecture requirement). > + if (regs->sp & 15) > + goto badframe; The check here is correct though. -- Catalin -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/