From patchwork Tue Jun 21 05:07:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 102125 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1832561qgy; Mon, 20 Jun 2016 22:15:59 -0700 (PDT) X-Received: by 10.66.139.133 with SMTP id qy5mr26186910pab.4.1466486159524; Mon, 20 Jun 2016 22:15:59 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id i1si37867921pfk.138.2016.06.20.22.15.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jun 2016 22:15:59 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-70832-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-70832-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-70832-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type; q=dns; s=default; b=Gyf/J XaHmM21mIJC/UoKygqLhDA/ROJhuvY3/wT41n5qXr9qbZ9dUk2MU/Jra/CcoQgx7 fQ/sXZGQQgSDpX3OgV/cL8zub7an7/1X3h0Q9LYt2nJF1S7KNzrUNfnLFMQ/dVhb mhfvQgYwmOzp95WesK+xeXZ865jJo6ba8eKfY0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type; s=default; bh=+lvKptxYXqS eshXJ7/BHfnw/gu0=; b=iPEZ1kd9H7ANe5XIgpD5bO9RGoWlBP3f1eNRJjw/lvq yHT1hnx7ID8iy0xg1iQOkRL2n+CPhvTko14ExNID6yfyAeqkN2Zq0QmiSOq5Uhe3 1ZbNwh6+/lbFhfInVSGRFuUQFfPrWREugY/JiD+GiZtNeqxHLvVulNNEVzsijJRo = Received: (qmail 27613 invoked by alias); 21 Jun 2016 05:13:35 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 22037 invoked by uid 89); 21 Jun 2016 05:13:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=2512, 916, 62, 6, 91, 6 X-HELO: na01-by2-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; From: Yury Norov To: , CC: , , , , , , , , , Yury Norov Subject: [PATCH 23/27] [AARCH64] delouse input arguments in system functions Date: Tue, 21 Jun 2016 08:07:07 +0300 Message-ID: <1466485631-3532-25-git-send-email-ynorov@caviumnetworks.com> In-Reply-To: <1466485631-3532-1-git-send-email-ynorov@caviumnetworks.com> References: <1466485631-3532-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-ClientProxiedBy: HE1PR03CA0025.eurprd03.prod.outlook.com (10.163.170.163) To SN1PR07MB2253.namprd07.prod.outlook.com (10.164.47.147) X-MS-Office365-Filtering-Correlation-Id: c6a2dec0-808c-4243-58d5-08d3999292e6 X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2253; 2:/biq96+iuDIMrlqL70Ee4YJ3qI77SIQPEAUe/EU7LjD7DQ6D7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wdr5we6EYJt6G+BGEJuhGOmKJRKxtdrke27O1pMHFakfYnyL6E4u2Erjri7fMsblr+65rrizjXDaM8hvrhnlEG8hORo46RA== X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2253; 20:Ztbg5n733RwjhG463Prl8IVFdXwnXRRJEws90lvbshGocS9BPuBhNdHKDLzAiAm9GqP6lCZoJ5hF/Dri5iKvBVyMf33GD+O9RJlIJA1ACToVFir60AXUgGA0VxB+4X43CrMMMDtclP7DQ96e7cJgpU1bVjTd1tiez3Ub45q8XKzX50FTFeqNaVWuUQOEI6Dfml/4zZjk2Q6EOnD6FiNXJTGdjtNKmXZ5/v6zC3D/k4sq7ytMlxAe3Hx0xWXsmpMzWSGtwUmx+C+yNW0i3BE3o3LfseArjsd0GWaSYp1RNYSkZrroRpajC/aVzh9cYBFN8sKDfYVQcm5rotrcyYpbt12751urMP842kguLX7qyYaWUSROWlN6VKni4DZIjSRrg0LfN6VF001zsCYPsTL8Y5sZHebCOzABpbHRJ38Yie41TFahIUIWekzB64s1Nc8YSzP9edHTJ7Nv14kRqw1DICGFK/PRScZgQ7lpVRSsja+hYzFd8fs4+rpcouIpu7Ax78si0ExBTFN8ql+tnqZ48ZPpBynUakobcyseXL8t3I4AadHF7vvgZtJXzLeb50VJUe1WtH6CBSwXSwobCt3McDJBhiCUN2bCNws6g4qdH1U= 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)(10201501046)(3002001); SRVR:SN1PR07MB2253; BCL:0; PCL:0; RULEID:; SRVR:SN1PR07MB2253; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2253; 4:Vx2wMi+CEh83cxb16VYYILulYtXG8b4u2XSJScD3O/booLiKpMtYFF5lSTY5rCxt7B5VQk77WlXUe3g/fFaMuHJ+w8Hkj5aWbIq5Z6HLQB7gkydjzTT9gYab4DZoSHBKO3D4ooGkGxyBHaGq4+LD6FhyJBRFP06FJj4GUMH8h0d+rw94uxBXA4/KQhYpN0QYtvmA3jD5WG+KVAknmAG3M76dm2s46CTCB6Y+cZlu1aIyhUDVm1jTtr7zedzPKV+UY9SyQi2uToDHAaURBVlU09SsFXc6fQBX/KWq9op3adBFJgL8CifnQwhyOsbhK1MDXusM0f4IG3NO7lnYdwNATDvTBGqAy2uAAUyaw33fcrg0VymkX5WqmiXb7v4W5S1C X-Forefront-PRVS: 098076C36C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(199003)(189002)(101416001)(33646002)(575784001)(2906002)(106356001)(50986999)(68736007)(76176999)(50466002)(107886002)(48376002)(7736002)(50226002)(5001770100001)(189998001)(4326007)(76506005)(97736004)(36756003)(5003940100001)(2950100001)(92566002)(7846002)(42186005)(229853001)(6116002)(3846002)(81156014)(19580395003)(8676002)(81166006)(586003)(77096005)(4001430100002)(66066001)(47776003)(19580405001)(105586002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR07MB2253; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2253; 23:VimRJWLTDfb5oBQ1DBUuqc7NTKeEFRSc+vg+owL2wW4kIACgAMqhNFkPHiPaEMOWTk1Jj+f+cZEGENcJEuO6qLeBMjRpCqAIKkW4KbsMTQJkqP8mg3d0j9BRwIpp3MWmXcmIAdqhQkLHXMrXhziGS5EWdUQsngGVrXMc1HIIOpnEVwJT1na5/WVVRrgat3/ia0W3XX6NoO6FFSw9bjf9Z8mUbMGBCqVkawxJV5kbp4OaDsZsiMFH/2ORSmoT1tMOuctL1qrTYrfq22DNYPb6yIA39FeTuRT6Q9wAJkVct7r4xi2JxNHWcVK9yWGb1W9taHttc8GeFUNUR5NnPy1ky7AgP22W3nyQ+ML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unb6srBUpotyFHXQR5geCpW/7HL3eibFXmURNBXVVpsueYWo=; 5:xjR7s56H2TylQzyzfJeFjOBKQaZd4uqWO36sodMsgk8mpYmrgEUP0JGypNpTg72v2bawNOl4d/y8kKAo60/rm8bZ2gLpeNV7U5uPxubRNQT25paNGEk5vT9dfxwNRMXD+WG9+CtGTdyUGjLjz9OABQ==; 24:deHttzVCf4ece3Ys9FCgPV7lwIyWXjzpbXzrVTBiAkXe+7NK3OhIxKvsSE9UobHt8LdbqZ4b5aoHvOsOXQiw5J5cPqMKwyfNArpjTjZD+w4=; 7:Mzoqg5E0MZJXul/qZ4RcMsdMkBiycyma/uREZQZyhNBAe+DhHpnnQAQRfiWUr3zObL34JQTu2TG0iqVGxo006iUe5Zu8EnG8jbapbsgFvgHHKXL+olY0G1DJgWB6LB5W5+M1XSMkbMZvARCQ8qqvrFLGTUqldyBRKFtqnFJPiujafrSMgVR805eS/f5XgVJiSFnFm00JRMa4MV0nKLQ1O1bT1b2chVJVt4iv5T0+TXLZdL8PH5VYcMRsbTNSfpMC SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2016 05:11:59.3482 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2253 Signed-off-by: Yury Norov --- sysdeps/aarch64/__longjmp.S | 2 ++ sysdeps/aarch64/dl-tlsdesc.S | 6 ++++++ sysdeps/aarch64/memcmp.S | 3 +++ sysdeps/aarch64/memcpy.S | 4 +++- sysdeps/aarch64/memmove.S | 3 +++ sysdeps/aarch64/memset.S | 3 ++- sysdeps/aarch64/setjmp.S | 1 + sysdeps/aarch64/strchr.S | 1 + sysdeps/aarch64/strchrnul.S | 1 + sysdeps/aarch64/strcmp.S | 2 ++ sysdeps/aarch64/strcpy.S | 2 ++ sysdeps/aarch64/strlen.S | 2 ++ sysdeps/aarch64/strncmp.S | 3 +++ sysdeps/aarch64/strnlen.S | 3 +++ sysdeps/aarch64/strrchr.S | 1 + sysdeps/aarch64/sysdep.h | 4 +++- sysdeps/unix/sysv/linux/aarch64/clone.S | 7 +++++++ sysdeps/unix/sysv/linux/aarch64/getcontext.S | 1 + sysdeps/unix/sysv/linux/aarch64/setcontext.S | 1 + sysdeps/unix/sysv/linux/aarch64/swapcontext.S | 1 + 20 files changed, 48 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/sysdeps/aarch64/__longjmp.S b/sysdeps/aarch64/__longjmp.S index 58332be..0377715 100644 --- a/sysdeps/aarch64/__longjmp.S +++ b/sysdeps/aarch64/__longjmp.S @@ -46,6 +46,8 @@ ENTRY (__longjmp) cfi_offset(d14, JB_D14<<3) cfi_offset(d15, JB_D15<<3) + DELOUSE(0) + ldp x19, x20, [x0, #JB_X19<<3] ldp x21, x22, [x0, #JB_X21<<3] ldp x23, x24, [x0, #JB_X23<<3] diff --git a/sysdeps/aarch64/dl-tlsdesc.S b/sysdeps/aarch64/dl-tlsdesc.S index fe8a17d..718dddf 100644 --- a/sysdeps/aarch64/dl-tlsdesc.S +++ b/sysdeps/aarch64/dl-tlsdesc.S @@ -74,6 +74,7 @@ cfi_startproc .align 2 _dl_tlsdesc_return: + DELOUSE(0) ldr PTR_REG (0), [x0, #PTR_SIZE] RET cfi_endproc @@ -126,6 +127,7 @@ _dl_tlsdesc_undefweak: td->entry in _dl_tlsdesc_resolve_rela_fixup ensuring that the load from [x0,#8] here happens after the initialization of td->arg. */ ldar xzr, [x0] + DELOUSE(0) ldr PTR_REG (0), [x0, #PTR_SIZE] mrs x1, tpidr_el0 sub PTR_REG (0), PTR_REG (0), PTR_REG (1) @@ -174,6 +176,7 @@ _dl_tlsdesc_dynamic: stp x29, x30, [sp,#-(32+16*NSAVEXREGPAIRS)]! cfi_adjust_cfa_offset (32+16*NSAVEXREGPAIRS) mov x29, sp + DELOUSE(0) /* Save just enough registers to support fast path, if we fall into slow path we will save additional registers. */ @@ -279,12 +282,14 @@ _dl_tlsdesc_resolve_rela: SAVE_Q_REGISTERS + DELOUSE(3) ldr PTR_REG (1), [x3, #PTR_SIZE] bl _dl_tlsdesc_resolve_rela_fixup RESTORE_Q_REGISTERS ldr x0, [sp, #32+16*8] + DELOUSE(0) ldr PTR_REG (1), [x0] blr x1 @@ -346,6 +351,7 @@ _dl_tlsdesc_resolve_hold: RESTORE_Q_REGISTERS ldr x0, [sp, #32+16*9] + DELOUSE(0) ldr PTR_REG (1), [x0] blr x1 diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S index ae2d997..982aa02 100644 --- a/sysdeps/aarch64/memcmp.S +++ b/sysdeps/aarch64/memcmp.S @@ -47,6 +47,9 @@ #define mask x13 ENTRY_ALIGN (memcmp, 6) + DELOUSE(0) + DELOUSE(1) + DELOUSE(2) cbz limit, L(ret0) eor tmp1, src1, src2 tst tmp1, #7 diff --git a/sysdeps/aarch64/memcpy.S b/sysdeps/aarch64/memcpy.S index 442f390..e0bbbf8 100644 --- a/sysdeps/aarch64/memcpy.S +++ b/sysdeps/aarch64/memcpy.S @@ -46,7 +46,9 @@ #include ENTRY_ALIGN (memcpy, 6) - + DELOUSE(0) + DELOUSE(1) + DELOUSE(2) mov dst, dstin cmp count, #64 b.ge L(cpy_not_short) diff --git a/sysdeps/aarch64/memmove.S b/sysdeps/aarch64/memmove.S index dd91db0..3f72dea 100644 --- a/sysdeps/aarch64/memmove.S +++ b/sysdeps/aarch64/memmove.S @@ -46,6 +46,9 @@ #define D_h x14 ENTRY_ALIGN (memmove, 6) + DELOUSE(0) + DELOUSE(1) + DELOUSE(2) cmp dstin, src b.lo L(downwards) diff --git a/sysdeps/aarch64/memset.S b/sysdeps/aarch64/memset.S index e49f4d6..e8eed9e 100644 --- a/sysdeps/aarch64/memset.S +++ b/sysdeps/aarch64/memset.S @@ -52,7 +52,8 @@ #define tmp3w w9 ENTRY_ALIGN (__memset, 6) - + DELOUSE(0) + DELOUSE(2) mov dst, dstin /* Preserve return value. */ ands A_lw, val, #255 #ifndef DONT_USE_DC diff --git a/sysdeps/aarch64/setjmp.S b/sysdeps/aarch64/setjmp.S index da83f19..d608660 100644 --- a/sysdeps/aarch64/setjmp.S +++ b/sysdeps/aarch64/setjmp.S @@ -33,6 +33,7 @@ END (_setjmp) libc_hidden_def (_setjmp) ENTRY (__sigsetjmp) + DELOUSE(0) 1: stp x19, x20, [x0, #JB_X19<<3] diff --git a/sysdeps/aarch64/strchr.S b/sysdeps/aarch64/strchr.S index 5e3aecf..838384c 100644 --- a/sysdeps/aarch64/strchr.S +++ b/sysdeps/aarch64/strchr.S @@ -62,6 +62,7 @@ /* Locals and temporaries. */ ENTRY (strchr) + DELOUSE(0) mov wtmp2, #0x0401 movk wtmp2, #0x4010, lsl #16 dup vrepchr.16b, chrin diff --git a/sysdeps/aarch64/strchrnul.S b/sysdeps/aarch64/strchrnul.S index a624c8d..b60df26 100644 --- a/sysdeps/aarch64/strchrnul.S +++ b/sysdeps/aarch64/strchrnul.S @@ -60,6 +60,7 @@ identify exactly which byte is causing the termination. */ ENTRY (__strchrnul) + DELOUSE(0) /* Magic constant 0x40100401 to allow us to identify which lane matches the termination condition. */ mov wtmp2, #0x0401 diff --git a/sysdeps/aarch64/strcmp.S b/sysdeps/aarch64/strcmp.S index ba0ccb4..ccfe281 100644 --- a/sysdeps/aarch64/strcmp.S +++ b/sysdeps/aarch64/strcmp.S @@ -49,6 +49,8 @@ /* Start of performance-critical section -- one 64B cache line. */ ENTRY_ALIGN(strcmp, 6) + DELOUSE(0) + DELOUSE(1) eor tmp1, src1, src2 mov zeroones, #REP8_01 tst tmp1, #7 diff --git a/sysdeps/aarch64/strcpy.S b/sysdeps/aarch64/strcpy.S index 0694199..2a281b9 100644 --- a/sysdeps/aarch64/strcpy.S +++ b/sysdeps/aarch64/strcpy.S @@ -91,6 +91,8 @@ #define MIN_PAGE_SIZE (1 << MIN_PAGE_P2) ENTRY_ALIGN (STRCPY, 6) + DELOUSE(0) + DELOUSE(1) /* For moderately short strings, the fastest way to do the copy is to calculate the length of the string in the same way as strlen, then essentially do a memcpy of the result. This avoids the need for diff --git a/sysdeps/aarch64/strlen.S b/sysdeps/aarch64/strlen.S index 9b4d1da..4734cfb 100644 --- a/sysdeps/aarch64/strlen.S +++ b/sysdeps/aarch64/strlen.S @@ -85,6 +85,8 @@ boundary. */ ENTRY_ALIGN (strlen, 6) + DELOUSE(0) + DELOUSE(1) and tmp1, srcin, MIN_PAGE_SIZE - 1 mov zeroones, REP8_01 cmp tmp1, MIN_PAGE_SIZE - 16 diff --git a/sysdeps/aarch64/strncmp.S b/sysdeps/aarch64/strncmp.S index f6a17fd..a372654 100644 --- a/sysdeps/aarch64/strncmp.S +++ b/sysdeps/aarch64/strncmp.S @@ -51,6 +51,9 @@ #define endloop x15 ENTRY_ALIGN_AND_PAD (strncmp, 6, 7) + DELOUSE(0) + DELOUSE(1) + DELOUSE(2) cbz limit, L(ret0) eor tmp1, src1, src2 mov zeroones, #REP8_01 diff --git a/sysdeps/aarch64/strnlen.S b/sysdeps/aarch64/strnlen.S index 4cce45f..6f67221 100644 --- a/sysdeps/aarch64/strnlen.S +++ b/sysdeps/aarch64/strnlen.S @@ -50,6 +50,9 @@ #define REP8_80 0x8080808080808080 ENTRY_ALIGN_AND_PAD (__strnlen, 6, 9) + DELOUSE(0) + DELOUSE(1) + DELOUSE(2) cbz limit, L(hit_limit) mov zeroones, #REP8_01 bic src, srcin, #15 diff --git a/sysdeps/aarch64/strrchr.S b/sysdeps/aarch64/strrchr.S index 44c1917..bb85a60 100644 --- a/sysdeps/aarch64/strrchr.S +++ b/sysdeps/aarch64/strrchr.S @@ -68,6 +68,7 @@ identify exactly which byte is causing the termination, and why. */ ENTRY(strrchr) + DELOUSE(0) cbz x1, L(null_search) /* Magic constant 0x40100401 to allow us to identify which lane matches the requested byte. Magic constant 0x80200802 used diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h index f2ea821..c4ff5e7 100644 --- a/sysdeps/aarch64/sysdep.h +++ b/sysdeps/aarch64/sysdep.h @@ -25,10 +25,12 @@ #define AARCH64_R(NAME) R_AARCH64_ ## NAME #define PTR_REG(n) x##n #define PTR_LOG_SIZE 3 -#else +#define DELOUSE(n) +#else /* __ILP32__ */ #define AARCH64_R(NAME) R_AARCH64_P32_ ## NAME #define PTR_REG(n) w##n #define PTR_LOG_SIZE 2 +#define DELOUSE(n) mov w##n, w##n #endif #define PTR_SIZE (1<