[{"id":1764673,"web_url":"http://patchwork.ozlabs.org/comment/1764673/","msgid":"<877exalool.fsf@mid.deneb.enyo.de>","list_archive_url":null,"date":"2017-09-07T11:43:06","subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools in\n\tstart.S","submitter":{"id":5264,"url":"http://patchwork.ozlabs.org/api/people/5264/","name":"Florian Weimer","email":"fw@deneb.enyo.de"},"content":"> eXecute-Only Memory (XOM) is a protection mechanism against some ROP\n> attacks. XOM sets the code as executable and unreadable, so the\n> access to any data, like literal pools, in the code section causes\n> the fault with XOM. The compiler can disable literal pools for C\n> source files, but not for assembly files, so I use movz/movk instead\n> of literal pools in start.S for XOM.\n\nIsn't the main goal of XOM to make it more difficult for the\nlegitimate device owner to view running machine code?\n\n| Execute-only memory allows you to protect your intellectual property\n| by preventing executable code being read by users. For example, you\n| can place firmware in execute-only memory and load user code and\n| drivers separately. Placing the firmware in execute-only memory\n| prevents users from trivially reading the code.\n\n<http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471m/chr1368698326509.html>\n\nI don't think it's in the interests of the GNU projet to support such\na thing.","headers":{"Return-Path":"<libc-alpha-return-84296-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84296-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"YAJNzyat\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnz9R4CBnz9sRY\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 21:43:23 +1000 (AEST)","(qmail 19035 invoked by alias); 7 Sep 2017 11:43:16 -0000","(qmail 19026 invoked by uid 89); 7 Sep 2017 11:43:15 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:from:to:cc:subject:references:date:in-reply-to\n\t:message-id:mime-version:content-type; q=dns; s=default; b=BMOdA\n\tjh5XxiYdpZdsR9X9OtAkvaAoZS0qqFr3cfxRj5mGt8IorGuWx3l6XhoP+Zl5dkwN\n\tpHhQys0RbOmoG2QJH5Uf4PTmcKLBRshVX5hcCSTYz7ap2Mxj186Lw68io39VGPWb\n\tk/rF/YfGn+9iFm2+n+Z7ANzflHV+ZqI+y/gLFU=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:from:to:cc:subject:references:date:in-reply-to\n\t:message-id:mime-version:content-type; s=default; bh=zx8fv/4TFjI\n\tA6cArE+pQcRbk+Ls=; b=YAJNzyat/M+lxHurwFA9bRI4S2TrSEyJCvudmSo6Zy8\n\tJHF1pVWgXAhLLukFpRxzv2myAREaMoS7izipDsQkbxaY1Rc2TXCLqB0LEP30rQva\n\tOYhMkJPwyqld8d+DQ5XB/PoHWmpVrviq2xc6zMUSwkYX2iuFef3VBL23pUv1On+M\n\t=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=0.7 required=5.0 tests=AWL, BAYES_20,\n\tKAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE,\n\tRP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*MI:mid,\n\tH*M:mid, index.jsp, UD:index.jsp","X-HELO":"albireo.enyo.de","From":"Florian Weimer <fw@deneb.enyo.de>","To":"wangboshi <wangboshi@huawei.com>","Cc":"<libc-alpha@sourceware.org>","Subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools in\n\tstart.S","References":"<e65025af-5168-c999-bfc1-7ac614314836@huawei.com>","Date":"Thu, 07 Sep 2017 13:43:06 +0200","In-Reply-To":"<e65025af-5168-c999-bfc1-7ac614314836@huawei.com>\n\t(wangboshi@huawei.com's message of \"Thu, 7 Sep 2017 15:33:34 +0800\")","Message-ID":"<877exalool.fsf@mid.deneb.enyo.de>","MIME-Version":"1.0","Content-Type":"text/plain"}},{"id":1766141,"web_url":"http://patchwork.ozlabs.org/comment/1766141/","msgid":"<59B65010.4020807@arm.com>","list_archive_url":null,"date":"2017-09-11T08:57:52","subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools\n\tin start.S","submitter":{"id":65667,"url":"http://patchwork.ozlabs.org/api/people/65667/","name":"Szabolcs Nagy","email":"szabolcs.nagy@arm.com"},"content":"On 07/09/17 12:43, Florian Weimer wrote:\n>> eXecute-Only Memory (XOM) is a protection mechanism against some ROP\n>> attacks. XOM sets the code as executable and unreadable, so the\n>> access to any data, like literal pools, in the code section causes\n>> the fault with XOM. The compiler can disable literal pools for C\n>> source files, but not for assembly files, so I use movz/movk instead\n>> of literal pools in start.S for XOM.\n> \n> Isn't the main goal of XOM to make it more difficult for the\n> legitimate device owner to view running machine code?\n> \n> | Execute-only memory allows you to protect your intellectual property\n> | by preventing executable code being read by users. For example, you\n> | can place firmware in execute-only memory and load user code and\n> | drivers separately. Placing the firmware in execute-only memory\n> | prevents users from trivially reading the code.\n> \n> <http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471m/chr1368698326509.html>\n> \n> I don't think it's in the interests of the GNU projet to support such\n> a thing.\n> \n\neven if that's the main use of xom, there might be other uses\nand removing data from text might have other uses than xom\n(reduce rop gadget possibility?) so i don't think this should\nbe a problem (the gnu project already supports gazillion\nfeatures that can do harm).","headers":{"Return-Path":"<libc-alpha-return-84439-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84439-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"NlQtUMi0\"; dkim-atps=neutral","sourceware.org; auth=none","spf=none (sender IP is )\n\tsmtp.mailfrom=Szabolcs.Nagy@arm.com; "],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xrMJx1kd3z9s7G\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 11 Sep 2017 18:58:09 +1000 (AEST)","(qmail 61168 invoked by alias); 11 Sep 2017 08:58:03 -0000","(qmail 61144 invoked by uid 89); 11 Sep 2017 08:58:02 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:message-id:date:from:mime-version:to:cc\n\t:subject:references:in-reply-to:content-type\n\t:content-transfer-encoding; q=dns; s=default; b=fmaNerGPk60F7ptC\n\tH+kqOOjR/sxHWICrM9kKe8DFRLITYO4Rl4Hp+JMGk2QKToMYpGwP7zuTRbrHjeoW\n\t6r0nT9OrNv6NneCmiMimcAoMXZAjOia2eNIKEBqMKtTMF24Ry4Xb2262YxDCfCS0\n\t6/ESMlRDHpGuubsqtmjHfOUId7c=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:message-id:date:from:mime-version:to:cc\n\t:subject:references:in-reply-to:content-type\n\t:content-transfer-encoding; s=default; bh=bb3WcFuIB4LZlts5Dbo8r2\n\tN+sa8=; b=NlQtUMi0ya2egceCz5jOH/UA3lggOrRSot9tHb2WDj0BHj4df9apZF\n\tlbvsY/CSIHXwbl3VeYtkqretI5rzvyvB/4Br1wRaq50qt5wG7uSBgct6Rr6Tai/w\n\tLjcitc4ymLf9yIX0dJ6gpUuayRkBX8hbRh4xnCos6XGjzlcTH/2o4=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-2.1 required=5.0 tests=AWL, BAYES_00,\n\tRCVD_IN_DNSWL_NONE, SPF_HELO_PASS,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=interests, UD:jsp","X-HELO":"EUR02-AM5-obe.outbound.protection.outlook.com","Message-ID":"<59B65010.4020807@arm.com>","Date":"Mon, 11 Sep 2017 09:57:52 +0100","From":"Szabolcs Nagy <szabolcs.nagy@arm.com>","User-Agent":"Mozilla/5.0 (X11; Linux x86_64;\n\trv:31.0) Gecko/20100101 Thunderbird/31.8.0","MIME-Version":"1.0","To":"Florian Weimer <fw@deneb.enyo.de>, wangboshi <wangboshi@huawei.com>","CC":"nd@arm.com, libc-alpha@sourceware.org","Subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools\n\tin start.S","References":"<e65025af-5168-c999-bfc1-7ac614314836@huawei.com>\n\t<877exalool.fsf@mid.deneb.enyo.de>","In-Reply-To":"<877exalool.fsf@mid.deneb.enyo.de>","Content-Type":"text/plain; charset=windows-1252","Content-Transfer-Encoding":"7bit","X-ClientProxiedBy":"HE1P190CA0021.EURP190.PROD.OUTLOOK.COM\n\t(2603:10a6:3:bc::31)\n\tTo DB6PR0802MB2487.eurprd08.prod.outlook.com (2603:10a6:4:a0::22)","X-MS-PublicTrafficType":"Email","X-MS-Office365-Filtering-Correlation-Id":"b4fe7b6a-4067-476c-e10f-08d4f8f331e7","X-MS-Office365-Filtering-HT":"Tenant","X-Microsoft-Antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:DB6PR0802MB2487; ","X-Microsoft-Exchange-Diagnostics":["1; DB6PR0802MB2487;\n\t3:qI+OwFljy8EvCNMpZzU8spK0A4BaU30ORFMMZucTBzPQZEoR8IyyOiwOBEjmbEQlgmRS2iTsalIJgKL1rX9k/slq11y7GiYCM3QKU8kaSrblEXchYmI0t8ZiGHynDOGdegAiLSZmUPvDT0j83CtaszCuBB+zRmqHLFTeb4x+TV8LTWSfTOAzT2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rLwnA6ME/3KgyMsj04WvMUFNzjef7v728xX8hokgI3y+Ny7Y4cboqIXqnzhO7RaMUZl/ibV1PGw4lFg0MyKU=","=?windows-1252?q?1=3BDB6PR0802MB2487=3B?=\n\t=?windows-1252?q?23=3A+57FUMVU7Vsury7W1y2I3ETPKuyIS2wWkTUZRgoEFwgj?=\n\t=?windows-1252?q?+OL5q6UYQX4eEz3vUulYG4nHc4TL+7TbwZAh+ZDnygZq1z7Bg?=\n\t=?windows-1252?q?lSE4Kysq0D4zTPUQG78wgXgdDWWjw6nAEdvUCT1BDPdUVGCZV?=\n\t=?windows-1252?q?joT8bRmlnyyWxdF3jtpg3ryBzVCoCMdqrLMymZMvvuAmaALLV?=\n\t=?windows-1252?q?TAykCzHMibGj4uoIckn8pui3hDGtnNU2frnOwvd6YCWnXUYRF?=\n\t=?windows-1252?q?GzjrtNKuhXFdbzzOQkyP/7828TmpZXBBFZomXCMeBgTalEkB/?=\n\t=?windows-1252?q?0RdKPbT+waDd2gwlrJmzMdlD2310AlonVQ7ekIi/S0GuvdnAt?=\n\t=?windows-1252?q?jqra0qHoI+2+6YqmSFC7c3XeGx4VMK6RzmZkz4M1Wq5XZjHCB?=\n\t=?windows-1252?q?6o7XNc7MgiuSSQGoVg/bgApxqSDpX76NdaNKcXuC9BmDlUfHr?=\n\t=?windows-1252?q?6ntOcGBuvbJzJWrHIEykp9W0k+sVT54Sox98o4VZ2mnhYszkG?=\n\t=?windows-1252?q?wPFvSc7aqnxrVorwVkplFBGuTqsFvfJrVRdgMzLvM9I8+zVQa?=\n\t=?windows-1252?q?4FPpP1hroIInUBwrIFVQ0eKMosEo/kL0CGX1uhkXswWZZgYZ0?=\n\t=?windows-1252?q?inETEi5DJL1xUOR3RgtNYOGQoW9jvMlIvJPhqtpRx1tIhgPgM?=\n\t=?windows-1252?q?HYG2RWmHxoaiKk5yg/EP3zSG7/Lxj66sl5HiwJRblweOomcLT?=\n\t=?windows-1252?q?lu0h6EuSENjsfqa0/HFE2bbSm0bYiuiMLhm9zWKoyqCO3uPKN?=\n\t=?windows-1252?q?Ixp7ioNUtmmiWycPTnXv9gjFIiNyZXvb8tFHXAvjlUsJie8l2?=\n\t=?windows-1252?q?IBNBYgXGwn8+N+b7kzO3YoKHuR8wHL7+goKzH02D7e33DKGUJ?=\n\t=?windows-1252?q?5qhgaR6ylD/uBACrybyYy1uwYu/PohB/CEiB6DLpfDYqAmrfl?=\n\t=?windows-1252?q?yPHg81eVqafLfPsupnwR6PSJgGgzrrZ1LXBjTs4nldICNsLYY?=\n\t=?windows-1252?q?PTCF4X78JSLUj2icyZtKYYC50R+od1f27V4/jzNGBR76/h0yV?=\n\t=?windows-1252?q?NE2NjuC727eyEim4MXiZUs3G8tOiMwyJRyn+XHyyy3HsEYOE8?=\n\t=?windows-1252?q?0eLxLD+QuEbCN816ILkg9cYWYs2XYf6ANzrAgEMq/xM/A+BaR?=\n\t=?windows-1252?q?sutLMIZIiPfmeS1Esw/czjmKfpIDIr+zaLPPqt848UGc+q81t?=\n\t=?windows-1252?q?bcplkbco8RuXSOo0AiCCF/1tFNJ2wxXpMj552aFejcR72cNXX?=\n\t=?windows-1252?q?wbEBAI7LVrbPddVbrYYVqwhPOoq8BhZzySdFoUf2PK3HzwNAk?=\n\t=?windows-1252?q?jWQkbOZ8J5QOqRgtpXptbUbEUQ00WimuKldv0lOOAhTnGUYS9?=\n\t=?windows-1252?q?z0uTsi0yk7vuNqM9coe/4b5VRXOaIWRysyAScTsSq4Kx8LvoF?=\n\t=?windows-1252?q?tn45ZC7JjlZHZNClYOT3wfoQFLuuDJTcVpXC4Reh9EquCSonq?=\n\t=?windows-1252?q?p3QpJ9nF/rudfHrDXKkh2mOhtc9Z75t1QVwaxFyhy?=","1; DB6PR0802MB2487;\n\t6:f8/CWsm/x5mN10No5XHU5Pisz+eD/qwBFdPxtPtZwuyTdrJUIwcIykGtaczRnsaF+O4/9Eg/4dacelZFquJmxl7iirSdTd9Xrf4y2YwSe8QDnYjqeLvJUa4K0sbFix61iEkHAzT7AMsird2byEVXFEkOH8Ic1feF2nRby8M57RTdv23R19UgdDcPqk2Mk+TW+i7O4ETGE1XqZmSVN2bGOBbkgBIJchP2eOvaGmbSxhRUXRDE+ykHIADJohO/YZmb/artHJ4Yj6uUILuTNo9F4HVN94Vd5d5umJGRsNnNFf6t5tO8+joLEO5b3JCgun4Pgw1rjG7MzqMVO2nrB+QrVA==;\n\t5:GfZsr0o13PvcZ2oMgdbztk1wKgQ6v30BzSpyeB9wxPf3TEcFJg729cuVfw6ilOGvLMWXgi3o3Togdb690/nuN4XIl3SffbJw245QveXxXm26wfke9AD+d3fdl7vpSDHrF6gkOFFbEIBWOUKrmb/dRw==;\n\t24:lyj4UbrmFSHfjtYkkZhMs4LCRGFAfADwS8kBXzlUZVO3ydmN8qylLqhXWPW1giIcjJmO4UUmdB4I9wjzIhFMtw63N1nEf9uplOmYSAtMxG0=;\n\t7:AbCRLKbIv35bZ4rxgnGppe2+XwI5KbCn2uDzQq95HXNvjQ4ZjJl7FkKV6WcRLB4BSrblA1hThTwg0rZYn683Zp2yv8XoTDR+2PUIWjGb07/LsWtO5qYxZ2tNeB0ivRVJu88va1jLm0tfP6oyBPmSpYh2WcJrRJkK/EZ0t5dBKwbO4c71agzkultLndX7BmIQww7YGsspiyTxhtm2Z3aWWXlv1yXjh9XzQR1FqnbfTVg="],"X-MS-TrafficTypeDiagnostic":"DB6PR0802MB2487:","NoDisclaimer":"True","X-Exchange-Antispam-Report-Test":"UriScan:(180628864354917);","X-Microsoft-Antispam-PRVS":"<DB6PR0802MB24879518091FCAA1A23E5845ED680@DB6PR0802MB2487.eurprd08.prod.outlook.com>","X-Exchange-Antispam-Report-CFA-Test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123558100)(20161123555025)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:DB6PR0802MB2487; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:DB6PR0802MB2487; ","X-Forefront-PRVS":"04270EF89C","X-Forefront-Antispam-Report":"SFV:NSPM;\n\tSFS:(10009020)(7370300001)(4630300001)(6049001)(6009001)(39860400002)(24454002)(199003)(189002)(83506001)(6666003)(72206003)(50986999)(54356999)(87266999)(76176999)(101416001)(65816999)(36756003)(66066001)(65956001)(65806001)(59896002)(47776003)(23746002)(6246003)(229853002)(7350300001)(64126003)(50466002)(97736004)(80316001)(4001350100001)(106356001)(6306002)(105586002)(42186005)(33656002)(2950100002)(189998001)(53936002)(86362001)(6486002)(7736002)(77096006)(53546010)(68736007)(305945005)(478600001)(81166006)(4326008)(25786009)(81156014)(2906002)(3846002)(6116002)(230700001)(5660300001)(8676002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2487;\n\tH:[10.2.206.69]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1;\n\tLANG:en; ","Received-SPF":"None (protection.outlook.com: arm.com does not designate\n\tpermitted sender hosts)","SpamDiagnosticOutput":"1:99","SpamDiagnosticMetadata":"NSPM","X-OriginatorOrg":"arm.com","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"11 Sep 2017 08:57:55.6291\n\t(UTC)","X-MS-Exchange-CrossTenant-FromEntityHeader":"Hosted","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"DB6PR0802MB2487"}},{"id":1766149,"web_url":"http://patchwork.ozlabs.org/comment/1766149/","msgid":"<CA+=Sn1n7edmzjTSDatyY1tfi3Lz70m3XjeXfgKbgDt_GCZE2NQ@mail.gmail.com>","list_archive_url":null,"date":"2017-09-11T09:09:41","subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools in\n\tstart.S","submitter":{"id":40,"url":"http://patchwork.ozlabs.org/api/people/40/","name":"Andrew Pinski","email":"pinskia@gmail.com"},"content":"On Thu, Sep 7, 2017 at 12:33 AM, wangboshi <wangboshi@huawei.com> wrote:\n> eXecute-Only Memory (XOM) is a protection mechanism against some ROP\n> attacks. XOM sets the code as executable and unreadable, so the access to\n> any data, like literal pools, in the code section causes the fault with XOM.\n> The compiler can disable literal pools for C source files, but not for\n> assembly files, so I use movz/movk instead of literal pools in start.S for\n> XOM.\n>\n> I add MOVL macro with movz/movk instructions like movl pseudo-instruction in\n> armasm, and use the macro instead of literal pools.\n\nI have a few comments about the overall design:\nI don't know if this is a good idea, can the kernel override XOM anyways?\nThat is if you do write(N, &main, 1024);\nThat will write the main function out to the file?\n\n\nI have one comment about the implementation too.\n\n>\n>\n> 2017-09-07  Wang Boshi  <wangboshi@huawei.com>\n>\n>     * sysdeps/aarch64/start.S: Use MOVL instead of literal pools.\n>     * sysdeps/aarch64/sysdep.h (MOVL): Add MOVL macro.\n>\n> diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S\n> index df1c642..51e8e82 100644\n> --- a/sysdeps/aarch64/start.S\n> +++ b/sysdeps/aarch64/start.S\n> @@ -71,9 +71,9 @@ _start:\n>      ldr     PTR_REG (4), [x4, #:got_lo12:__libc_csu_fini]\n>  #else\n>      /* Set up the other arguments in registers */\n> -    ldr    PTR_REG (0), =main\n> -    ldr    PTR_REG (3), =__libc_csu_init\n> -    ldr    PTR_REG (4), =__libc_csu_fini\n> +    MOVL(0, main)\n> +    MOVL(3, __libc_csu_init)\n> +    MOVL(4, __libc_csu_fini)\n>  #endif\n>\n>      /* __libc_start_main (main, argc, argv, init, fini, rtld_fini,\n> diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h\n> index a749a70..0a11b57 100644\n> --- a/sysdeps/aarch64/sysdep.h\n> +++ b/sysdeps/aarch64/sysdep.h\n> @@ -137,6 +137,20 @@\n>      ldr    PTR_REG (T), [x##T, #:got_lo12:EXPR];    \\\n>      OP    PTR_REG (R), [x##T];\n>\n> +/* Load an immediate into R.\n> +   Note R is a register number and not a register name. */\n> +#ifdef __LP64__\n> +# define MOVL(n, name)                    \\\n> +    movz    PTR_REG(n), #:abs_g3:name;        \\\n> +    movk    PTR_REG(n), #:abs_g2_nc:name;        \\\n> +    movk    PTR_REG(n), #:abs_g1_nc:name;        \\\n> +    movk    PTR_REG(n), #:abs_g0_nc:name;\n> +#else\n> +# define MOVL(n, name)                    \\\n> +    movz    PTR_REG(n), #:abs_g1:name;        \\\n> +    movk    PTR_REG(n), #:abs_g0_nc:name;\n> +#endif\n\nSince PTR_REG is defined only based on __LP64__ already why don't you just do:\n#ifdef __LP64__\n# define MOVL(n, name)                    \\\n    movz    x##n, #:abs_g3:name;        \\\n    movk    x##n, #:abs_g2_nc:name;        \\\n    movk    x##n, #:abs_g1_nc:name;        \\\n    movk    x##n, #:abs_g0_nc:name;\n#else\n# define MOVL(n, name)                    \\\n    movz    w##n, #:abs_g1:name;        \\\n    movk    w##n, #:abs_g0_nc:name;\n#endif\n\n\nThanks,\nAndrew\n\n> +\n>  /* Since C identifiers are not normally prefixed with an underscore\n>     on this system, the asm identifier `syscall_error' intrudes on the\n>     C name space.  Make sure we use an innocuous name.  */\n>\n>","headers":{"Return-Path":"<libc-alpha-return-84440-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84440-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"wkWYjXiF\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xrMZS6WJGz9rxm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 11 Sep 2017 19:09:52 +1000 (AEST)","(qmail 125697 invoked by alias); 11 Sep 2017 09:09:46 -0000","(qmail 125686 invoked by uid 89); 11 Sep 2017 09:09:45 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc:content-type; q=dns; s=default; b=sE9Z\n\tmyH/DnoZL71c776UhdDFnOPyr85SBhLD8/Zg8C3i+APxVCTwv7rbqHLZEtr2wr86\n\thW0v7Ayx38ZcueTcnEIXqcbUmAYVsTCIqHbXij/lDhze5xrjr2XSGUdAng8jwRam\n\tZeJO8UDTqxSQr4wxto1z673VVr5WYIshHuXLYH0=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc:content-type; s=default; bh=gR0d5Rjsrk\n\tfa9F9nSKKCG0VBysE=; b=wkWYjXiF0DUHyNNtaSkVBr6cnU0m06EwtT7vfpacFG\n\t/3pR1P+SpZqtpsfO/D4I0QXdKB6LD519CPESSVzn1giMwncT58dHzVx00pGvVOri\n\t/heGWRnXXd7J2HZN04B+S++XVPva2np2uhWPZahEVCiIttU55EACyPN3Wfwe/7dR\n\tQ=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-23.9 required=5.0 tests=AWL, BAYES_00,\n\tFREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2,\n\tGIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:Mon,\n\tH*RU:209.85.223.195, Hx-spam-relays-external:209.85.223.195","X-HELO":"mail-io0-f195.google.com","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=bK4d7B0AIBp4NLJu3bBc2D76IvD9TpVkP//ZzBPLOlc=;\n\tb=QfggblZkIMx39WxkJUBrgCf2WtFdRZVQdZ71sUyZ+MMMKV97d+BCeJkyMziQ4tridU\n\tHFr2juFkdoxzp2SbsjVuyyq3tVq6QwvFRJQvU8zIa7JX3j7U3ZTMMCSxaRxOLkngOqxq\n\t1Cn1K1SMjSmHGjHgFkZfbXiybLpVGY0l5l+9STd0DBG3phqRvpxaiLhso2kzqpJLk1iY\n\ticHMQYAaOJTBlBK0SgfpVN3ckCGh2T+UkkXd6mdrnb6lS8txWn7tHxMB7H3tx3ZZRT+M\n\tOIpqlMNufWXLs/SOoZW86/S5nPeFjO+L6DY9pKf47AxNCXniNK7a25oWVA8XfrSpI7Wu\n\tp41Q==","X-Gm-Message-State":"AHPjjUgGB/Y4Km4Jxgdpac8NFu5WH9h2yQGEdG5fBwNe1hRxvGGKiiwx\n\tZ6L4r3N9vyDMulHki+WmJwmSXmujaA==","X-Google-Smtp-Source":"AOwi7QCEiVdOb/EPDKarQFk1AS73ul+cx2N/5pGFJva8uAHRi6p7QBfwzwr07Cayy4b02bASATopPxof6qAv0Cje3HM=","X-Received":"by 10.202.235.80 with SMTP id j77mr11044481oih.220.1505120982066;\n\tMon, 11 Sep 2017 02:09:42 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<e65025af-5168-c999-bfc1-7ac614314836@huawei.com>","References":"<e65025af-5168-c999-bfc1-7ac614314836@huawei.com>","From":"Andrew Pinski <pinskia@gmail.com>","Date":"Mon, 11 Sep 2017 02:09:41 -0700","Message-ID":"<CA+=Sn1n7edmzjTSDatyY1tfi3Lz70m3XjeXfgKbgDt_GCZE2NQ@mail.gmail.com>","Subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools in\n\tstart.S","To":"wangboshi <wangboshi@huawei.com>","Cc":"GNU C Library <libc-alpha@sourceware.org>","Content-Type":"text/plain; charset=\"UTF-8\""}},{"id":1766151,"web_url":"http://patchwork.ozlabs.org/comment/1766151/","msgid":"<59B65347.503@arm.com>","list_archive_url":null,"date":"2017-09-11T09:11:35","subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools\n\tin start.S","submitter":{"id":65667,"url":"http://patchwork.ozlabs.org/api/people/65667/","name":"Szabolcs Nagy","email":"szabolcs.nagy@arm.com"},"content":"On 07/09/17 08:33, wangboshi wrote:\n> eXecute-Only Memory (XOM) is a protection mechanism against some ROP attacks. XOM sets the code as executable\n> and unreadable, so the access to any data, like literal pools, in the code section causes the fault with XOM.\n> The compiler can disable literal pools for C source files, but not for assembly files, so I use movz/movk\n> instead of literal pools in start.S for XOM.\n> \n> I add MOVL macro with movz/movk instructions like movl pseudo-instruction in armasm, and use the macro instead\n> of literal pools.\n> \n> \n> 2017-09-07  Wang Boshi  <wangboshi@huawei.com>\n> \n>     * sysdeps/aarch64/start.S: Use MOVL instead of literal pools.\n>     * sysdeps/aarch64/sysdep.h (MOVL): Add MOVL macro.\n> \n\nthanks, the patch looks good to me (except for a nit below),\ndo you have copyright assignment?\ndo you have commit rights to the glibc repo?\n\n> diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S\n> index df1c642..51e8e82 100644\n> --- a/sysdeps/aarch64/start.S\n> +++ b/sysdeps/aarch64/start.S\n> @@ -71,9 +71,9 @@ _start:\n>      ldr     PTR_REG (4), [x4, #:got_lo12:__libc_csu_fini]\n>  #else\n>      /* Set up the other arguments in registers */\n> -    ldr    PTR_REG (0), =main\n> -    ldr    PTR_REG (3), =__libc_csu_init\n> -    ldr    PTR_REG (4), =__libc_csu_fini\n> +    MOVL(0, main)\n> +    MOVL(3, __libc_csu_init)\n> +    MOVL(4, __libc_csu_fini)\n>  #endif\n> \n>      /* __libc_start_main (main, argc, argv, init, fini, rtld_fini,\n> diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h\n> index a749a70..0a11b57 100644\n> --- a/sysdeps/aarch64/sysdep.h\n> +++ b/sysdeps/aarch64/sysdep.h\n> @@ -137,6 +137,20 @@\n>      ldr    PTR_REG (T), [x##T, #:got_lo12:EXPR];    \\\n>      OP    PTR_REG (R), [x##T];\n> \n> +/* Load an immediate into R.\n> +   Note R is a register number and not a register name. */\n\neither rename the macro argument to R or use N in the comment.\n\n> +#ifdef __LP64__\n> +# define MOVL(n, name)                    \\\n> +    movz    PTR_REG(n), #:abs_g3:name;        \\\n> +    movk    PTR_REG(n), #:abs_g2_nc:name;        \\\n> +    movk    PTR_REG(n), #:abs_g1_nc:name;        \\\n> +    movk    PTR_REG(n), #:abs_g0_nc:name;\n> +#else\n> +# define MOVL(n, name)                    \\\n> +    movz    PTR_REG(n), #:abs_g1:name;        \\\n> +    movk    PTR_REG(n), #:abs_g0_nc:name;\n> +#endif\n> +\n>  /* Since C identifiers are not normally prefixed with an underscore\n>     on this system, the asm identifier `syscall_error' intrudes on the\n>     C name space.  Make sure we use an innocuous name.  */\n> \n>","headers":{"Return-Path":"<libc-alpha-return-84441-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84441-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"UnsuQat8\"; dkim-atps=neutral","sourceware.org; auth=none","spf=none (sender IP is )\n\tsmtp.mailfrom=Szabolcs.Nagy@arm.com; "],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xrMcw45tvz9s7G\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 11 Sep 2017 19:11:59 +1000 (AEST)","(qmail 128323 invoked by alias); 11 Sep 2017 09:11:53 -0000","(qmail 128309 invoked by uid 89); 11 Sep 2017 09:11:51 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:message-id:date:from:mime-version:to:cc\n\t:subject:references:in-reply-to:content-type\n\t:content-transfer-encoding; q=dns; s=default; b=hjS3/U50jeysxeSb\n\tMZSulQneDdj15JdNviRDDiwIqPoMR4v+fzb1rxzhgbxxUz7qIu6R/zJ+iWLZfFGK\n\t56DytC/v4bR5rb6yu/t/gfmfZDn+acEomOpGj+/eiuzeSLR3zXt2e0Ac/KX51rbI\n\tkSm1jvcZum/sJScJt/GfkQD2ccc=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:message-id:date:from:mime-version:to:cc\n\t:subject:references:in-reply-to:content-type\n\t:content-transfer-encoding; s=default; bh=1AY6tZdhk3Vx4nVAg5V4RY\n\t3h3zI=; b=UnsuQat8nb3lFPi0Xhw9CufPjcRbQAHZWQrbo5qJgal90Cr0QmG3FJ\n\tnHvS1S7FAMRELL/t72I7+OYiqxYgunrL1HXA6UIIk+bHqFqwrbPy89y9+MYG9L6y\n\t0hcNsJnFeYS9LCcxiyjfkv335hudmhD3wd5cQZKdj8iWGgiEWta5g=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-24.6 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,\n\tRCVD_IN_DNSWL_NONE, SPF_HELO_PASS,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=","X-HELO":"EUR01-HE1-obe.outbound.protection.outlook.com","Message-ID":"<59B65347.503@arm.com>","Date":"Mon, 11 Sep 2017 10:11:35 +0100","From":"Szabolcs Nagy <szabolcs.nagy@arm.com>","User-Agent":"Mozilla/5.0 (X11; Linux x86_64;\n\trv:31.0) Gecko/20100101 Thunderbird/31.8.0","MIME-Version":"1.0","To":"wangboshi <wangboshi@huawei.com>, libc-alpha@sourceware.org","CC":"nd@arm.com","Subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools\n\tin start.S","References":"<e65025af-5168-c999-bfc1-7ac614314836@huawei.com>","In-Reply-To":"<e65025af-5168-c999-bfc1-7ac614314836@huawei.com>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"7bit","X-ClientProxiedBy":"HE1PR0301CA0015.eurprd03.prod.outlook.com\n\t(2603:10a6:3:76::25) To VI1PR0802MB2494.eurprd08.prod.outlook.com\n\t(2603:10a6:800:b6::22)","X-MS-PublicTrafficType":"Email","X-MS-Office365-Filtering-Correlation-Id":"278f5d48-5642-45eb-617c-08d4f8f51d3b","X-MS-Office365-Filtering-HT":"Tenant","X-Microsoft-Antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:VI1PR0802MB2494; ","X-Microsoft-Exchange-Diagnostics":["1; VI1PR0802MB2494;\n\t3:ctxc2FWbzvNlZieemIKjWGrZYWX4us4WTa+6A92hyq6KLibR70RYGWbx5M2rA+W7/TVMcmvKalWF5g/P5s4Dz5XNGUEE2vhS4pT+Ta+G6v0qgIZSyZXRR/jIh9HcjUKl+oUmcFsBQQ5UYk4UOj6LnDytt/wqAY8NWl70oAYH6/z1wr+v9nU+1TDPEZpJYADHUTB7docsO1G8kA1L3X9hdKt01B7pDKpX3tjDuVycTPayMlaOZSVma6/4hsl7xgtf;\n\t25:6OqqPcsrDSmyvlVPT1ZkIfStAa/dTI8mL85faZzog+YxiTGh/5VC1C7zWbdoZmAvclDYfa+q/t0U2hZkqsSnEZTynpwfIsN82SKXfH5lxZXDhm1t8PDQ/3InPl6pGU0onTMhSgZk3D/UkY1yKHudQgOX/OjhZBqir9lz8lzuo7OWCfr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XOx14VZqEyA==;\n\t24:lMkhNC3F3BZTXwuqaEgN6HJtQJYStgD7gYwoC2479/XOl8q46atbWclIZ+OhdtjpmqutXrN9fRDYVQbh2d+mbvtPqcd3c68lMhO+7P6LJmw=;\n\t7:4JqMKTb9jBRbm8b6m2bMKluLSNJ7gPRiYufpfywlqWWHZgVmdFH/XdWuHkx1bKscvFuyzUN3olxyma4acuxJDRLEZqe419seVtiAiDy3DvnN5erGLbWFhcXntJD+4NUNbl4c8puObR3sLzEAvybiDwPjAStAqEIJ8tq/03ZxF0X2ryjtYMqkuyhHu/zm4MDsd5Jg7ja1QJFvSmjf/N23lHBwYZoqfsdgIqk+6fy7U7k="],"X-MS-TrafficTypeDiagnostic":"VI1PR0802MB2494:","NoDisclaimer":"True","X-Exchange-Antispam-Report-Test":"UriScan:(50582790962513);","X-Microsoft-Antispam-PRVS":"<VI1PR0802MB2494173B7E0A88696B271CCAED680@VI1PR0802MB2494.eurprd08.prod.outlook.com>","X-Exchange-Antispam-Report-CFA-Test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123560025)(20161123558100)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:VI1PR0802MB2494; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:VI1PR0802MB2494; ","X-Forefront-PRVS":"04270EF89C","X-Forefront-Antispam-Report":"SFV:NSPM;\n\tSFS:(10009020)(7370300001)(4630300001)(6049001)(6009001)(39860400002)(24454002)(199003)(189002)(377424004)(64126003)(33656002)(4001350100001)(50466002)(6246003)(101416001)(230700001)(2950100002)(97736004)(7350300001)(6486002)(77096006)(229853002)(110136004)(2906002)(53936002)(478600001)(72206003)(53546010)(83506001)(6666003)(36756003)(305945005)(189998001)(3846002)(6116002)(65816999)(50986999)(5660300001)(81166006)(42186005)(81156014)(76176999)(54356999)(105586002)(106356001)(7736002)(23676002)(47776003)(68736007)(65806001)(65956001)(66066001)(4326008)(86362001)(8676002)(25786009);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0802MB2494;\n\tH:[10.2.206.69]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1;\n\tLANG:en; ","Received-SPF":"None (protection.outlook.com: arm.com does not designate\n\tpermitted sender hosts)","SpamDiagnosticOutput":"1:99","SpamDiagnosticMetadata":"NSPM","X-OriginatorOrg":"arm.com","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"11 Sep 2017 09:11:39.9064\n\t(UTC)","X-MS-Exchange-CrossTenant-FromEntityHeader":"Hosted","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"VI1PR0802MB2494"}},{"id":1766163,"web_url":"http://patchwork.ozlabs.org/comment/1766163/","msgid":"<59B65662.3080106@arm.com>","list_archive_url":null,"date":"2017-09-11T09:24:50","subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools\n\tin start.S","submitter":{"id":65667,"url":"http://patchwork.ozlabs.org/api/people/65667/","name":"Szabolcs Nagy","email":"szabolcs.nagy@arm.com"},"content":"On 11/09/17 10:09, Andrew Pinski wrote:\n> On Thu, Sep 7, 2017 at 12:33 AM, wangboshi <wangboshi@huawei.com> wrote:\n>> eXecute-Only Memory (XOM) is a protection mechanism against some ROP\n>> attacks. XOM sets the code as executable and unreadable, so the access to\n>> any data, like literal pools, in the code section causes the fault with XOM.\n>> The compiler can disable literal pools for C source files, but not for\n>> assembly files, so I use movz/movk instead of literal pools in start.S for\n>> XOM.\n>>\n>> I add MOVL macro with movz/movk instructions like movl pseudo-instruction in\n>> armasm, and use the macro instead of literal pools.\n> \n> I have a few comments about the overall design:\n> I don't know if this is a good idea, can the kernel override XOM anyways?\n> That is if you do write(N, &main, 1024);\n> That will write the main function out to the file?\n\ni think the change makes sense even without xom, maybe\na better rationale is needed in the commit message.\n\n(i don't know what the kernel does with the write, with\na non-readable page i'd expect the write to fail just\nlike on PROT_NONE pages: EFAULT).\n\n>> +/* Load an immediate into R.\n>> +   Note R is a register number and not a register name. */\n>> +#ifdef __LP64__\n>> +# define MOVL(n, name)                    \\\n>> +    movz    PTR_REG(n), #:abs_g3:name;        \\\n>> +    movk    PTR_REG(n), #:abs_g2_nc:name;        \\\n>> +    movk    PTR_REG(n), #:abs_g1_nc:name;        \\\n>> +    movk    PTR_REG(n), #:abs_g0_nc:name;\n>> +#else\n>> +# define MOVL(n, name)                    \\\n>> +    movz    PTR_REG(n), #:abs_g1:name;        \\\n>> +    movk    PTR_REG(n), #:abs_g0_nc:name;\n>> +#endif\n> \n> Since PTR_REG is defined only based on __LP64__ already why don't you just do:\n\ni think either is fine (the meaning of PTR_REG should\nbe obvious since it is used all over the place)\n\n> #ifdef __LP64__\n> # define MOVL(n, name)                    \\\n>     movz    x##n, #:abs_g3:name;        \\\n>     movk    x##n, #:abs_g2_nc:name;        \\\n>     movk    x##n, #:abs_g1_nc:name;        \\\n>     movk    x##n, #:abs_g0_nc:name;\n> #else\n> # define MOVL(n, name)                    \\\n>     movz    w##n, #:abs_g1:name;        \\\n>     movk    w##n, #:abs_g0_nc:name;\n> #endif","headers":{"Return-Path":"<libc-alpha-return-84442-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84442-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"T8rrkGf0\"; dkim-atps=neutral","sourceware.org; auth=none","spf=none (sender IP is )\n\tsmtp.mailfrom=Szabolcs.Nagy@arm.com; "],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xrMw10tQHz9s75\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 11 Sep 2017 19:25:04 +1000 (AEST)","(qmail 84211 invoked by alias); 11 Sep 2017 09:24:59 -0000","(qmail 83759 invoked by uid 89); 11 Sep 2017 09:24:59 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:message-id:date:from:mime-version:to:cc\n\t:subject:references:in-reply-to:content-type\n\t:content-transfer-encoding; q=dns; s=default; b=TJ9K/V0clbSXeezx\n\txrRs6DewTRklw9gDeEgPwN5sR8/6kxcbwWJr3bTW9MeE/+CeCAhoUkn2S3XJoZ5Q\n\tZRwrG0ptxeJNuu1JsmQ/Be5NRotlanvlAFZzyonBRc9EennuHFeziVzIofZQr3xA\n\t95UMw9Q4EfvQ07bS3ny4w1vWt/w=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:message-id:date:from:mime-version:to:cc\n\t:subject:references:in-reply-to:content-type\n\t:content-transfer-encoding; s=default; bh=xnqglcvOq7nco+GhOL2Tir\n\tbfuHw=; b=T8rrkGf0y8hqMoI6zsvoGrifDlpqnVYfzywewpKv8CaR14GoEJcps4\n\tiVE1G4iPHltR90QZ83vv1rMDDTWG5mIXvZ3AOKbUnoM3m3bgE4HfLF4IzuLZV7B4\n\trySOJYZLItUs9TGdhfwWTILHJpd7Tt+/PezkXl45AtisUvb1bu57Y=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-0.3 required=5.0 tests=AWL, BAYES_00,\n\tRCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS,\n\tUNSUBSCRIBE_BODY autolearn=no version=3.3.2 spammy=H*r:sk:mail-ve,\n\tHx-languages-length:2096, H*r:104.47.1","X-HELO":"EUR01-VE1-obe.outbound.protection.outlook.com","Message-ID":"<59B65662.3080106@arm.com>","Date":"Mon, 11 Sep 2017 10:24:50 +0100","From":"Szabolcs Nagy <szabolcs.nagy@arm.com>","User-Agent":"Mozilla/5.0 (X11; Linux x86_64;\n\trv:31.0) Gecko/20100101 Thunderbird/31.8.0","MIME-Version":"1.0","To":"Andrew Pinski <pinskia@gmail.com>, wangboshi <wangboshi@huawei.com>","CC":"nd@arm.com, GNU C Library <libc-alpha@sourceware.org>","Subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools\n\tin start.S","References":"<e65025af-5168-c999-bfc1-7ac614314836@huawei.com>\n\t<CA+=Sn1n7edmzjTSDatyY1tfi3Lz70m3XjeXfgKbgDt_GCZE2NQ@mail.gmail.com>","In-Reply-To":"<CA+=Sn1n7edmzjTSDatyY1tfi3Lz70m3XjeXfgKbgDt_GCZE2NQ@mail.gmail.com>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"7bit","X-ClientProxiedBy":"VI1PR09CA0043.eurprd09.prod.outlook.com\n\t(2603:10a6:802:28::11) To AM5PR0802MB2481.eurprd08.prod.outlook.com\n\t(2603:10a6:203:97::23)","X-MS-PublicTrafficType":"Email","X-MS-Office365-Filtering-Correlation-Id":"7da52344-fe8a-4760-bc95-08d4f8f6f639","X-MS-Office365-Filtering-HT":"Tenant","X-Microsoft-Antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:AM5PR0802MB2481; ","X-Microsoft-Exchange-Diagnostics":["1; AM5PR0802MB2481;\n\t3:HdzK5eQfXeoTdBC6Bpf4je6saRzSoQJXxwpw5gpeDeiyFEsrV/AZHVDtVCWxCsrmbjzG/Q554T2ZSv6V9jYqo3iQyojeEaom4Q/9Eqkij3V5zDbCjeHBr7m1cH0srpYX+rt4SeXGWIPbn/5NChBDLlcL/EklyCtWfK4VN1096OrDs2HMiNqUqVrykK7Bvjseijggk9m+oj3A0fndP9+I7gYhcew3e/gZ90I5NKnZ5K4pLdTvdzjh8iMOUwekrD2c;\n\t25:XUQRu9iIaeAzCUsP0kOcpw/xfh7OluAqtF2cm002yz2WkhQdIMTWoCJtW/afWuFghq6mBOsq6TagcD1Ia5KtY4ytINZRcGj75bTMU5plYeCtWkwKb1Svv9zjhsdwrP0b+0FUzWUSvnKL0Nk5MBB3z2M4/RoG/nZv+Em0CXn1l+5A8ocCa0lNPYRt7MyRlkVYJPsMHoihXRd5DX1/Mrn/qglU/RJ7+asFJl3jRsTtA8T+Dd/NKnCPfHyNGMWATkoxIiH4ZEw2peoH26EElQogEQdgNUBlDTQU02Tu5WfdgQ2s3XbGX0SP9PDjAe2wNXOZm2I4Te5JIixvyaydJ80SDQ==;\n\t31:4CKPlVVMcxti7RVdPoCnGP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H2KsXpCAtmdtANi1KWv92JKc7UI33b3ePp8dXp/DBon4x7OpEiIJYINjukNM1TXfo1lf/kvORA3iI7asXIhESRbBXQCaSmR/vmstzNa15Nz/Jdr6kTZKLHkAp0cnEeKAmrIivHiN5tj1gvfH0Gwb0pwrr2SHxCh8C4HQChEriN1hxMmryRA8BvVeeHSOZtMEg="],"X-MS-TrafficTypeDiagnostic":"AM5PR0802MB2481:","NoDisclaimer":"True","X-Exchange-Antispam-Report-Test":"UriScan:(50582790962513);","X-Microsoft-Antispam-PRVS":"<AM5PR0802MB248174E481634B1407143396ED680@AM5PR0802MB2481.eurprd08.prod.outlook.com>","X-Exchange-Antispam-Report-CFA-Test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:AM5PR0802MB2481; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:AM5PR0802MB2481; ","X-Forefront-PRVS":"04270EF89C","X-Forefront-Antispam-Report":"SFV:NSPM;\n\tSFS:(10009020)(4630300001)(7370300001)(6009001)(6049001)(39860400002)(199003)(189002)(377454003)(24454002)(65806001)(66066001)(65956001)(42186005)(72206003)(8676002)(478600001)(65816999)(47776003)(6116002)(5660300001)(87266999)(3846002)(81166006)(81156014)(106356001)(4326008)(101416001)(2906002)(189998001)(4001350100001)(76176999)(54356999)(50986999)(83506001)(50466002)(64126003)(7736002)(305945005)(97736004)(53936002)(53546010)(33656002)(80316001)(25786009)(6486002)(86362001)(6246003)(77096006)(2950100002)(68736007)(23676002)(105586002)(229853002)(59896002)(7350300001)(230700001)(36756003);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2481;\n\tH:[10.2.206.69]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1;\n\tLANG:en; ","Received-SPF":"None (protection.outlook.com: arm.com does not designate\n\tpermitted sender hosts)","SpamDiagnosticOutput":"1:99","SpamDiagnosticMetadata":"NSPM","X-OriginatorOrg":"arm.com","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"11 Sep 2017 09:24:53.7548\n\t(UTC)","X-MS-Exchange-CrossTenant-FromEntityHeader":"Hosted","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"AM5PR0802MB2481"}},{"id":1766778,"web_url":"http://patchwork.ozlabs.org/comment/1766778/","msgid":"<68118bc5-fd76-1fd1-b6cf-e9d2c82e8537@huawei.com>","list_archive_url":null,"date":"2017-09-12T08:54:02","subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools in\n\tstart.S","submitter":{"id":72313,"url":"http://patchwork.ozlabs.org/api/people/72313/","name":"Boshi Wang","email":"wangboshi@huawei.com"},"content":"On 2017/9/11 17:09, Andrew Pinski wrote:\n> On Thu, Sep 7, 2017 at 12:33 AM, wangboshi <wangboshi@huawei.com> wrote:\n>> eXecute-Only Memory (XOM) is a protection mechanism against some ROP\n>> attacks. XOM sets the code as executable and unreadable, so the access to\n>> any data, like literal pools, in the code section causes the fault with XOM.\n>> The compiler can disable literal pools for C source files, but not for\n>> assembly files, so I use movz/movk instead of literal pools in start.S for\n>> XOM.\n>>\n>> I add MOVL macro with movz/movk instructions like movl pseudo-instruction in\n>> armasm, and use the macro instead of literal pools.\n> I have a few comments about the overall design:\n> I don't know if this is a good idea, can the kernel override XOM anyways?\n> That is if you do write(N, &main, 1024);\n> That will write the main function out to the file?\nThank you for your comments. They alert me.\nKernels for different architectures own different behaviors because XOM depends on different hardware features in different architectures. All of kernels don't check the buffer directly. In x64 with mpk, the hardware will stop read operation from the buffer because of XOM, but the write only returns a failure and the program still runs. The current kernel for AArch64 overrides XOM. The example works in AArch64, and doesn't work in X64.\nYour example shows the weakness, but I think that it's not easy to exploit that with some existing protection mechanisms, like W^X and ASLR, and itself of XOM. So XOM is still valuable. Of course, I will try to fix the problem.\nThank you.\n>\n> I have one comment about the implementation too.\n>\n>>\n>> 2017-09-07  Wang Boshi  <wangboshi@huawei.com>\n>>\n>>      * sysdeps/aarch64/start.S: Use MOVL instead of literal pools.\n>>      * sysdeps/aarch64/sysdep.h (MOVL): Add MOVL macro.\n>>\n>> diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S\n>> index df1c642..51e8e82 100644\n>> --- a/sysdeps/aarch64/start.S\n>> +++ b/sysdeps/aarch64/start.S\n>> @@ -71,9 +71,9 @@ _start:\n>>       ldr     PTR_REG (4), [x4, #:got_lo12:__libc_csu_fini]\n>>   #else\n>>       /* Set up the other arguments in registers */\n>> -    ldr    PTR_REG (0), =main\n>> -    ldr    PTR_REG (3), =__libc_csu_init\n>> -    ldr    PTR_REG (4), =__libc_csu_fini\n>> +    MOVL(0, main)\n>> +    MOVL(3, __libc_csu_init)\n>> +    MOVL(4, __libc_csu_fini)\n>>   #endif\n>>\n>>       /* __libc_start_main (main, argc, argv, init, fini, rtld_fini,\n>> diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h\n>> index a749a70..0a11b57 100644\n>> --- a/sysdeps/aarch64/sysdep.h\n>> +++ b/sysdeps/aarch64/sysdep.h\n>> @@ -137,6 +137,20 @@\n>>       ldr    PTR_REG (T), [x##T, #:got_lo12:EXPR];    \\\n>>       OP    PTR_REG (R), [x##T];\n>>\n>> +/* Load an immediate into R.\n>> +   Note R is a register number and not a register name. */\n>> +#ifdef __LP64__\n>> +# define MOVL(n, name)                    \\\n>> +    movz    PTR_REG(n), #:abs_g3:name;        \\\n>> +    movk    PTR_REG(n), #:abs_g2_nc:name;        \\\n>> +    movk    PTR_REG(n), #:abs_g1_nc:name;        \\\n>> +    movk    PTR_REG(n), #:abs_g0_nc:name;\n>> +#else\n>> +# define MOVL(n, name)                    \\\n>> +    movz    PTR_REG(n), #:abs_g1:name;        \\\n>> +    movk    PTR_REG(n), #:abs_g0_nc:name;\n>> +#endif\n> Since PTR_REG is defined only based on __LP64__ already why don't you just do:\n> #ifdef __LP64__\n> # define MOVL(n, name)                    \\\n>      movz    x##n, #:abs_g3:name;        \\\n>      movk    x##n, #:abs_g2_nc:name;        \\\n>      movk    x##n, #:abs_g1_nc:name;        \\\n>      movk    x##n, #:abs_g0_nc:name;\n> #else\n> # define MOVL(n, name)                    \\\n>      movz    w##n, #:abs_g1:name;        \\\n>      movk    w##n, #:abs_g0_nc:name;\n> #endif\nI think PTR_REG is more meaningful.\nThanks.\n>\n> Thanks,\n> Andrew\n>\n>> +\n>>   /* Since C identifiers are not normally prefixed with an underscore\n>>      on this system, the asm identifier `syscall_error' intrudes on the\n>>      C name space.  Make sure we use an innocuous name.  */\n>>\n>>","headers":{"Return-Path":"<libc-alpha-return-84478-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84478-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"XY7VxtuP\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xrzBh5Tylz9s81\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 18:54:52 +1000 (AEST)","(qmail 39492 invoked by alias); 12 Sep 2017 08:54:46 -0000","(qmail 39482 invoked by uid 89); 12 Sep 2017 08:54:45 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:subject:to:references:cc:from:message-id:date\n\t:mime-version:in-reply-to:content-type\n\t:content-transfer-encoding; q=dns; s=default; b=OoGRsAhxwD3thB08\n\tzE2vLXeaRguheZ5FavyhlPLQt+JI5ek6PacA89t+zMTYhLhWiBQRH7xOhsFUJjVI\n\tOcal9m6P93VDyo8qcd5J0Tr1NPmPINPiJaYYs9+H+I9XcnO4C5y39HeYZu3jRpbE\n\tSiy/fwozBwztMh5QZ9So41CrRGg=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:subject:to:references:cc:from:message-id:date\n\t:mime-version:in-reply-to:content-type\n\t:content-transfer-encoding; s=default; bh=fD8uPCa//pAN1tqVO05Y++\n\tGU6bw=; b=XY7VxtuPlB23C4xwTq3eyXG77d7y1LxyvieqPKKGQprSnNBzWPj676\n\ttulH2JL13BWi7KM8N8c0fw77y1hiQaxYgOYAoHss20P/g5sNGAl5NF4gfwIGqW2u\n\tY19i11xiZFnQSQxGrdUWm4Y4fuXiun5db2FYtHXHm33G698yRTjjs=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-24.5 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,\n\tRP_MATCHES_RCVD,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=behaviors,\n\tH*r:0800","X-HELO":"szxga05-in.huawei.com","Subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools in\n\tstart.S","To":"Andrew Pinski <pinskia@gmail.com>","References":"<e65025af-5168-c999-bfc1-7ac614314836@huawei.com>\n\t<CA+=Sn1n7edmzjTSDatyY1tfi3Lz70m3XjeXfgKbgDt_GCZE2NQ@mail.gmail.com>","CC":"<libc-alpha@sourceware.org>, Szabolcs Nagy <szabolcs.nagy@arm.com>","From":"Boshi Wang <wangboshi@huawei.com>","Message-ID":"<68118bc5-fd76-1fd1-b6cf-e9d2c82e8537@huawei.com>","Date":"Tue, 12 Sep 2017 16:54:02 +0800","User-Agent":"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<CA+=Sn1n7edmzjTSDatyY1tfi3Lz70m3XjeXfgKbgDt_GCZE2NQ@mail.gmail.com>","Content-Type":"text/plain; charset=\"utf-8\"; format=flowed","Content-Transfer-Encoding":"7bit","X-CFilter-Loop":"Reflected","X-Mirapoint-Virus-RAPID-Raw":"score=unknown(0),\n\trefid=str=0001.0A020206.59B7A0B2.00C5, ss=1, re=0.000, recu=0.000,\n\treip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0,\n\tso=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32","X-Mirapoint-Loop-Id":"6d7fb7cd7b1085b78b793ad790ef19f0"}},{"id":1768418,"web_url":"http://patchwork.ozlabs.org/comment/1768418/","msgid":"<59BA3F64.60504@arm.com>","list_archive_url":null,"date":"2017-09-14T08:35:48","subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools\n\tin start.S","submitter":{"id":65667,"url":"http://patchwork.ozlabs.org/api/people/65667/","name":"Szabolcs Nagy","email":"szabolcs.nagy@arm.com"},"content":"On 14/09/17 04:21, Boshi Wang wrote:\n> On 2017/9/11 17:11, Szabolcs Nagy wrote:\n>> On 07/09/17 08:33, wangboshi wrote:\n>>> 2017-09-07  Wang Boshi  <wangboshi@huawei.com>\n>>>\n>>>      * sysdeps/aarch64/start.S: Use MOVL instead of literal pools.\n>>>      * sysdeps/aarch64/sysdep.h (MOVL): Add MOVL macro.\n>>>\n>> thanks, the patch looks good to me (except for a nit below),\n>> do you have copyright assignment?\n>> do you have commit rights to the glibc repo?\n> \n> I have read requirements of copyright assignment. I don't have that.\n> \n> I don't have commit rights, too.\n> \n> So how can I contribute the change? Could you give me some suggestions?\n> \n\ni think your change is just below the legally-significant limit\nhttps://www.gnu.org/prep/maintain/maintain.html#Legally-Significant\nso i can commit it for you.\n\nbut getting your employer to sort it out with the fsf would be better,\nin case you run into further issues that need glibc fixes.","headers":{"Return-Path":"<libc-alpha-return-84594-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84594-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"nyq6ew3k\"; dkim-atps=neutral","sourceware.org; auth=none","spf=none (sender IP is )\n\tsmtp.mailfrom=Szabolcs.Nagy@arm.com; "],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtBh466Qhz9sMN\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 18:36:04 +1000 (AEST)","(qmail 97837 invoked by alias); 14 Sep 2017 08:35:57 -0000","(qmail 97820 invoked by uid 89); 14 Sep 2017 08:35:56 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:message-id:date:from:mime-version:to:cc\n\t:subject:references:in-reply-to:content-type\n\t:content-transfer-encoding; q=dns; s=default; b=OO0cvirYPx+CucVJ\n\tSwGqUuZV86AJqr692fTn35L0cyjElsZlFntU8kRLEUOQbkc0jvU0rFbFl2ro2sLC\n\tWHILMTfRXX/32w2W0BqvIkef2IpBWzCPozKBS4+MG/gsanWNYJO+kh60jXcXL0jh\n\t8bKjSSFLwEN8n2wbjUYxXJiMbt4=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:message-id:date:from:mime-version:to:cc\n\t:subject:references:in-reply-to:content-type\n\t:content-transfer-encoding; s=default; bh=sRm+fCSrxPfP/rYJ72I6Ps\n\tv3oMg=; b=nyq6ew3kkbL8Ei45swvI/086stgPOvTmKGDhHqmRwVhGTOuN6l6bhi\n\tDT7MXyRDfkLjOK8jXUKwSATVghuZqsGAHF47ghw91yk8+wrhHuwZrQzzvcVx9drd\n\tP0SiqW8xixJ/KvI8ffkYgVqgyUjQpDCscltIwY/gg+3/uBDTEiGFE=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-2.1 required=5.0 tests=AWL, BAYES_00,\n\tRCVD_IN_DNSWL_NONE, SPF_HELO_PASS,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=rights","X-HELO":"EUR02-HE1-obe.outbound.protection.outlook.com","Message-ID":"<59BA3F64.60504@arm.com>","Date":"Thu, 14 Sep 2017 09:35:48 +0100","From":"Szabolcs Nagy <szabolcs.nagy@arm.com>","User-Agent":"Mozilla/5.0 (X11; Linux x86_64;\n\trv:31.0) Gecko/20100101 Thunderbird/31.8.0","MIME-Version":"1.0","To":"Boshi Wang <wangboshi@huawei.com>","CC":"nd@arm.com, GNU C Library <libc-alpha@sourceware.org>","Subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools\n\tin start.S","References":"<e65025af-5168-c999-bfc1-7ac614314836@huawei.com>\n\t<59B65347.503@arm.com>\n\t<336560e5-c9de-08bc-c850-28994cac2c33@huawei.com>","In-Reply-To":"<336560e5-c9de-08bc-c850-28994cac2c33@huawei.com>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"7bit","X-ClientProxiedBy":"DB6PR0202CA0048.eurprd02.prod.outlook.com\n\t(2603:10a6:4:a5::34) To AM5PR0802MB2484.eurprd08.prod.outlook.com\n\t(2603:10a6:203:9b::23)","X-MS-PublicTrafficType":"Email","X-MS-Office365-Filtering-Correlation-Id":"1d880c8d-2ce0-4789-0c6e-08d4fb4b9b20","X-MS-Office365-Filtering-HT":"Tenant","X-Microsoft-Antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:AM5PR0802MB2484; ","X-Microsoft-Exchange-Diagnostics":["1; AM5PR0802MB2484;\n\t3:3lCk4BgPAhauPSef9PiMfRJy/y/f6x5PnmahaN4ySHJwxr5ASVgCeRKPr5K21v9tBN+LiiRhWlhCQuiGffIGF6zXvAJnv4JZGzIuJTvXedxZaca9kQCyZtUofd3aSk90enhnSHQ3QhRBzqMqfOM0NlEyj65vi62xRWVmIZDX9lezFsArGMl5J+j3F+sTZhIam30o0U2k4xaLstlf45NhKS1ytXr8v7pHhfGp/ETRRUWcCBkShWrCqlOvHLP+0noP;\n\t25:EyhrbrF2aEfQ6IQhTO1AcrRtjSufBwjtgo1oyhXvJftf3eqo8LCOIFs4C1S2pkfVBp57spOezdcKIrShSq3crDT9S1UR3HYn7u9ztAgxHZW0SEnW89SFxK5BlxG/8ljvya7DbvJ6yebhaKIDmFmlQ9Y6N8cpQ/XpQ9HCkguc2s+zID3S8zXy0FUcUZ8vNv2NsxKvjuzAhPUXQq2pKDPsjz9YH8I7ruvTHzLKy79AVyPj4oxUA5oOQUERAq+mGkz3065YQaJpfmvafStBYA2eY07q8vki0tnmcFqKxKWe79ymmd2knO2RXi5DiCOYaOiuFOUcNgAtKMkthRJmua/UUw==;\n\t31:vWwQG06ixMxvAItVItiFTP/pEj2if5aMCvQaWI53oepgo8TcPBpm0X/zbjrmA0UjwkH2PCNTJjJHoywreBX3pNd8Cj34EwM3i1f9AEomyeZoJbyX1BaIiHhb69ISEXHkD9Ad9vd/rkVfgHy7Tb1JYgG1Ced5/JPPzTedJBSt3eBUxD9rTuc6ct5MJlck+gaUh5guIZkTFN91f7o+t70600q7NJnzEE3X9X7a4Ah8qO0=","1; AM5PR0802MB2484;\n\t20:1epHJ6ICIVlXpYn7Hd5LQT+s0bvY2BOYcwZaaJo/EhscTu8LvgU38chaaUIS3s/KAflZ8xN6jeMdF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TypeDiagnostic":"AM5PR0802MB2484:","NoDisclaimer":"True","X-Exchange-Antispam-Report-Test":"UriScan:(250305191791016)(22074186197030)(50582790962513); ","X-Microsoft-Antispam-PRVS":"<AM5PR0802MB2484A4F0CD80FAA40171AF85ED6F0@AM5PR0802MB2484.eurprd08.prod.outlook.com>","X-Exchange-Antispam-Report-CFA-Test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123558100)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:AM5PR0802MB2484; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:AM5PR0802MB2484; ","X-Forefront-PRVS":"0430FA5CB7","X-Forefront-Antispam-Report":"SFV:NSPM;\n\tSFS:(10009020)(7370300001)(4630300001)(6049001)(6009001)(346002)(376002)(189002)(377424004)(199003)(24454002)(316002)(72206003)(4001350100001)(86362001)(16576012)(68736007)(6306002)(97736004)(23676002)(305945005)(53936002)(16526017)(105586002)(8676002)(36756003)(110136004)(83506001)(6246003)(5660300001)(81166006)(230700001)(7736002)(6916009)(65806001)(66066001)(2950100002)(65956001)(81156014)(47776003)(2906002)(101416001)(229853002)(25786009)(76176999)(33656002)(65816999)(6486002)(50986999)(53546010)(54356999)(77096006)(7350300001)(966005)(106356001)(478600001)(4326008)(3846002)(189998001)(64126003)(6116002)(50466002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2484;\n\tH:[10.2.206.69]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1;\n\tLANG:en; ","Received-SPF":"None (protection.outlook.com: arm.com does not designate\n\tpermitted sender hosts)","SpamDiagnosticOutput":"1:99","SpamDiagnosticMetadata":"NSPM","X-OriginatorOrg":"arm.com","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"14 Sep 2017 08:35:50.6801\n\t(UTC)","X-MS-Exchange-CrossTenant-FromEntityHeader":"Hosted","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"AM5PR0802MB2484"}},{"id":1768910,"web_url":"http://patchwork.ozlabs.org/comment/1768910/","msgid":"<2112d1ae-98b2-f555-99ed-99d1d24ac4da@huawei.com>","list_archive_url":null,"date":"2017-09-15T01:16:02","subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools in\n\tstart.S","submitter":{"id":72313,"url":"http://patchwork.ozlabs.org/api/people/72313/","name":"Boshi Wang","email":"wangboshi@huawei.com"},"content":"On 2017/9/14 16:35, Szabolcs Nagy wrote:\n> On 14/09/17 04:21, Boshi Wang wrote:\n>> On 2017/9/11 17:11, Szabolcs Nagy wrote:\n>>> On 07/09/17 08:33, wangboshi wrote:\n>>>> 2017-09-07  Wang Boshi  <wangboshi@huawei.com>\n>>>>\n>>>>       * sysdeps/aarch64/start.S: Use MOVL instead of literal pools.\n>>>>       * sysdeps/aarch64/sysdep.h (MOVL): Add MOVL macro.\n>>>>\n>>> thanks, the patch looks good to me (except for a nit below),\n>>> do you have copyright assignment?\n>>> do you have commit rights to the glibc repo?\n>> I have read requirements of copyright assignment. I don't have that.\n>>\n>> I don't have commit rights, too.\n>>\n>> So how can I contribute the change? Could you give me some suggestions?\n>>\n> i think your change is just below the legally-significant limit\n> https://www.gnu.org/prep/maintain/maintain.html#Legally-Significant\n> so i can commit it for you.\n>\n> but getting your employer to sort it out with the fsf would be better,\n> in case you run into further issues that need glibc fixes.\n>\nThat's great. I have a few doubt. Could you add my name into the patch?\nThe new patch is here below.\n\ndiff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S\nindex df1c642..51e8e82 100644\n--- a/sysdeps/aarch64/start.S\n+++ b/sysdeps/aarch64/start.S\n@@ -71,9 +71,9 @@ _start:\n      ldr     PTR_REG (4), [x4, #:got_lo12:__libc_csu_fini]\n  #else\n      /* Set up the other arguments in registers */\n-    ldr    PTR_REG (0), =main\n-    ldr    PTR_REG (3), =__libc_csu_init\n-    ldr    PTR_REG (4), =__libc_csu_fini\n+    MOVL(0, main)\n+    MOVL(3, __libc_csu_init)\n+    MOVL(4, __libc_csu_fini)\n  #endif\n\n      /* __libc_start_main (main, argc, argv, init, fini, rtld_fini,\ndiff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h\nindex a749a70..152f5ba 100644\n--- a/sysdeps/aarch64/sysdep.h\n+++ b/sysdeps/aarch64/sysdep.h\n@@ -137,6 +137,20 @@\n      ldr    PTR_REG (T), [x##T, #:got_lo12:EXPR];    \\\n      OP    PTR_REG (R), [x##T];\n\n+/* Load an immediate into R.\n+   Note R is a register number and not a register name. */\n+#ifdef __LP64__\n+# define MOVL(R, NAME)                    \\\n+    movz    PTR_REG(R), #:abs_g3:NAME;        \\\n+    movk    PTR_REG(R), #:abs_g2_nc:NAME;        \\\n+    movk    PTR_REG(R), #:abs_g1_nc:NAME;        \\\n+    movk    PTR_REG(R), #:abs_g0_nc:NAME;\n+#else\n+# define MOVL(R, NAME)                    \\\n+    movz    PTR_REG(R), #:abs_g1:NAME;        \\\n+    movk    PTR_REG(R), #:abs_g0_nc:NAME;\n+#endif\n+\n  /* Since C identifiers are not normally prefixed with an underscore\n     on this system, the asm identifier `syscall_error' intrudes on the\n     C name space.  Make sure we use an innocuous name.  */\n\nThank you, Nagy.","headers":{"Return-Path":"<libc-alpha-return-84635-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84635-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"jkVpXNZf\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtctj1k3Zz9t2V\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 11:16:44 +1000 (AEST)","(qmail 72558 invoked by alias); 15 Sep 2017 01:16:37 -0000","(qmail 72543 invoked by uid 89); 15 Sep 2017 01:16:36 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:subject:to:cc:references:from:message-id:date\n\t:mime-version:in-reply-to:content-type\n\t:content-transfer-encoding; q=dns; s=default; b=EInFfSYmTxkcNVyB\n\tPipxr9dkSfks03VWYnLNCvNz8Rb6GS2t6GLO/0s2x8GKKQmuqtIo4g+gSiW37Cn9\n\tpuwLse7YNStQ47fpRGa3Hcldllg2kT/5QfNNFRI5vmtKbIPqZFecsUNyKNi+JdJW\n\tKZ1Bw+U/Br3VPkfQ2yGrOOGF7PM=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:subject:to:cc:references:from:message-id:date\n\t:mime-version:in-reply-to:content-type\n\t:content-transfer-encoding; s=default; bh=+ZDmlNmaA5VqM3hO+SpGm9\n\t4mmu8=; b=jkVpXNZfqGSFX7G3FswaNhvUyA6vp9WuVSrNatY3dAceB8b/+fs08K\n\tC2Rg8qiPtk2jZJMXsfgx1WyUr5z8AjBCmgVS6pJIRuO4TTjJILmVtYL/3K7rUVV/\n\tXOcavzn+c1Dq/xXl/CHtesyJi1WpD3YoYcahYRfSgb/nW2Vsqx7yY=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-24.9 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,\n\tRP_MATCHES_RCVD,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=rights,\n\tHx-languages-length:2545","X-HELO":"szxga04-in.huawei.com","Subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools in\n\tstart.S","To":"Szabolcs Nagy <szabolcs.nagy@arm.com>","CC":"<nd@arm.com>, GNU C Library <libc-alpha@sourceware.org>","References":"<e65025af-5168-c999-bfc1-7ac614314836@huawei.com>\n\t<59B65347.503@arm.com>\n\t<336560e5-c9de-08bc-c850-28994cac2c33@huawei.com>\n\t<59BA3F64.60504@arm.com>","From":"Boshi Wang <wangboshi@huawei.com>","Message-ID":"<2112d1ae-98b2-f555-99ed-99d1d24ac4da@huawei.com>","Date":"Fri, 15 Sep 2017 09:16:02 +0800","User-Agent":"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<59BA3F64.60504@arm.com>","Content-Type":"text/plain; charset=\"utf-8\"; format=flowed","Content-Transfer-Encoding":"7bit","X-CFilter-Loop":"Reflected","X-Mirapoint-Virus-RAPID-Raw":"score=unknown(0),\n\trefid=str=0001.0A090204.59BB29E9.0067, ss=1, re=0.000, recu=0.000,\n\treip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0,\n\tso=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32","X-Mirapoint-Loop-Id":"226d96cde6d9dd5ee313b7f8096acb52"}},{"id":1770346,"web_url":"http://patchwork.ozlabs.org/comment/1770346/","msgid":"<59C00094.3090604@arm.com>","list_archive_url":null,"date":"2017-09-18T17:21:24","subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools\n\tin start.S","submitter":{"id":65667,"url":"http://patchwork.ozlabs.org/api/people/65667/","name":"Szabolcs Nagy","email":"szabolcs.nagy@arm.com"},"content":"On 15/09/17 02:16, Boshi Wang wrote:\n> On 2017/9/14 16:35, Szabolcs Nagy wrote:\n>> On 14/09/17 04:21, Boshi Wang wrote:\n>>> On 2017/9/11 17:11, Szabolcs Nagy wrote:\n>>>> On 07/09/17 08:33, wangboshi wrote:\n>>>>> 2017-09-07  Wang Boshi  <wangboshi@huawei.com>\n>>>>>\n>>>>>       * sysdeps/aarch64/start.S: Use MOVL instead of literal pools.\n>>>>>       * sysdeps/aarch64/sysdep.h (MOVL): Add MOVL macro.\n>>>>>\n>>>> thanks, the patch looks good to me (except for a nit below),\n>>>> do you have copyright assignment?\n>>>> do you have commit rights to the glibc repo?\n>>> I have read requirements of copyright assignment. I don't have that.\n>>>\n>>> I don't have commit rights, too.\n>>>\n>>> So how can I contribute the change? Could you give me some suggestions?\n>>>\n>> i think your change is just below the legally-significant limit\n>> https://www.gnu.org/prep/maintain/maintain.html#Legally-Significant\n>> so i can commit it for you.\n>>\n>> but getting your employer to sort it out with the fsf would be better,\n>> in case you run into further issues that need glibc fixes.\n>>\n> That's great. I have a few doubt. Could you add my name into the patch?\n> The new patch is here below.\n> \n\ncommitted.","headers":{"Return-Path":"<libc-alpha-return-84696-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84696-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"pQ0hHObr\"; dkim-atps=neutral","sourceware.org; auth=none","spf=none (sender IP is )\n\tsmtp.mailfrom=Szabolcs.Nagy@arm.com; "],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xwt8k27hSz9s7M\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 19 Sep 2017 03:21:42 +1000 (AEST)","(qmail 105776 invoked by alias); 18 Sep 2017 17:21:35 -0000","(qmail 105762 invoked by uid 89); 18 Sep 2017 17:21:34 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:message-id:date:from:mime-version:to:cc\n\t:subject:references:in-reply-to:content-type\n\t:content-transfer-encoding; q=dns; s=default; b=Nur01ungIQulYxJs\n\tyTHrRr0z+IV5mTec7QJZVDErdojtnuIaufgMZYSdXC+TE0GWJdWrUhJVb15iFGxK\n\tJ0GXTVwE7T/NTphbuVw0Ymjtup3/3epdPu0omban5Bn8RF+jtDtTlzeGNou3Mo0F\n\tZyakgAMvXrT9o1swPmENLmLPn3I=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:message-id:date:from:mime-version:to:cc\n\t:subject:references:in-reply-to:content-type\n\t:content-transfer-encoding; s=default; bh=9ShLB1JdaHSCBzdVfRszHu\n\t8OQGg=; b=pQ0hHObrxn5gKcqukknRz0QdmGCkJ1IMzYe0V3uMrIGjDScaVdwvQV\n\tWu9ENXjo3cKCb6d83pD0EPjUMmpbI5DHuScy5gomG68GBnw0V8geEEJNwSm9iaFX\n\tjMxZYipmgIudOND+E4dh4wSDsZJ8fs1Ej0Qyxet0xccg148UmFDCE=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-2.1 required=5.0 tests=AWL, BAYES_00,\n\tRCVD_IN_DNSWL_NONE, SPF_HELO_PASS,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=prep, rights","X-HELO":"EUR01-VE1-obe.outbound.protection.outlook.com","Message-ID":"<59C00094.3090604@arm.com>","Date":"Mon, 18 Sep 2017 18:21:24 +0100","From":"Szabolcs Nagy <szabolcs.nagy@arm.com>","User-Agent":"Mozilla/5.0 (X11; Linux x86_64;\n\trv:31.0) Gecko/20100101 Thunderbird/31.8.0","MIME-Version":"1.0","To":"Boshi Wang <wangboshi@huawei.com>","CC":"nd@arm.com, GNU C Library <libc-alpha@sourceware.org>","Subject":"Re: [RFC][PATCH] AArch64: use movz/movk instead of literal pools\n\tin start.S","References":"<e65025af-5168-c999-bfc1-7ac614314836@huawei.com>\n\t<59B65347.503@arm.com>\n\t<336560e5-c9de-08bc-c850-28994cac2c33@huawei.com>\n\t<59BA3F64.60504@arm.com>\n\t<2112d1ae-98b2-f555-99ed-99d1d24ac4da@huawei.com>","In-Reply-To":"<2112d1ae-98b2-f555-99ed-99d1d24ac4da@huawei.com>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"7bit","X-ClientProxiedBy":"AM5PR0202CA0008.eurprd02.prod.outlook.com\n\t(2603:10a6:203:69::18) To DB6PR0802MB2487.eurprd08.prod.outlook.com\n\t(2603:10a6:4:a0::22)","X-MS-PublicTrafficType":"Email","X-MS-Office365-Filtering-Correlation-Id":"8fea12f7-4a25-45bd-8643-08d4feb9b1f9","X-MS-Office365-Filtering-HT":"Tenant","X-Microsoft-Antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:DB6PR0802MB2487; ","X-Microsoft-Exchange-Diagnostics":["1; DB6PR0802MB2487;\n\t3:Omv1laIrko8+wI/9fM/FTqHDd+1hnWyDqNkw3N0odeO4exMC+kCxMB5/WIPeGBjXLqYtRYE3p/b/yAh+1YNfPFdPTKSBT6BM0yQ0LOolP6CpeFqQwtT9Aj+jI+opXEv8e75hm4kS+XzM01LRuaxmmLtkXzCx6tLQtC7kcspbJz3FTNUufsLBfMpd/mmYU1aXk6ZspB8A/dFWZFd7mB8Edqz2bRpihKmWqFHmzSeuYBShZ/F3yGjHdrMH3+DtgYD2;\n\t25:GgDqzuSDZwjhL9ZofIaMAq6tuIi4fiHVSIRtHHMdRmndILTUzm5tO0vJ3boWpb/5O3c96JputFv7YWOtukd/Kwz1xc9Rbe/34FP50SWxei9ebxyHx7mlL6Ix3qcKn0/BbEPkIXeOEvdy02GNXeOK4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yOXCrY4vJeq03/wThKfqzbSqbiyMY3Rmd0/KL48j8jZNLz1a4MEQDSXVSb1iszayIkkjAK7yhO+Jnl5c5aCVJOF7dqJsqBGY75/LtjW48wzBAs6Y1l0XljPt10m/kgAe9hnA==;\n\t5:Qb4i9fakqGTsxO72zB4aReqHPQlJyIJsy705k1pF1AHpMsNkAXKChxTjKrtdzTwXu1DgBNwg1Y1VyJe4KTaCkN78v8WFQwMmswKP0bp7/IfbC5X317hDv58uz1vpOcww4bdLQWTdx+ys5yZA79O/jg==;\n\t24:7xq1fhDIWnGTtLZectFS8dAtAd+tAnF0u9V/EzsVKIrzOwceiOp00/Cr1cuzVuTGyyhu1AiMy4N0B39uIw/1kU9AitFH7NwMwG0bL7qTVEU=;\n\t7:2swfdcUfP5XvY3IAtNdmONcN5kKJpjI5MBANDqqXeVVIr2ZJf4orv+S8ihVOKZMqnuHL8dWyMdxyJgZYB0OtOnBYf6Nkpp4z8JNOZrcbAWipPiZSNioPGG6FXaSAegiaaArQusmjQyOPDvxAPw4dQZ5AEGKVhXAzOZzeyC1CmUgOI2Fnr5w4mKk1fimsu4EnJ88igXO4KdxNqMNf0Ru9pnHeQ67hdcPVvq6EDYweSuo="],"X-MS-TrafficTypeDiagnostic":"DB6PR0802MB2487:","NoDisclaimer":"True","X-Exchange-Antispam-Report-Test":"UriScan:(250305191791016)(22074186197030)(50582790962513); ","X-Microsoft-Antispam-PRVS":"<DB6PR0802MB2487402B01D16727362B7291ED630@DB6PR0802MB2487.eurprd08.prod.outlook.com>","X-Exchange-Antispam-Report-CFA-Test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041248)(20161123560025)(20161123555025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:DB6PR0802MB2487; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:DB6PR0802MB2487; ","X-Forefront-PRVS":"04347F8039","X-Forefront-Antispam-Report":"SFV:NSPM;\n\tSFS:(10009020)(4630300001)(7370300001)(6009001)(6049001)(39860400002)(346002)(376002)(199003)(24454002)(189002)(377424004)(50466002)(6916009)(2950100002)(5660300001)(25786009)(6116002)(87266999)(76176999)(54356999)(50986999)(65816999)(305945005)(7736002)(47776003)(4326008)(8676002)(65956001)(65806001)(66066001)(81156014)(230700001)(16526017)(80316001)(81166006)(93886005)(16576012)(110136004)(101416001)(53936002)(3846002)(83506001)(6306002)(6246003)(316002)(58126008)(64126003)(97736004)(966005)(59896002)(86362001)(36756003)(229853002)(6486002)(106356001)(72206003)(77096006)(478600001)(7350300001)(2906002)(53546010)(105586002)(189998001)(23676002)(68736007)(33656002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2487;\n\tH:[10.2.206.69]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1;\n\tLANG:en; ","Received-SPF":"None (protection.outlook.com: arm.com does not designate\n\tpermitted sender hosts)","SpamDiagnosticOutput":"1:99","SpamDiagnosticMetadata":"NSPM","X-OriginatorOrg":"arm.com","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"18 Sep 2017 17:21:26.9876\n\t(UTC)","X-MS-Exchange-CrossTenant-FromEntityHeader":"Hosted","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"DB6PR0802MB2487"}}]