From patchwork Tue Jan 15 13:55:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincenzo Frascino X-Patchwork-Id: 10764527 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C62691E for ; Tue, 15 Jan 2019 13:59:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF0992C27C for ; Tue, 15 Jan 2019 13:59:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E33042C2AD; Tue, 15 Jan 2019 13:59:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6EE2A2C27C for ; Tue, 15 Jan 2019 13:59:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pmePs26zkr0iaVszSFafG/whpZpxA3PlwMfsSlA97m8=; b=Ut/c/vMLKC6DRA VP9oXxamXUUaO/7kYfKBLA0UGF8SiZXHiQWiO3Nrkwv6EMT0cOQmV8aYZn0PnDxlcj6YliC6gUOJa u+Lw50t/OfJnD2B/GyQHCqxUtRdBQAiY9D71uBBBchaIzIZ3SxVNkOnx8rkTO+LT848NYcZd6celc nXfwmI0szkUH4k3UV7vVmIkRx5M0/ki5yqxClMTgzHhLahFLNaGLTPf5g8EvGUBO6nvckVo2i+O+p RR4wweCFTinu7UE9C3DOZysj2x5pJjlXlYcEOOdfGEJX5OXrjtHph1DXDrrDFxirqrwq3ivK/XQdP WF1m+R+F8xzktRd24zIg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gjPFp-0006l9-6P; Tue, 15 Jan 2019 13:59:45 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gjPD0-0004DF-Ep for linux-arm-kernel@lists.infradead.org; Tue, 15 Jan 2019 13:57:04 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B89B31688; Tue, 15 Jan 2019 05:56:49 -0800 (PST) Received: from e119884-lin.cambridge.arm.com (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A5BD03F70D; Tue, 15 Jan 2019 05:56:47 -0800 (PST) From: Vincenzo Frascino To: linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 11/24] arm64: compat: Generate asm offsets for signals Date: Tue, 15 Jan 2019 13:55:26 +0000 Message-Id: <20190115135539.24762-12-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190115135539.24762-1-vincenzo.frascino@arm.com> References: <20190115135539.24762-1-vincenzo.frascino@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190115_055651_184831_80E4E741 X-CRM114-Status: GOOD ( 14.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Catalin Marinas , Daniel Lezcano , Will Deacon , Russell King , Ralf Baechle , Mark Salyzyn , Paul Burton , Thomas Gleixner , Peter Collingbourne Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch updates asm-offsets for arm64 to generate the correct offsets for compat signals. They will be useful for the implementation of the compat sigreturn trampolines in vDSO context. Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Vincenzo Frascino --- arch/arm64/include/asm/signal32.h | 14 +++++++++++++- arch/arm64/kernel/asm-offsets.c | 6 ++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/signal32.h b/arch/arm64/include/asm/signal32.h index 1f05268f4c6d..a6fd7be1b22a 100644 --- a/arch/arm64/include/asm/signal32.h +++ b/arch/arm64/include/asm/signal32.h @@ -52,7 +52,7 @@ struct compat_ucontext { compat_stack_t uc_stack; struct compat_sigcontext uc_mcontext; compat_sigset_t uc_sigmask; - int __unused[32 - (sizeof(compat_sigset_t) / sizeof(int))]; + int __unused[32 - (sizeof(compat_sigset_t) / sizeof(int))]; compat_ulong_t uc_regspace[128] __attribute__((__aligned__(8))); }; @@ -66,6 +66,18 @@ struct compat_rt_sigframe { struct compat_sigframe sig; }; +/* Macros for asm-offsets.c */ +#define OFFSET_OF_COMPAT_SIGFRAME_REGS ( \ + offsetof(struct compat_sigframe, uc) + \ + offsetof(struct compat_ucontext, uc_mcontext) + \ + offsetof(struct compat_sigcontext, arm_r0)) + +#define OFFSET_OF_COMPAT_RT_SIGFRAME_REGS ( \ + offsetof(struct compat_rt_sigframe, sig) + \ + offsetof(struct compat_sigframe, uc) + \ + offsetof(struct compat_ucontext, uc_mcontext) + \ + offsetof(struct compat_sigcontext, arm_r0)) + int compat_setup_frame(int usig, struct ksignal *ksig, sigset_t *set, struct pt_regs *regs); int compat_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set, diff --git a/arch/arm64/kernel/asm-offsets.c b/arch/arm64/kernel/asm-offsets.c index af9a45917427..10052cff00ac 100644 --- a/arch/arm64/kernel/asm-offsets.c +++ b/arch/arm64/kernel/asm-offsets.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -84,6 +85,11 @@ int main(void) DEFINE(S_STACKFRAME, offsetof(struct pt_regs, stackframe)); DEFINE(S_FRAME_SIZE, sizeof(struct pt_regs)); BLANK(); +#ifdef CONFIG_COMPAT + DEFINE(COMPAT_SIGFRAME_REGS_OFFSET, OFFSET_OF_COMPAT_SIGFRAME_REGS); + DEFINE(COMPAT_RT_SIGFRAME_REGS_OFFSET, OFFSET_OF_COMPAT_RT_SIGFRAME_REGS); + BLANK(); +#endif DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id.counter)); BLANK(); DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm));