[{"id":1758057,"web_url":"http://patchwork.ozlabs.org/comment/1758057/","msgid":"<20170826145649.GF13471@gate.crashing.org>","date":"2017-08-26T14:56:50","subject":"Re: [PATCH v2 01/10] powerpc: Handle most loads and stores in\n\tinstruction emulation code","submitter":{"id":134,"url":"http://patchwork.ozlabs.org/api/people/134/","name":"Segher Boessenkool","email":"segher@kernel.crashing.org"},"content":"Hi Paul,\n\nOn Fri, Aug 25, 2017 at 03:41:53PM +1000, Paul Mackerras wrote:\n> diff --git a/arch/powerpc/lib/ldstfp.S b/arch/powerpc/lib/ldstfp.S\n> index a58777c..6840911 100644\n> --- a/arch/powerpc/lib/ldstfp.S\n> +++ b/arch/powerpc/lib/ldstfp.S\n> @@ -178,10 +178,10 @@ _GLOBAL(do_stfd)\n>  \tEX_TABLE(2b,3b)\n>  \n>  #ifdef CONFIG_ALTIVEC\n> -/* Get the contents of vrN into v0; N is in r3. */\n> +/* Get the contents of vrN into v0; N is in r3. Doesn't touch r3 or r4. */\n>  _GLOBAL(get_vr)\n>  \tmflr\tr0\n> -\trlwinm\tr3,r3,3,0xf8\n> +\trlwinm\tr6,r3,3,0xf8\n>  \tbcl\t20,31,1f\n>  \tblr\t\t\t/* v0 is already in v0 */\n>  \tnop\n\nNot new in your patch, but that bcl disturbs the link stack (only $+4\nbranches do not).\n\n\n> +/* Convert single-precision to double, without disturbing FPRs. */\n> +/* conv_sp_to_dp(double *dp, float *sp) */\n\nThat should be\n\n+/* Convert double-precision to single, without disturbing FPRs. */\n+/* conv_dp_to_sp(double *dp, float *sp) */\n\n> +_GLOBAL(conv_dp_to_sp)\n\n\nSegher","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org","linuxppc-dev@ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xfh3X30tQz9t50\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSun, 27 Aug 2017 00:58:00 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xfh3X279yzDrSf\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSun, 27 Aug 2017 00:58:00 +1000 (AEST)","from ozlabs.org (bilbo.ozlabs.org [103.22.144.67])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xfh2K0wCCzDrCw\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tSun, 27 Aug 2017 00:56:57 +1000 (AEST)","from ozlabs.org (bilbo.ozlabs.org [103.22.144.67])\n\tby bilbo.ozlabs.org (Postfix) with ESMTP id 3xfh2J6rMTz8t26\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tSun, 27 Aug 2017 00:56:56 +1000 (AEST)","by ozlabs.org (Postfix)\n\tid 3xfh2J6QdWz9t5W; Sun, 27 Aug 2017 00:56:56 +1000 (AEST)","from gate.crashing.org (gate.crashing.org [63.228.1.57])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xfh2J0Z8Kz9t50;\n\tSun, 27 Aug 2017 00:56:55 +1000 (AEST)","from gate.crashing.org (localhost.localdomain [127.0.0.1])\n\tby gate.crashing.org (8.14.1/8.13.8) with ESMTP id v7QEupC4016664;\n\tSat, 26 Aug 2017 09:56:51 -0500","(from segher@localhost)\n\tby gate.crashing.org (8.14.1/8.14.1/Submit) id v7QEuoxP016663;\n\tSat, 26 Aug 2017 09:56:50 -0500"],"Authentication-Results":"ozlabs.org; spf=permerror (mailfrom)\n\tsmtp.mailfrom=gate.crashing.org (client-ip=63.228.1.57;\n\thelo=gate.crashing.org; \n\tenvelope-from=segher@gate.crashing.org; receiver=<UNKNOWN>)","Date":"Sat, 26 Aug 2017 09:56:50 -0500","From":"Segher Boessenkool <segher@kernel.crashing.org>","To":"Paul Mackerras <paulus@ozlabs.org>","Subject":"Re: [PATCH v2 01/10] powerpc: Handle most loads and stores in\n\tinstruction emulation code","Message-ID":"<20170826145649.GF13471@gate.crashing.org>","References":"<1503639722-19121-1-git-send-email-paulus@ozlabs.org>\n\t<1503639722-19121-2-git-send-email-paulus@ozlabs.org>","Mime-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<1503639722-19121-2-git-send-email-paulus@ozlabs.org>","User-Agent":"Mutt/1.4.2.3i","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"linuxppc-dev@ozlabs.org","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":1758378,"web_url":"http://patchwork.ozlabs.org/comment/1758378/","msgid":"<87h8wss0o6.fsf@concordia.ellerman.id.au>","date":"2017-08-28T05:48:09","subject":"Re: [PATCH v2 01/10] powerpc: Handle most loads and stores in\n\tinstruction emulation code","submitter":{"id":46580,"url":"http://patchwork.ozlabs.org/api/people/46580/","name":"Michael Ellerman","email":"mpe@ellerman.id.au"},"content":"Paul Mackerras <paulus@ozlabs.org> writes:\n\n> diff --git a/arch/powerpc/lib/quad.S b/arch/powerpc/lib/quad.S\n> new file mode 100644\n> index 0000000..2cc77dc\n> --- /dev/null\n> +++ b/arch/powerpc/lib/quad.S\n> @@ -0,0 +1,62 @@\n> +/*\n> + * Quadword loads and stores\n> + * for use in instruction emulation.\n> + *\n> + * Copyright 2017 Paul Mackerras, IBM Corp. <paulus@au1.ibm.com>\n> + *\n> + *  This program is free software; you can redistribute it and/or\n> + *  modify it under the terms of the GNU General Public License\n> + *  as published by the Free Software Foundation; either version\n> + *  2 of the License, or (at your option) any later version.\n> + */\n> +\n> +#include <asm/processor.h>\n> +#include <asm/ppc_asm.h>\n> +#include <asm/ppc-opcode.h>\n> +#include <asm/reg.h>\n> +#include <asm/asm-offsets.h>\n> +#include <linux/errno.h>\n> +\n> +/* do_lq(unsigned long ea, unsigned long *regs) */\n> +_GLOBAL(do_lq)\n> +1:\tlq\tr6, 0(r3)\n> +\tstd\tr6, 0(r4)\n> +\tstd\tr7, 8(r4)\n> +\tli\tr3, 0\n> +\tblr\n> +2:\tli\tr3, -EFAULT\n> +\tblr\n> +\tEX_TABLE(1b, 2b)\n> +\n> +/* do_stq(unsigned long ea, unsigned long val0, unsigned long val1) */\n> +_GLOBAL(do_stq)\n> +1:\tstq\tr4, 0(r3)\n> +\tli\tr3, 0\n> +\tblr\n> +2:\tli\tr3, -EFAULT\n> +\tblr\n> +\tEX_TABLE(1b, 2b)\n> +\n> +/* do_lqarx(unsigned long ea, unsigned long *regs) */\n> +_GLOBAL(do_lqarx)\n> +1:\tlqarx\tr6, 0, r3\n\nOlder binutils barf on this, so we'll need to use a macro to generate it.\n\n> +\tstd\tr6, 0(r4)\n> +\tstd\tr7, 8(r4)\n> +\tli\tr3, 0\n> +\tblr\n> +2:\tli\tr3, -EFAULT\n> +\tblr\n> +\tEX_TABLE(1b, 2b)\n> +\n> +/* do_stqcx(unsigned long ea, unsigned long val0, unsigned long val1,\n> +\t    unsigned int *crp) */\n> +\n> +_GLOBAL(do_stqcx)\n> +1:\tstqcx.\tr4, 0, r3\n\nThis too.\n\neg:\n  arch/powerpc/lib/quad.S:42: Error: Unrecognized opcode: `lqarx'\n  arch/powerpc/lib/quad.S:55: Error: Unrecognized opcode: `stqcx.'\n\ncheers","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org","linuxppc-dev@ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xggnP4nypz9s7g\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 28 Aug 2017 15:49:13 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xggnP3bBrzDqLw\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 28 Aug 2017 15:49:13 +1000 (AEST)","from ozlabs.org (bilbo.ozlabs.org [103.22.144.67])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xggmD5hxjzDqF0\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tMon, 28 Aug 2017 15:48:12 +1000 (AEST)","by ozlabs.org (Postfix)\n\tid 3xggmD5854z9sP3; Mon, 28 Aug 2017 15:48:12 +1000 (AEST)","from authenticated.ozlabs.org (localhost [127.0.0.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPSA id 3xggmD42y2z9s7g;\n\tMon, 28 Aug 2017 15:48:12 +1000 (AEST)"],"From":"Michael Ellerman <mpe@ellerman.id.au>","To":"Paul Mackerras <paulus@ozlabs.org>, linuxppc-dev@ozlabs.org","Subject":"Re: [PATCH v2 01/10] powerpc: Handle most loads and stores in\n\tinstruction emulation code","In-Reply-To":"<1503639722-19121-2-git-send-email-paulus@ozlabs.org>","References":"<1503639722-19121-1-git-send-email-paulus@ozlabs.org>\n\t<1503639722-19121-2-git-send-email-paulus@ozlabs.org>","User-Agent":"Notmuch/0.21 (https://notmuchmail.org)","Date":"Mon, 28 Aug 2017 15:48:09 +1000","Message-ID":"<87h8wss0o6.fsf@concordia.ellerman.id.au>","MIME-Version":"1.0","Content-Type":"text/plain","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}}]