From patchwork Fri May 6 14:00:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 9033521 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 890ECBF29F for ; Fri, 6 May 2016 14:07:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A08C2026D for ; Fri, 6 May 2016 14:07:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7F23F20221 for ; Fri, 6 May 2016 14:07:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aygNY-0000AD-6d; Fri, 06 May 2016 14:05:16 +0000 Received: from mail-bn1on0084.outbound.protection.outlook.com ([157.56.110.84] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aygNU-0007Qm-KM for linux-arm-kernel@lists.infradead.org; Fri, 06 May 2016 14:05:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-caviumnetworks-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=mVdlUusQPp3a+2AVchAq/td3RgNUGb/pBMvUq1qO3IU=; b=2U4kKpXFZ0anF8q8nQCSkGURCXb9IAPAzgN7G4FivcuntKcuXX9Ivgszlvvz5Mxkvb4qPsLyo4g1Edp8BGMcKyy5G+qMzRsdjBh9DaT1LAEGqcEPXuMrznEvvGWUsM061B4D2QI5GIIVu5juNw0Ts9681Z+CWNVqRLYFUfYidEY= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost (95.143.213.121) by CY1PR07MB2230.namprd07.prod.outlook.com (10.164.112.144) with Microsoft SMTP Server (TLS) id 15.1.485.9; Fri, 6 May 2016 14:04:47 +0000 Date: Fri, 6 May 2016 17:00:22 +0300 From: Yury Norov To: Andrew Pinski Subject: Re: [PATCH 24/25] arm64:ilp32: add vdso-ilp32 and use for signal return Message-ID: <20160506140022.GA18587@yury-N73SV> References: <1459894127-17698-1-git-send-email-ynorov@caviumnetworks.com> <1554541.oDP7Ro5zB2@wuerfel> <20160503090045.GB10733@e104818-lin.cambridge.arm.com> <3846428.6xx69KGEja@wuerfel> <57288660.9030607@huawei.com> <57289C75.50904@huawei.com> <20160504214949.GA28217@yury-N73SV> <572AAED2.7050604@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [95.143.213.121] X-ClientProxiedBy: AM2PR09CA0048.eurprd09.prod.outlook.com (10.160.228.144) To CY1PR07MB2230.namprd07.prod.outlook.com (10.164.112.144) X-MS-Office365-Filtering-Correlation-Id: dbc7339c-891e-41cb-3d83-08d375b76291 X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2230; 2:JGXo8NK9hjvupbZH+b8jWaX3+ZIXto8Sn6tgl+HyFve5fLTY8Uds6d9SWREaplNyGdmDG8z9qEUgwc4accHdQSSQRHojHKVNcVF2SXBefS7H+3MDYx8/xkcurt1Hvzo19fWy/sa86E6C12ePd9St/lKR32y9sAqMC8Tai3lhTsnH5fu+2ZEAXdp36FcE38n5; 3:UWpJPLYArB+St5Hxb6rw5BKeMe+pdODlk3JmlnPtVBYze5iy1sENX9IFRDlgqImC0OoaXRoKBzavI4GzxJRDxeKOj4fiDlke0T6+3stj51cD+vKJHIpvra6OJnBGmnDv X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB2230; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2230; 25:A4LICaORxE2JxABt7S+c0kraCa9+ENm1FUO08qgFvaP9Fgw0Soj1Fvexa+bVh/lJs/yUPI/UPa9TzL33JogIV6SdJxV4UeRPKmlrHZ+ek+GdfUIKvWdEvVZMtBVJVrW/XqW85ArtUOL6Eow0ir3Svi0lXbSxpkJCWj3nVnJ4Nz58XClEGnDDBiX4vqoCa5eJW0KaHaYoBjGQuNCXQN392BtvBrJDzI6CGlRaa/FWg7fztO6CyNBW0qNBspIiAbF3oWJuDrtJWrZ5AhiracrmZitsxNUOVv+JqkCB8eti1iH/mgImZtBdUPOLfX/0pkJY0NODWdfWa9VIjMY/42k3qbPAyfABUYHbPGAURtRURvGdGCO4stBvFNJ1UyS9aKBvNHv/Qgsq7Uzu6HW4i9oA1UIUDZy76mCn697VPPVqlMN1sS5mDTscPaGsk9mOBSlAAXsAIxdQlFMvJLT6hwanDWZNMqy2n8cjHDVQo3Wtzzirm68dq1yvDWBWYZTo4U7h7z50nIOasdmd1c/stLRVLRIsF2ikutqrGJPQyAa3mZVUmOjvla8NZyzc2Wji9aCrl0A11VeX9bYACLVwz59oIjSlQw/Fg6NbU0YjZkb+FwWh/3K2mSxX448p93yU+ATNys9ysM938G0YIuf46LGh3x+TGZp8Z5rwuD+TAmv0vJ0Azg0kLE4uXXnjvTbQKiCk+RFFu4FHiClZpXpAcftKDUPiMllCugPLEnbmWF7pNN6LIsyf+qHTnOTz9AHi9jek82s+HSzG/vHnTN3+0vjeFTnm+p040Hr82+0x+0/hmyo= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2230; 20:NOcVq7mlL6ED6yyv994Ch3JOWb0B6VEQRbcvWiPDSIudo1nEkfYqdurK4Du7qO4gMC5Y81DX+3VxAthLRpuvXXJZcuUv2kpu7DGCgfskHyixDXKukvkPVRnv7XIq853Wd56Ht4x1+INprsDbjkmW0yTML0j9+TDD1omOSV4Q+lN/Ek5U4uq7uhih8MdttAfJORKN9pQksu9Pf4DYuBlgP1Nt9W7trT3Qa2Wo1va8MAxfL4LsHn+/ZlU5dX/NzCraU79klIuBn1UcboVW2u5jI77jSKnysTu5Q4Lh/T7SyaUlxJ0XHn+iY+gfTfqJHVTl2u9bCx2ufHAMh7JQYpy2qMt2PYQ7b+kH5hkKYvw+Py+E8Ld+7+pa6/NbOnDFUDySL9glheBhxPzZDQ/H88geED3KfFRa+Xz0F7HVPZJMiAL66u3VTWcicx7bLCRXIcKODEVC7338pNwLgcm/ty/wxDH1p5a3J081/8UgSmn/vYI/2udBDynaPQ4fR5l1L4RpUv5L8y0EjDbkQE46xmUjRCUwFZ5wUIrW0gjCX7/ZvV05rXa4TQYJFm+P9UxPmsgRkKQc4CbSOP224q+x3iWMtVafLq2Szk6fkM2DAZRMet8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:CY1PR07MB2230; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2230; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2230; 4:ekRbh8bnT0mp7YExj1bIa17fzCM5Q7J1DgQ7/di7QNCut2COGMraibkFPIBm3VMBgVHcrllnaUcxb1NI7fkf/y2e/LEZ4dAHxB5Q5Nb1GF8xsUEoiJeenDtVc43UZV794n1VYo9e2AMXboTL9JX9xspN4LQ/DZvgwTII0nQruQg4L6nXlSIP6hhBJX6HwReoePSeslxq+U5puIgVyO61gqxuLzQfejzZn2IGOhN/7ut/uCwcpzSIZjamr4dvUP2J7DCSqnAACszkMmeRTZw3KkFiaF/yjcVyvWvahcPIUjp1o55atjkxYBEMDUSQa5b4B29mLf91xSEAY5LChT7+FeZJEEm/ekVe6qEJTWaVTU9VCZKplfW14i4E3o+b4724 X-Forefront-PRVS: 09347618C4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(1076002)(23726003)(83506001)(189998001)(42186005)(47776003)(93886004)(66066001)(1411001)(586003)(4001350100001)(50466002)(77096005)(6116002)(97756001)(110136002)(3846002)(5008740100001)(33656002)(5004730100002)(92566002)(46406003)(4326007)(33716001)(2950100001)(76176999)(54356999)(81166005)(2906002)(19580405001)(76506005)(9686002)(19580395003)(50986999); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2230; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2230; 23:Wh17qZ2KmYhrIUN7hoAcEPFj6sElVKGuI338roAj+?= =?us-ascii?Q?m/kn+GprfRjL6zQZO27HoJ9PscaX1wX3T3GuDQy2M1OgQ2dEgcHyJjRgTaJc?= =?us-ascii?Q?hRR7YKlguofP1lnYX7uz7vYjCSEtpLAv4+cz5TmbaKN+R2/iMVjSDREX2pOU?= =?us-ascii?Q?10MR8JjCVqejlVJvYqLOiQw0KHvUfRXjcR8RtwppAGq1b9hMl9R8zF8i3PM+?= =?us-ascii?Q?i/sd2yipER0+5+pJQBJWa5ySCzfjpUp/p29KP3P9yrBggwi8vwvmlGRgIs+q?= =?us-ascii?Q?Pe/i9oaIyWJ6S9fUt3LSKGAmIhlJ277oU4YOZRmUn1kzu5p4vZDbQ/F9R/Il?= =?us-ascii?Q?5qEdmJPxMC+VCzDCLm4fzvSbjSHtzRSKK+dFyJ9dHTPM+sHqNY/3TClYs2CT?= =?us-ascii?Q?+vJN5DDwpS79jqfUdFQekwY5CRcQ/aI7uSecCSI0UNd3ub7RklNAZa05pACj?= =?us-ascii?Q?c3PxlKTwF7hUHCd7m9M+s42qKdVlqpV1r5fgqRhJVd2VFHeIQgiZUQxWZBoB?= =?us-ascii?Q?xNq/d42Gf1c5FsmMDQD6qAlMefTzRfEBqb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iagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2016 14:04:47.8928 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2230 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160506_070512_949590_6F1BD569 X-CRM114-Status: UNSURE ( 9.10 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-Arch , linux-s390 , Arnd Bergmann , linux-doc@vger.kernel.org, "Kapoor, Prasun" , Catalin Marinas , Hanjun Guo , Heiko Carstens , LKML , Alexander Graf , Alexey Klimov , Mark Brown , "Zhangjian \(Bamvor\)" , "linux-arm-kernel@lists.infradead.org" , Andreas Schwab , Martin Schwidefsky , Nathan Lynch , Philipp Tomsich , "Joseph S. Myers" , christoph.muellner@theobroma-systems.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello colleagues, After all comments, VDSO fix looks like this for me. Note I renamed Andrew's ZERO macro to DELOUSE, as there already is __SC_DELOUSE which does the same, but in C, not asm. Like Bamvor, I'm not sure how we'd apply this patch - standalone or meld to VDSO. I think, VDSO patch is too big and bad-structurized, and if I find how to refactor it, I'll incorporate this fix. Signed-off-by: Yury Norov --- arch/arm64/kernel/asm-offsets.c | 7 +++++++ arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S | 2 +- arch/arm64/kernel/vdso/gettimeofday.S | 20 +++++++++++++++++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/asm-offsets.c b/arch/arm64/kernel/asm-offsets.c index e229525..fcfd087 100644 --- a/arch/arm64/kernel/asm-offsets.c +++ b/arch/arm64/kernel/asm-offsets.c @@ -101,6 +101,13 @@ int main(void) DEFINE(TSPEC_TV_SEC, offsetof(struct timespec, tv_sec)); DEFINE(TSPEC_TV_NSEC, offsetof(struct timespec, tv_nsec)); BLANK(); +#ifdef CONFIG_ARM64_ILP32 + DEFINE(COMPAT_TVAL_TV_SEC, offsetof(struct compat_timeval, tv_sec)); + DEFINE(COMPAT_TVAL_TV_USEC, offsetof(struct compat_timeval, tv_usec)); + DEFINE(COMPAT_TSPEC_TV_SEC, offsetof(struct compat_timespec, tv_sec)); + DEFINE(COMPAT_TSPEC_TV_NSEC, offsetof(struct compat_timespec, tv_nsec)); + BLANK(); +#endif DEFINE(TZ_MINWEST, offsetof(struct timezone, tz_minuteswest)); DEFINE(TZ_DSTTIME, offsetof(struct timezone, tz_dsttime)); BLANK(); diff --git a/arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S b/arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S index ddc63fd..d182a8d 100644 --- a/arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S +++ b/arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S @@ -79,7 +79,7 @@ PHDRS */ VERSION { - LINUX_2.6 { + LINUX_2.6.39 { global: __kernel_rt_sigreturn; __kernel_gettimeofday; diff --git a/arch/arm64/kernel/vdso/gettimeofday.S b/arch/arm64/kernel/vdso/gettimeofday.S index efa79e8..a2d8a70 100644 --- a/arch/arm64/kernel/vdso/gettimeofday.S +++ b/arch/arm64/kernel/vdso/gettimeofday.S @@ -25,6 +25,16 @@ #define NSEC_PER_SEC_LO16 0xca00 #define NSEC_PER_SEC_HI16 0x3b9a +#ifdef __LP64__ +#define PTR_REG(n) x##n +#define OFFSET(n) n +#define DELOUSE(n) +#else +#define PTR_REG(n) w##n +#define OFFSET(n) COMPAT_##n +#define DELOUSE(n) mov w##n, w##n +#endif + vdso_data .req x6 use_syscall .req w7 seqcnt .req w8 @@ -51,6 +61,8 @@ seqcnt .req w8 /* int __kernel_gettimeofday(struct timeval *tv, struct timezone *tz); */ ENTRY(__kernel_gettimeofday) .cfi_startproc + DELOUSE(0) + DELOUSE(1) mov x2, x30 .cfi_register x30, x2 @@ -68,7 +80,7 @@ ENTRY(__kernel_gettimeofday) mov x13, #1000 lsl x13, x13, x12 udiv x11, x11, x13 - stp x10, x11, [x0, #TVAL_TV_SEC] + stp PTR_REG(10), PTR_REG(11), [x0, #OFFSET(TVAL_TV_SEC)] 2: /* If tz is NULL, return 0. */ cbz x1, 3f @@ -88,6 +100,7 @@ ENDPROC(__kernel_gettimeofday) /* int __kernel_clock_gettime(clockid_t clock_id, struct timespec *tp); */ ENTRY(__kernel_clock_gettime) .cfi_startproc + DELOUSE(1) cmp w0, #CLOCK_REALTIME ccmp w0, #CLOCK_MONOTONIC, #0x4, ne b.ne 2f @@ -159,7 +172,7 @@ ENTRY(__kernel_clock_gettime) 6: /* Store to the user timespec. */ lsr x11, x11, x12 - stp x10, x11, [x1, #TSPEC_TV_SEC] + stp PTR_REG(10), PTR_REG(11), [x1, #OFFSET(TSPEC_TV_SEC)] mov x0, xzr ret 7: @@ -174,6 +187,7 @@ ENDPROC(__kernel_clock_gettime) /* int __kernel_clock_getres(clockid_t clock_id, struct timespec *res); */ ENTRY(__kernel_clock_getres) .cfi_startproc + DELOUSE(1) cmp w0, #CLOCK_REALTIME ccmp w0, #CLOCK_MONOTONIC, #0x4, ne b.ne 1f @@ -187,7 +201,7 @@ ENTRY(__kernel_clock_getres) ldr x2, 6f 2: cbz w1, 3f - stp xzr, x2, [x1] + stp PTR_REG(zr), PTR_REG(2), [x1] 3: /* res == NULL. */ mov w0, wzr