From patchwork Wed Feb 23 16:54:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12757206 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A5CFC433EF for ; Wed, 23 Feb 2022 16:55:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243057AbiBWQzf (ORCPT ); Wed, 23 Feb 2022 11:55:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243056AbiBWQze (ORCPT ); Wed, 23 Feb 2022 11:55:34 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BC0549248 for ; Wed, 23 Feb 2022 08:55:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1645635296; bh=aIuSp5XEcCBCUpXkC5SFSqxsTRWBcfx3QCV5lEE+ycI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=JRPjlUe0865hHMJkMCLIp2bub+UdRbVMk8YxVE7gx8fwaCjxJG5ea+3XWmCQb1Xxx kBH5fz3+ZFrqpz2O727tijWHRtGLVzZX6n9gJrUKjTAiS1SmPQtCIqxlPkVCzAHbQt 4ATGD188bk+0B4MWPZVLmxtDMM7JrqmuhvnwcZN8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.191.154]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mqs0X-1o0uVC3lXF-00mqXt; Wed, 23 Feb 2022 17:54:55 +0100 From: Helge Deller To: linux-parisc@vger.kernel.org Cc: James Bottomley , John David Anglin Subject: [PATCH 1/4] parisc/unaligned: Tweak inline assembly of emulate_ldh() Date: Wed, 23 Feb 2022 17:54:52 +0100 Message-Id: <20220223165455.3764-1-deller@gmx.de> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:+F/SQEpOwQs0YB+c8PZH2Bf9e3thnJtSjTvPDlVVxHWYdYKL+vk m1xvUjMu6HYOntgsyXWepfEHV/avcI7c+BNFS1odcOC3dlsKjt9egc9iKfKjotFR7H4Va+A DhRXX6DXzyRAE55ea8/v7bfStoyWCRM2sxshe6/Hv7v3nOKQOgbdFRhiWea0CchbLLVvp9V lz/D8f6i9oFYX0Jzw21hg== X-UI-Out-Filterresults: notjunk:1;V03:K0:EeC9fhP9I/A=:QWt/zfts9PcUi3qkNZpi3u 0POztU3UpcXytdtQJpS3GYCGEMwo+1lDiMZLbY2O4Vv2twZK/ZFe4sROp7HdRmX4swrqzVfVF WjhSC3qXyqje2UK2Ofqtvbua2x2Dq1jGPvHFVKTuEnPT3fZTM6grdJLGKV0bNeSy3IMghKiGw CyPHokdFnT+14o2UoLGfSct/MNnW4SMHUhvYoaowuneDqQEA+ymMD4A/Z/esX+9TDCQIvb9h2 LLHDed0noui3ywQ+DsPOzoUdxi9v0WyjPHJnGCgF39TjhrSa7pTSfQ0ThC33y/voQKOz4FNsP A2jxE/2qOniqfZ0wDDs5/SNPSRuEW8girwPo1IxntZ2nLCcpO2EoFOcFFRgYyemSyIuspt0Hx Oi8CyZBNNXGqCfkM85FCzG/rtgzvFy5YZZpr/0wE3NPD6fwaXgiyQPszIOUuo524Z7WHggUnt WtZM3s7As8WnVEGF/lav6gehYODqJzwvxsweNqMrjCVkSDmTz+1eFWhittBoz0MLTSIcvWM3e jgSOFXIsAtjAzF3hGOVxR35PgvywWbv0Z6Ch2xH0hETgokga0TSCLxFjBnF+1wWDdmv82idJX 5mmEQfoSyU4oycdgGJezD0+5cJsL835Qzbz1WswnyYIlwzQDqBDX3H/QnERoGiTgvriaLqDTn Unn5NGxcpdEQCiv34LMVPOZQ6Flwbb3EU4/xijlDBQOEdo9Fk0Kj3/tbj6o01XNOMD04S1lmg 18waKXTn7XVrreUfOP9XVdI5HpwI6MyAIh3dKMzi83t+tIK8Xo0x9ued6ev3Ff2CXPNHXR5xR N44UH4wjVvEucC6Jk8KPFJiSfUpVxyXrF1m1A7Ibf1XVSJuUFLqN1YP/q0hBgE05kO6XMA9S/ EZHy6g3xNiUki5YlArvTKFIGUliRkB2HwsSbBQAY00dC9vJ7DXgQjmyRIf0M00O1DxWxizw/s KeoKTKLPoTbrPTI4l9H0nDQg4gyZ06iz5NjSS/blSMWLILlNku4LQ1fhD8YdlWwdZk+oLmtP4 sue7PD7IYI3mEv7//ElGTAd6F4hJumkxr86oFAsIKQy3Qh1zo6uUN0IXtrGhf+NAO/YazKO+g in1FvmDZCRW8oo= Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Convert to use real temp variables instead of clobbering processor registers. Signed-off-by: Helge Deller --- arch/parisc/kernel/unaligned.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) -- 2.34.1 diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c index 857dcc790122..b923bc135d29 100644 --- a/arch/parisc/kernel/unaligned.c +++ b/arch/parisc/kernel/unaligned.c @@ -113,7 +113,7 @@ int unaligned_enabled __read_mostly = 1; static int emulate_ldh(struct pt_regs *regs, int toreg) { unsigned long saddr = regs->ior; - unsigned long val = 0; + unsigned long val = 0, temp1; ASM_EXCEPTIONTABLE_VAR(ret); DPRINTF("load " RFMT ":" RFMT " to r%d for 2 bytes\n", @@ -121,15 +121,14 @@ static int emulate_ldh(struct pt_regs *regs, int toreg) __asm__ __volatile__ ( " mtsp %4, %%sr1\n" -"1: ldbs 0(%%sr1,%3), %%r20\n" +"1: ldbs 0(%%sr1,%3), %2\n" "2: ldbs 1(%%sr1,%3), %0\n" -" depw %%r20, 23, 24, %0\n" +" depw %2, 23, 24, %0\n" "3: \n" ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b) ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b) - : "=r" (val), "+r" (ret) - : "0" (val), "r" (saddr), "r" (regs->isr) - : "r20" ); + : "+r" (val), "+r" (ret), "=&r" (temp1) + : "r" (saddr), "r" (regs->isr) ); DPRINTF("val = 0x" RFMT "\n", val); From patchwork Wed Feb 23 16:54:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12757205 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D34ABC433F5 for ; Wed, 23 Feb 2022 16:55:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243052AbiBWQzf (ORCPT ); Wed, 23 Feb 2022 11:55:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243053AbiBWQzd (ORCPT ); Wed, 23 Feb 2022 11:55:33 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EF1E36B70 for ; Wed, 23 Feb 2022 08:55:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1645635296; bh=nGM1QQCRCwAe/LWDeH/TBmOGkkN5SOBljxBuDGSaav8=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=XSG/IN/nV2yNfzo9sCVCsmXodtjr31xtnIAlAk6nbYMcjadHc3uAJgEqjbStRIS/P 0sYVqexOZ6Roj4uAOMp5txUuXzGVIpeK1/WypM50DgR9e7vfiUi+3OTVqMwR1vT1Ff /g+RKMHwz2CpOYQuxWoJ2bH8toZd5/6kxfKle7Vo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.191.154]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MWzfl-1nlJWL079l-00XO3x; Wed, 23 Feb 2022 17:54:56 +0100 From: Helge Deller To: linux-parisc@vger.kernel.org Cc: James Bottomley , John David Anglin Subject: [PATCH 2/4] parisc/unaligned: Tweak inline assembly of emulate_ldw() Date: Wed, 23 Feb 2022 17:54:53 +0100 Message-Id: <20220223165455.3764-2-deller@gmx.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220223165455.3764-1-deller@gmx.de> References: <20220223165455.3764-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:A3qA8z92TTmh7feIsydA4mENBpMcie67nPQ+0IYv1v9VScCOJsU dEmBqs7JBkPq75i1zggjsoEWAjPDAD01jbCzHm9clrNWxfCFbjWefOFNMzwCaX4/kazzPHh eFCxuYwCvEVNo2zOOBcjk0GGF959w74RzgQbctS6tXPhH8M4jfJ2PAbgMEdlK+ToCdxFyA/ inRYu/qqwRBpIyXBQaQeA== X-UI-Out-Filterresults: notjunk:1;V03:K0:3gBnCdcRltk=:x/eZTOMh01tA5wvkUtK76s OBpXbFnCeZzVQb7VBJB60OCMfvwSP7pZjybWVN3G8R6DhAvh7LVauOjiSjBB0npXrA0ANz7mT VhR9Wh6vjaommQGtTeEyDdYBCxVygbBmTF6uC4NnsllJ0zevUdeGR4c//SGpQFzG/Rmwa2dwt kIaX6gpHhjEWqJ+kvkj+LEee5Xz0tNHecfirXkWC/YLPiAA+osMwa4I0H0jGHF//E3mb1jGnd yXnJNz9JAnOeYOfnpAd8rsTqxnWOFLbAp6Y+gLCz7U+kx4YN4jqbXspCeJa/BWZya26K7L78k jAgcYWG7Wkx3Fgu4BVeIDQnmjhy8PS1GpgK86eRzcCVFmIBplAldz07Se0AOje5D3gOr5Vnlf fErJv+YV3Zk5xdLvz507me3FfzKdgA7cRrkzQIpb95alKcsC0imyuw0Tl1iKtmBbmYbd6jpB5 dIXUESMz/6nyu+TtuEhoQlayHaxIrroI4KqrvCidJ29/HAk1fJXFBPImh/Rq0zn0kSMLZvGZk L/gw6zoxf0OM5f1OON0VCWC4gvOhlfwg98wKN99XOYLf5u0JH4h/Uuky42ok3LrQd0fKXFpbQ e87/SSc/Imd6HpwhdCNwy/DuwIDPgj0hTfkVAf4IXor9sWt1F7Ve+9zpqxNC6LmY4EKL/JWym TLvOkRYB6/hhS6crFA77YasHIN73eTxZyMIL3dl/ZGY9cmqICM+Oy+fxyg8CGQzQa/2pAdSlt zzpst6W0equUTznIOe7lWArL3Fm2UellcudM2mH15F8/qc02hFNwW3cUEAD/VmYwKEUTY8qzt esTKM01Ry80r31HQ4+NLm2DurGDRrtiWO4MOBCnEumtIXmxAcCIvcS6TKrhhjwgZ3r5pKm8Wb ErCkm0C9uGv1y0OIq1u+9n3mI8ly5ZBZMtbOcBUm55PUVWE7eiRWUxw/S0aOOFYFzdPmskmWp cmr2rvduxczFMU85DU1nG26cV5nCdy2d1Ih5Ux/LI0eex4EUZE2au1u7+wl5K3cYdgnRVbqN3 PIem5ZLGSGV11uPX9CKnwSwVFy+O2PK8seCOUZc+uUd7rZRKTDZhDLD0ocHbtN9RHaY8Rj8fl iRyjmYIiKb2ERE= Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Convert to use real temp variables instead of clobbering processor registers. Signed-off-by: Helge Deller --- arch/parisc/kernel/unaligned.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) -- 2.34.1 diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c index b923bc135d29..e8bc0cd8140c 100644 --- a/arch/parisc/kernel/unaligned.c +++ b/arch/parisc/kernel/unaligned.c @@ -141,27 +141,26 @@ static int emulate_ldh(struct pt_regs *regs, int toreg) static int emulate_ldw(struct pt_regs *regs, int toreg, int flop) { unsigned long saddr = regs->ior; - unsigned long val = 0; + unsigned long val = 0, temp1, temp2; ASM_EXCEPTIONTABLE_VAR(ret); DPRINTF("load " RFMT ":" RFMT " to r%d for 4 bytes\n", regs->isr, regs->ior, toreg); __asm__ __volatile__ ( -" zdep %3,28,2,%%r19\n" /* r19=(ofs&3)*8 */ -" mtsp %4, %%sr1\n" -" depw %%r0,31,2,%3\n" -"1: ldw 0(%%sr1,%3),%0\n" -"2: ldw 4(%%sr1,%3),%%r20\n" -" subi 32,%%r19,%%r19\n" -" mtctl %%r19,11\n" -" vshd %0,%%r20,%0\n" +" zdep %4,28,2,%2\n" /* r19=(ofs&3)*8 */ +" mtsp %5, %%sr1\n" +" depw %%r0,31,2,%4\n" +"1: ldw 0(%%sr1,%4),%0\n" +"2: ldw 4(%%sr1,%4),%3\n" +" subi 32,%4,%2\n" +" mtctl %2,11\n" +" vshd %0,%3,%0\n" "3: \n" ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b) ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b) - : "=r" (val), "+r" (ret) - : "0" (val), "r" (saddr), "r" (regs->isr) - : "r19", "r20" ); + : "+r" (val), "+r" (ret), "=&r" (temp1), "=&r" (temp2) + : "r" (saddr), "r" (regs->isr) ); DPRINTF("val = 0x" RFMT "\n", val); From patchwork Wed Feb 23 16:54:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12757204 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E10FC4332F for ; Wed, 23 Feb 2022 16:55:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243051AbiBWQze (ORCPT ); Wed, 23 Feb 2022 11:55:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243050AbiBWQzb (ORCPT ); Wed, 23 Feb 2022 11:55:31 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCF2B275C1 for ; Wed, 23 Feb 2022 08:55:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1645635296; bh=guYEiL5Pau753E1q+hmt7K50WbXb82F6iy2VWVPPuq8=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Zijsi2no7oLG/EltWyDUr1e2tG+ylTegnTwunUsi5qfdZ33SQTHoQZuMtazmXqfXu xAyZG2bMq1UCtrmV0+iw6fdR8cC5Y3w9TOSx3emIjjPRZ111vktJahh1XF8nC0kep1 Jw4GQ2iXMBlNBfcGW8QGp5xe/7/DY8vKgIqarw2Y= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.191.154]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N1OXT-1oOTkp0bcZ-012t8J; Wed, 23 Feb 2022 17:54:56 +0100 From: Helge Deller To: linux-parisc@vger.kernel.org Cc: James Bottomley , John David Anglin Subject: [PATCH 3/4] parisc/unaligned: Tweak 32-bit inline assembly of emulate_ldd() Date: Wed, 23 Feb 2022 17:54:54 +0100 Message-Id: <20220223165455.3764-3-deller@gmx.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220223165455.3764-1-deller@gmx.de> References: <20220223165455.3764-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:58ZatPFzTGg47lUM3KvKeePkACjbsLqVoTwe1WDvcLCNwdb8Pie WO58l3AbhvsD9ZRuF6EsxIq+Vt46TqDvFfqwBITmgFf2AEUTPwIXThlT2AHAbchEaK7hUFY O0ks+VanPx0mSPHL+f4ZA+TFmAOlSpQya7lohJBI0YkKbX1JRTopHwNfqbS7C8MnpZIi8SV +0KD/0iLSeyX/tzAzdyCg== X-UI-Out-Filterresults: notjunk:1;V03:K0:LuUj0XDpBa4=:TDSFh5soj3bfWcc8GUaMDN KyJ/z5nwGoUZml96qDduxtdhZHIPOe+WTRmRuxgU35YrApGaLRO9ciBVP6ZeMYt/y8VHx4ZuX UUZ2GqFvsg5Ck0X2rSqdHhgnnK6IRCyhQ9ek+Yxr/jksYwfW5hatgnYmWeHP0o84X3V4mevnY MVle+Ol1r3b8IvnrGJggzGwha1Acrgn4EtiCpH5J4yQYzNQCThF46Y41d5ZTHbyjUsFZ7HdVe PAhjtkj1cCyCg3Q2ODCaKafkPCJBtg/ACfIvu1g9iCbxTw6PvQeIFa4y7JTyD6NBY5RJnALnq Txg5hxn2NwJ0jLD+AUaeBFlnNsxBqxjUXHv2tjPjAFlMppkTOGxfEPv5kwnC/e6ukxIN7s2lQ JDYxSYP8pzP3iXz2CByrXVdBLmz/ZIlI6TSfjnOa1SvKVn1YEtTQQePoT1ZoDqcxpVbyPc9IB hZ7tHkcEy6m/R0qD/vPwwgCXtetPTy82bfkYub+bEBmTTLpts3X9b8Y2PpeXsVJsd5laqd6RO ed+3/IthFyeigoTBFkqUG6xpUAAyK4anoSJMY+kc1M67CFgi0DOKxbzk3mmEcbgqGWgj3+q3B 0HC/bRuLIbzjTLcc0V1J2SG+IVyJvyKy284MwSEbH3Qv4otV2BKHf97w5+oFm7AtTTKZjInn2 ZB30nrOH/S2u/goGoRXf3tAQpJbEFkPzgfyQToFLAlNC72l+cChwoIfXV/uJwqIn2wMXm1L6U sBi0H8Z4a863kTbEFpIA6nrdSMob9CLOOPes9VH54jI6pPuwgGYc/qgMb818RQqGvMz6wXyL0 o/AFLLv4Aqd76V05bv5dwZXYEoIrDwdZ9WYojSepAgrESnyME2q9q82WYNTu5iWP1Ax4UU5zJ lBKkYCWufmD7Xz0oRDTwAvRXMXMcigeblBMwrq7yMORIUbX8v1tqUHLxZtM52D5wLVmfUYI4G pun4SLM1CSjEsS3uBvApBRshkA5HaJ/oJwCulmuwMsO6wd0BBvvRI2ytcm1JdCFpkUN1aWAyW QUKimPm/MQCKZ9Rkm6cLeQAFamryFGlqKMBFWC5gnjbG4jeYUinzyhjdBmpRt++FbEvnQu0rP cFsm3cWNYPa/As= Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Convert to use real temp variables instead of clobbering processor registers. Signed-off-by: Helge Deller --- arch/parisc/kernel/unaligned.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) -- 2.34.1 diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c index e8bc0cd8140c..8fbe000b33e7 100644 --- a/arch/parisc/kernel/unaligned.c +++ b/arch/parisc/kernel/unaligned.c @@ -201,26 +201,24 @@ static int emulate_ldd(struct pt_regs *regs, int toreg, int flop) : "r19", "r20" ); #else { - unsigned long valh=0,vall=0; + unsigned long shift, temp1; __asm__ __volatile__ ( -" zdep %5,29,2,%%r19\n" /* r19=(ofs&3)*8 */ -" mtsp %6, %%sr1\n" -" dep %%r0,31,2,%5\n" -"1: ldw 0(%%sr1,%5),%0\n" -"2: ldw 4(%%sr1,%5),%1\n" -"3: ldw 8(%%sr1,%5),%%r20\n" -" subi 32,%%r19,%%r19\n" -" mtsar %%r19\n" -" vshd %0,%1,%0\n" -" vshd %1,%%r20,%1\n" +" zdep %2,29,2,%3\n" /* r19=(ofs&3)*8 */ +" mtsp %5, %%sr1\n" +" dep %%r0,31,2,%2\n" +"1: ldw 0(%%sr1,%2),%0\n" +"2: ldw 4(%%sr1,%2),%R0\n" +"3: ldw 8(%%sr1,%2),%4\n" +" subi 32,%3,%3\n" +" mtsar %3\n" +" vshd %0,%R0,%0\n" +" vshd %R0,%4,%R0\n" "4: \n" ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 4b) ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 4b) ASM_EXCEPTIONTABLE_ENTRY_EFAULT(3b, 4b) - : "=r" (valh), "=r" (vall), "+r" (ret) - : "0" (valh), "1" (vall), "r" (saddr), "r" (regs->isr) - : "r19", "r20" ); - val=((__u64)valh<<32)|(__u64)vall; + : "+r" (val), "+r" (ret), "+r" (saddr), "=&r" (shift), "=&r" (temp1) + : "r" (regs->isr) ); } #endif From patchwork Wed Feb 23 16:54:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12757203 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA831C433FE for ; Wed, 23 Feb 2022 16:55:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243058AbiBWQze (ORCPT ); Wed, 23 Feb 2022 11:55:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243051AbiBWQzb (ORCPT ); Wed, 23 Feb 2022 11:55:31 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C44025EB4 for ; Wed, 23 Feb 2022 08:55:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1645635296; bh=WFiy3z2HnZvePTT5VzZ1i9d6tq96VcnqVt/x/KW7AoA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=LzbGeIhCcY3Zx8+mdeX/sl3+O3Jfe9GDvvYp6VJe2q0m+zazEINSM9Vc7SpPBzWxk 7/2yKDD9XB/VGf2xleGSncdy7uTUelRyREOd3Bmvcj8n/iyzbde2O9rEOH67qpcL2c HdwlNDGWq/4+GytP32ABkz1zoao1a2ydLZB4j5JI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.191.154]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MOREc-1nacHu17cM-00PvgY; Wed, 23 Feb 2022 17:54:56 +0100 From: Helge Deller To: linux-parisc@vger.kernel.org Cc: James Bottomley , John David Anglin Subject: [PATCH 4/4] parisc/unaligned: Tweak 32-bit inline assembly of emulate_sth() Date: Wed, 23 Feb 2022 17:54:55 +0100 Message-Id: <20220223165455.3764-4-deller@gmx.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220223165455.3764-1-deller@gmx.de> References: <20220223165455.3764-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:+JJc77G20F4H5bzlSXvAUn6kEweSDP87GPO+RmYXuXIOG8L6nbq a9wI8ukO6uAGX6udg8a0tNaSGHRs1yhOZWk4BLUeROm6xkFU31CPQVTfqyp5gMq+TRkAOxP PpsgKHr+C6j5qm1FEYkYeDjJdhudMEBADQfOcw2Tog9ufZl3VynYPDfRNTFBU53V0hRwWgU +BGGzOnN8CXjTwGDXzUTQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:ZfXE3JToCjQ=:nMOv4KHridTxxWyOG+RhHo 7VnXKcYkugSVRW612F4sCKX8bZWxLkDATBG5Kw3MwSaEVQxQYyzONiQwwCDLzHCpasNniiz+O J/B6LKoS+5l8chOwR6Ovj/14W8hY5R80UpsDDTX70Au/phs7faGYDeCf7ko/S6orM8NtiznPf a1Y7Y34aUeHQDFFcPEZ/votltZql0VFFuGBRAxVvZUMwa0aOn9I8CT0sYRiPT+MSAwgm2tAr6 s3K9i4TpmdH75iO16P1moMPwqtQ9r4cEip3pvn84F1RkCPCnIfMrOz6pfanEqbvbfRWNJaT1q da/mGUVof/AORluIFeS3MrBFEbWjmCphLrWuTVSRw2/0vTLxnqWUGIDCwYTC3sJUCsbvTKyEn FAE5wa5hHCINL+pftHWJjFShPWfIyxLcT3gWEJRD5Ei+JQvIObOA/QiSCfk9FjDQi1/LrBgRM PKGMsn30TvPmrUykMhE2lB3osaANCa5UFkCltd44IvHO6P4qlDFQfvNZy3iFi6u9lJ9YpZKlb S2XUXxAl8xWCL1bjwgfkujkFFbRDXGSRojEOzi3ELYytfVerAhdlQ3NffYl1p3jcuZlZfcIgW pINQzH2B1BFgqe0wOuoi6kEVLgO1Hdsbz5vJspEAEgbgy5z3nBckVDAMySB7K/1RPtkCqL7LL Z0wdP4oR8k8N+z82nHJTaZNTlkJmtYqZt6LGn1JfRdkxrjZwxAxCN5y83ko79OyDFTTB6Ac1U DSv9IzEVULc0KhoRWac/kh4wIlfsv9rbBSXGtNQL8ebQE6kXXxToeuAi0hUeANTR+zT8PTuGq q/LTfH/jI25sxFCX7uBkvhurjHins6K2akni9jUtZWfRcjQDLWxB6lDoLYrlF4lMZFscRtwnf KUK90mbs55ZJDzjQrF1gD324FkhKVTmmEoPO30w/KAvqpLXcHYnb6FEQ0q7hDc0T1XSUIka4D hPbxELLDC5wuAXyaEdAgCnXmnmApVLEJWGEmaJMpS6h4EjWeedyBJxURbcGkfClo07qxL3aff 10aXZ2Nc0vyHbvDPx73VySmTTeRJAt2Qp7ZMeRTajyP2umfJlykyH5dxEQ+fgooGoVVl0rcee iZs4JW7PIotzzg= Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Convert to use real temp variables instead of clobbering processor registers. Signed-off-by: Helge Deller --- arch/parisc/kernel/unaligned.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) -- 2.34.1 diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c index 8fbe000b33e7..0d6e90d6f497 100644 --- a/arch/parisc/kernel/unaligned.c +++ b/arch/parisc/kernel/unaligned.c @@ -234,7 +234,7 @@ static int emulate_ldd(struct pt_regs *regs, int toreg, int flop) static int emulate_sth(struct pt_regs *regs, int frreg) { - unsigned long val = regs->gr[frreg]; + unsigned long val = regs->gr[frreg], temp1; ASM_EXCEPTIONTABLE_VAR(ret); if (!frreg) @@ -244,16 +244,15 @@ static int emulate_sth(struct pt_regs *regs, int frreg) val, regs->isr, regs->ior); __asm__ __volatile__ ( -" mtsp %3, %%sr1\n" -" extrw,u %1, 23, 8, %%r19\n" -"1: stb %1, 1(%%sr1, %2)\n" -"2: stb %%r19, 0(%%sr1, %2)\n" +" mtsp %4, %%sr1\n" +" extrw,u %2, 23, 8, %1\n" +"1: stb %1, 0(%%sr1, %3)\n" +"2: stb %2, 1(%%sr1, %3)\n" "3: \n" ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b) ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b) - : "+r" (ret) - : "r" (val), "r" (regs->ior), "r" (regs->isr) - : "r19" ); + : "+r" (ret), "=&r" (temp1) + : "r" (val), "r" (regs->ior), "r" (regs->isr) ); return ret; }