[{"id":1765893,"web_url":"http://patchwork.ozlabs.org/comment/1765893/","msgid":"<20170910031731.GY2735@umbus.fritz.box>","list_archive_url":null,"date":"2017-09-10T03:17:31","subject":"Re: [Qemu-devel] [PATCH 2/3] spapr: fix CAS-generated reset","submitter":{"id":47,"url":"http://patchwork.ozlabs.org/api/people/47/","name":"David Gibson","email":"david@gibson.dropbear.id.au"},"content":"On Fri, Sep 08, 2017 at 04:33:43PM +0200, Cédric Le Goater wrote:\n> The OV5_MMU_RADIX_300 requires special handling in the CAS negotiation\n> process. It is cleared from the option vector of the guest before\n> evaluating the changes and re-added later. But, when testing for a\n> possible CAS reset :\n> \n>     spapr->cas_reboot = spapr_ovec_diff(ov5_updates,\n>                                         ov5_cas_old, spapr->ov5_cas);\n> \n> the bit OV5_MMU_RADIX_300 will each time be seen as removed from the\n> previous OV5 set, hence generating a reset loop.\n> \n> Fix this problem by also clearing the same bit in the ov5_cas_old set.\n> \n> Signed-off-by: Cédric Le Goater <clg@kaod.org>\n\nKind of an ugly hack, but probably the easiest fix for now. Applied to ppc-for-2.11.\n\n> ---\n>  hw/ppc/spapr_hcall.c | 7 +++++++\n>  1 file changed, 7 insertions(+)\n> \n> diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c\n> index 07b3da8dc4cd..92f1e21358b8 100644\n> --- a/hw/ppc/spapr_hcall.c\n> +++ b/hw/ppc/spapr_hcall.c\n> @@ -1575,6 +1575,13 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu,\n>       * to worry about this for now.\n>       */\n>      ov5_cas_old = spapr_ovec_clone(spapr->ov5_cas);\n> +\n> +    /* also clear the radix/hash bit from the current ov5_cas bits to\n> +     * be in sync with the newly ov5 bits. Else the radix bit will be\n> +     * seen as being removed and this will generate a reset loop\n> +     */\n> +    spapr_ovec_clear(ov5_cas_old, OV5_MMU_RADIX_300);\n> +\n>      /* full range of negotiated ov5 capabilities */\n>      spapr_ovec_intersect(spapr->ov5_cas, spapr->ov5, ov5_guest);\n>      spapr_ovec_cleanup(ov5_guest);","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=gibson.dropbear.id.au\n\theader.i=@gibson.dropbear.id.au header.b=\"T6i+0H53\"; \n\tdkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xqbt52X2hz9sRV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 10 Sep 2017 13:20:45 +1000 (AEST)","from localhost ([::1]:51580 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dqsnb-0006YI-Cj\n\tfor incoming@patchwork.ozlabs.org; Sat, 09 Sep 2017 23:20:43 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:49472)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <dgibson@ozlabs.org>) id 1dqsmp-0006TC-KK\n\tfor qemu-devel@nongnu.org; Sat, 09 Sep 2017 23:19:56 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <dgibson@ozlabs.org>) id 1dqsmo-0004Hg-E7\n\tfor qemu-devel@nongnu.org; Sat, 09 Sep 2017 23:19:55 -0400","from ozlabs.org ([2401:3900:2:1::2]:39973)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <dgibson@ozlabs.org>)\n\tid 1dqsmn-0004GR-IZ; Sat, 09 Sep 2017 23:19:54 -0400","by ozlabs.org (Postfix, from userid 1007)\n\tid 3xqbs071yBz9sPk; Sun, 10 Sep 2017 13:19:48 +1000 (AEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n\td=gibson.dropbear.id.au; s=201602; t=1505013588;\n\tbh=zmsNwBwLhE0bcemYJrQg5DP5JF5YD7Xr6PakPqF4CxU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=T6i+0H53uIO5FzNFE7FDaR4tBX9lyJ38fBuMnTwbl3u+pjJBy0DlJ4CPYUapHJw3+\n\ttm9uKz8hCS4TrB/vFIdTB7EbM1fSeKqinaJ+FdzIJe6vp4GGlDq9xaAlTrmvgNs1Tj\n\t2TPOSXzJIVnvPMLYs5wbxj7ahq3WV4vzDVs8qi+U=","Date":"Sun, 10 Sep 2017 13:17:31 +1000","From":"David Gibson <david@gibson.dropbear.id.au>","To":"=?iso-8859-1?q?C=E9dric?= Le Goater <clg@kaod.org>","Message-ID":"<20170910031731.GY2735@umbus.fritz.box>","References":"<20170908143344.12960-1-clg@kaod.org>\n\t<20170908143344.12960-3-clg@kaod.org>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"kigERAySUJmIn/9g\"","Content-Disposition":"inline","In-Reply-To":"<20170908143344.12960-3-clg@kaod.org>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2401:3900:2:1::2","Subject":"Re: [Qemu-devel] [PATCH 2/3] spapr: fix CAS-generated reset","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-ppc@nongnu.org, qemu-devel@nongnu.org,\n\tMichael Roth <mdroth@linux.vnet.ibm.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1765994,"web_url":"http://patchwork.ozlabs.org/comment/1765994/","msgid":"<093c41a2-abaa-ce97-a93c-e4b475b67e2d@kaod.org>","list_archive_url":null,"date":"2017-09-10T19:23:42","subject":"Re: [Qemu-devel] [PATCH 2/3] spapr: fix CAS-generated reset","submitter":{"id":68548,"url":"http://patchwork.ozlabs.org/api/people/68548/","name":"Cédric Le Goater","email":"clg@kaod.org"},"content":"On 09/10/2017 05:17 AM, David Gibson wrote:\n> On Fri, Sep 08, 2017 at 04:33:43PM +0200, Cédric Le Goater wrote:\n>> The OV5_MMU_RADIX_300 requires special handling in the CAS negotiation\n>> process. It is cleared from the option vector of the guest before\n>> evaluating the changes and re-added later. But, when testing for a\n>> possible CAS reset :\n>>\n>>     spapr->cas_reboot = spapr_ovec_diff(ov5_updates,\n>>                                         ov5_cas_old, spapr->ov5_cas);\n>>\n>> the bit OV5_MMU_RADIX_300 will each time be seen as removed from the\n>> previous OV5 set, hence generating a reset loop.\n>>\n>> Fix this problem by also clearing the same bit in the ov5_cas_old set.\n>>\n>> Signed-off-by: Cédric Le Goater <clg@kaod.org>\n> \n> Kind of an ugly hack,  \n\nyes. I lack context to fully understand why the guest radix option is\nhandled that way. \n\n> but probably the easiest fix for now. Applied to ppc-for-2.11.\n\nThanks,\n\nC.\n\n> \n>> ---\n>>  hw/ppc/spapr_hcall.c | 7 +++++++\n>>  1 file changed, 7 insertions(+)\n>>\n>> diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c\n>> index 07b3da8dc4cd..92f1e21358b8 100644\n>> --- a/hw/ppc/spapr_hcall.c\n>> +++ b/hw/ppc/spapr_hcall.c\n>> @@ -1575,6 +1575,13 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu,\n>>       * to worry about this for now.\n>>       */\n>>      ov5_cas_old = spapr_ovec_clone(spapr->ov5_cas);\n>> +\n>> +    /* also clear the radix/hash bit from the current ov5_cas bits to\n>> +     * be in sync with the newly ov5 bits. Else the radix bit will be\n>> +     * seen as being removed and this will generate a reset loop\n>> +     */\n>> +    spapr_ovec_clear(ov5_cas_old, OV5_MMU_RADIX_300);\n>> +\n>>      /* full range of negotiated ov5 capabilities */\n>>      spapr_ovec_intersect(spapr->ov5_cas, spapr->ov5, ov5_guest);\n>>      spapr_ovec_cleanup(ov5_guest);\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xr1Fy3S8Vz9sBd\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 11 Sep 2017 05:24:22 +1000 (AEST)","from localhost ([::1]:54035 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dr7q8-0003K3-Iw\n\tfor incoming@patchwork.ozlabs.org; Sun, 10 Sep 2017 15:24:20 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:53131)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <clg@kaod.org>) id 1dr7pl-0003IP-Lk\n\tfor qemu-devel@nongnu.org; Sun, 10 Sep 2017 15:23:58 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <clg@kaod.org>) id 1dr7pi-0003r5-HN\n\tfor qemu-devel@nongnu.org; Sun, 10 Sep 2017 15:23:57 -0400","from 5.mo3.mail-out.ovh.net ([87.98.178.36]:57902)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <clg@kaod.org>) id 1dr7pi-0003p9-BJ\n\tfor qemu-devel@nongnu.org; Sun, 10 Sep 2017 15:23:54 -0400","from player758.ha.ovh.net (b6.ovh.net [213.186.33.56])\n\tby mo3.mail-out.ovh.net (Postfix) with ESMTP id BBEDB150369\n\tfor <qemu-devel@nongnu.org>; Sun, 10 Sep 2017 21:23:49 +0200 (CEST)","from zorba.kaod.org (LFbn-1-2231-173.w90-76.abo.wanadoo.fr\n\t[90.76.52.173]) (Authenticated sender: postmaster@kaod.org)\n\tby player758.ha.ovh.net (Postfix) with ESMTPSA id 944FC2C007A;\n\tSun, 10 Sep 2017 21:23:42 +0200 (CEST)"],"To":"David Gibson <david@gibson.dropbear.id.au>","References":"<20170908143344.12960-1-clg@kaod.org>\n\t<20170908143344.12960-3-clg@kaod.org>\n\t<20170910031731.GY2735@umbus.fritz.box>","From":"=?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>","Message-ID":"<093c41a2-abaa-ce97-a93c-e4b475b67e2d@kaod.org>","Date":"Sun, 10 Sep 2017 21:23:42 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170910031731.GY2735@umbus.fritz.box>","Content-Type":"text/plain; charset=windows-1252","Content-Language":"en-US","X-Ovh-Tracer-Id":"10467772911511636905","X-VR-SPAMSTATE":"OK","X-VR-SPAMSCORE":"-100","X-VR-SPAMCAUSE":"gggruggvucftvghtrhhoucdtuddrfeelledrfeekgddufeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"87.98.178.36","Subject":"Re: [Qemu-devel] [PATCH 2/3] spapr: fix CAS-generated reset","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-ppc@nongnu.org, qemu-devel@nongnu.org,\n\tSam Bobroff <sam.bobroff@au1.ibm.com>,\n\tMichael Roth <mdroth@linux.vnet.ibm.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]