[{"id":1778454,"web_url":"http://patchwork.ozlabs.org/comment/1778454/","msgid":"<378a1945-6263-dca7-3912-b4a2c61794b8@kaod.org>","date":"2017-10-02T16:27:20","subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","submitter":{"id":68548,"url":"http://patchwork.ozlabs.org/api/people/68548/","name":"Cédric Le Goater","email":"clg@kaod.org"},"content":"On 09/23/2017 10:26 AM, Cédric Le Goater wrote:\n> Hi,\n> \n> Here are a couple of small fixes to support CPU hot unplug. There are\n> still some issues to be investigated as, in some occasions, after a\n> couple of plug and unplug, the cpu which was removed receives a 'lost'\n> interrupt. This showed to be the decrementer under QEMU.\n\nSo this seems to be a QEMU issue only which can be solved by \nremoving the DEE bit from the LPCR on P9 processor when the CPU \nis stopped in rtas. PECE3 bit on P8 processors. \n\nI think these patches are valuable fixes for 4.14. The first \nis trivial and the second touches the common xive part but it\nis only called on the pseries platform.  \n\nCould you please take a look ? \n\nThanks,\n\nC. \n\n> Nevertheless, these patches are required and provide a significant\n> improvement to support CPU removal.\n> \n> Tested under a phyp and a XIVE QEMU model for pseries.\n> \n> Thanks,\n> \n> C.\n> \n> Cédric Le Goater (2):\n>   powerpc/xive: fix IPI reset\n>   powerpc/xive: fix cpu removal\n> \n>  arch/powerpc/sysdev/xive/common.c | 8 ++++++++\n>  arch/powerpc/sysdev/xive/spapr.c  | 4 ++++\n>  2 files changed, 12 insertions(+)\n>","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"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\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 3y5Sj16xQVz9s5L\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  3 Oct 2017 03:45:57 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3y5Sj15qv5zDqlC\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  3 Oct 2017 03:45:57 +1100 (AEDT)","from 10.mo179.mail-out.ovh.net (10.mo179.mail-out.ovh.net\n\t[46.105.79.46])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3y5SdJ45LbzDqR8\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue,  3 Oct 2017 03:42:43 +1100 (AEDT)","from player168.ha.ovh.net (b6.ovh.net [213.186.33.56])\n\tby mo179.mail-out.ovh.net (Postfix) with ESMTP id E35046D113\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tMon,  2 Oct 2017 18:27:25 +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 player168.ha.ovh.net (Postfix) with ESMTPSA id A6CD0420081;\n\tMon,  2 Oct 2017 18:27:21 +0200 (CEST)"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=kaod.org\n\t(client-ip=46.105.79.46; helo=10.mo179.mail-out.ovh.net;\n\tenvelope-from=clg@kaod.org; receiver=<UNKNOWN>)","Subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","To":"linuxppc-dev@lists.ozlabs.org","References":"<20170923082656.27219-1-clg@kaod.org>","From":"=?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>","Message-ID":"<378a1945-6263-dca7-3912-b4a2c61794b8@kaod.org>","Date":"Mon, 2 Oct 2017 18:27:20 +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":"<20170923082656.27219-1-clg@kaod.org>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","X-Ovh-Tracer-Id":"7560699349953842150","X-VR-SPAMSTATE":"OK","X-VR-SPAMSCORE":"-100","X-VR-SPAMCAUSE":"gggruggvucftvghtrhhoucdtuddrfeelledrkeeggdekiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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":"David Gibson <david@gibson.dropbear.id.au>","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":1778459,"web_url":"http://patchwork.ozlabs.org/comment/1778459/","msgid":"<1506963157.25065.48.camel@kernel.crashing.org>","date":"2017-10-02T16:52:37","subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","submitter":{"id":38,"url":"http://patchwork.ozlabs.org/api/people/38/","name":"Benjamin Herrenschmidt","email":"benh@kernel.crashing.org"},"content":"On Mon, 2017-10-02 at 18:27 +0200, Cédric Le Goater wrote:\n> On 09/23/2017 10:26 AM, Cédric Le Goater wrote:\n> > Hi,\n> > \n> > Here are a couple of small fixes to support CPU hot unplug. There are\n> > still some issues to be investigated as, in some occasions, after a\n> > couple of plug and unplug, the cpu which was removed receives a 'lost'\n> > interrupt. This showed to be the decrementer under QEMU.\n> \n> So this seems to be a QEMU issue only which can be solved by \n> removing the DEE bit from the LPCR on P9 processor when the CPU \n> is stopped in rtas. PECE3 bit on P8 processors. \n\nIt should be the same bit no ?\n\n> I think these patches are valuable fixes for 4.14. The first \n> is trivial and the second touches the common xive part but it\n> is only called on the pseries platform.  \n> \n> Could you please take a look ? \n> \n> Thanks,\n> \n> C. \n> \n> > Nevertheless, these patches are required and provide a significant\n> > improvement to support CPU removal.\n> > \n> > Tested under a phyp and a XIVE QEMU model for pseries.\n> > \n> > Thanks,\n> > \n> > C.\n> > \n> > Cédric Le Goater (2):\n> >   powerpc/xive: fix IPI reset\n> >   powerpc/xive: fix cpu removal\n> > \n> >  arch/powerpc/sysdev/xive/common.c | 8 ++++++++\n> >  arch/powerpc/sysdev/xive/spapr.c  | 4 ++++\n> >  2 files changed, 12 insertions(+)\n> >","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"],"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 3y5Stc1MCsz9t6m\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  3 Oct 2017 03:54:16 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3y5Stc0DrFzDqR8\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  3 Oct 2017 03:54:16 +1100 (AEDT)","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 lists.ozlabs.org (Postfix) with ESMTPS id 3y5SsB4zq3zDqR8\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue,  3 Oct 2017 03:53:02 +1100 (AEDT)","from localhost (localhost.localdomain [127.0.0.1])\n\tby gate.crashing.org (8.14.1/8.13.8) with ESMTP id v92Gqb9d013339;\n\tMon, 2 Oct 2017 11:52:38 -0500"],"Authentication-Results":"ozlabs.org; spf=permerror (mailfrom)\n\tsmtp.mailfrom=kernel.crashing.org (client-ip=63.228.1.57;\n\thelo=gate.crashing.org; envelope-from=benh@kernel.crashing.org;\n\treceiver=<UNKNOWN>)","Message-ID":"<1506963157.25065.48.camel@kernel.crashing.org>","Subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","From":"Benjamin Herrenschmidt <benh@kernel.crashing.org>","To":"=?iso-8859-1?q?C=E9dric?= Le Goater <clg@kaod.org>,\n\tlinuxppc-dev@lists.ozlabs.org","Date":"Mon, 02 Oct 2017 18:52:37 +0200","In-Reply-To":"<378a1945-6263-dca7-3912-b4a2c61794b8@kaod.org>","References":"<20170923082656.27219-1-clg@kaod.org>\n\t<378a1945-6263-dca7-3912-b4a2c61794b8@kaod.org>","Content-Type":"text/plain; charset=\"UTF-8\"","X-Mailer":"Evolution 3.24.5 (3.24.5-1.fc26) ","Mime-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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":"David Gibson <david@gibson.dropbear.id.au>","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":1778493,"web_url":"http://patchwork.ozlabs.org/comment/1778493/","msgid":"<1975733a-4c69-a35b-525e-eed1f0d4458c@kaod.org>","date":"2017-10-02T17:53:06","subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","submitter":{"id":68548,"url":"http://patchwork.ozlabs.org/api/people/68548/","name":"Cédric Le Goater","email":"clg@kaod.org"},"content":"On 10/02/2017 06:52 PM, Benjamin Herrenschmidt wrote:\n> On Mon, 2017-10-02 at 18:27 +0200, Cédric Le Goater wrote:\n>> On 09/23/2017 10:26 AM, Cédric Le Goater wrote:\n>>> Hi,\n>>>\n>>> Here are a couple of small fixes to support CPU hot unplug. There are\n>>> still some issues to be investigated as, in some occasions, after a\n>>> couple of plug and unplug, the cpu which was removed receives a 'lost'\n>>> interrupt. This showed to be the decrementer under QEMU.\n>>\n>> So this seems to be a QEMU issue only which can be solved by \n>> removing the DEE bit from the LPCR on P9 processor when the CPU \n>> is stopped in rtas. PECE3 bit on P8 processors. \n> \n> It should be the same bit no ?\n\nyes and it is for the QEMU side of the world. \n\nC.\n \n>> I think these patches are valuable fixes for 4.14. The first \n>> is trivial and the second touches the common xive part but it\n>> is only called on the pseries platform.  \n>>\n>> Could you please take a look ? \n>>\n>> Thanks,\n>>\n>> C. \n>>\n>>> Nevertheless, these patches are required and provide a significant\n>>> improvement to support CPU removal.\n>>>\n>>> Tested under a phyp and a XIVE QEMU model for pseries.\n>>>\n>>> Thanks,\n>>>\n>>> C.\n>>>\n>>> Cédric Le Goater (2):\n>>>   powerpc/xive: fix IPI reset\n>>>   powerpc/xive: fix cpu removal\n>>>\n>>>  arch/powerpc/sysdev/xive/common.c | 8 ++++++++\n>>>  arch/powerpc/sysdev/xive/spapr.c  | 4 ++++\n>>>  2 files changed, 12 insertions(+)\n>>>","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"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\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 3y5VHW0yTrz9t64\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  3 Oct 2017 04:57:27 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3y5VHV6y4QzDqlF\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  3 Oct 2017 04:57:26 +1100 (AEDT)","from 10.mo179.mail-out.ovh.net (10.mo179.mail-out.ovh.net\n\t[46.105.79.46])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3y5VBh3QTxzDqhf\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue,  3 Oct 2017 04:53:15 +1100 (AEDT)","from player168.ha.ovh.net (b6.ovh.net [213.186.33.56])\n\tby mo179.mail-out.ovh.net (Postfix) with ESMTP id 7CF6D6CFBD\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tMon,  2 Oct 2017 19:53:12 +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 player168.ha.ovh.net (Postfix) with ESMTPSA id 3B760420077;\n\tMon,  2 Oct 2017 19:53:07 +0200 (CEST)"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=kaod.org\n\t(client-ip=46.105.79.46; helo=10.mo179.mail-out.ovh.net;\n\tenvelope-from=clg@kaod.org; receiver=<UNKNOWN>)","Subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","To":"Benjamin Herrenschmidt <benh@kernel.crashing.org>,\n\tlinuxppc-dev@lists.ozlabs.org","References":"<20170923082656.27219-1-clg@kaod.org>\n\t<378a1945-6263-dca7-3912-b4a2c61794b8@kaod.org>\n\t<1506963157.25065.48.camel@kernel.crashing.org>","From":"=?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>","Message-ID":"<1975733a-4c69-a35b-525e-eed1f0d4458c@kaod.org>","Date":"Mon, 2 Oct 2017 19:53:06 +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":"<1506963157.25065.48.camel@kernel.crashing.org>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","X-Ovh-Tracer-Id":"9009169582252723174","X-VR-SPAMSTATE":"OK","X-VR-SPAMSCORE":"-100","X-VR-SPAMCAUSE":"gggruggvucftvghtrhhoucdtuddrfeelledrkeeggddutdefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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":"David Gibson <david@gibson.dropbear.id.au>","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":1778722,"web_url":"http://patchwork.ozlabs.org/comment/1778722/","msgid":"<20171003033615.GA3260@umbus.fritz.box>","date":"2017-10-03T03:36:15","subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","submitter":{"id":47,"url":"http://patchwork.ozlabs.org/api/people/47/","name":"David Gibson","email":"david@gibson.dropbear.id.au"},"content":"On Mon, Oct 02, 2017 at 06:27:20PM +0200, Cédric Le Goater wrote:\n> On 09/23/2017 10:26 AM, Cédric Le Goater wrote:\n> > Hi,\n> > \n> > Here are a couple of small fixes to support CPU hot unplug. There are\n> > still some issues to be investigated as, in some occasions, after a\n> > couple of plug and unplug, the cpu which was removed receives a 'lost'\n> > interrupt. This showed to be the decrementer under QEMU.\n> \n> So this seems to be a QEMU issue only which can be solved by \n> removing the DEE bit from the LPCR on P9 processor when the CPU \n> is stopped in rtas. PECE3 bit on P8 processors. \n> \n> I think these patches are valuable fixes for 4.14. The first \n> is trivial and the second touches the common xive part but it\n> is only called on the pseries platform.  \n> \n> Could you please take a look ?\n\nSorry, I think I've missed something here.\n\nIs there a qemu bug involved in this?  Has there been a patch sent\nthat I didn't spot?","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"],"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 3y5mHd0YmWz9t44\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  3 Oct 2017 15:28:29 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3y5mHc6TQfzDqhh\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  3 Oct 2017 15:28:28 +1100 (AEDT)","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 3y5mFt4xmCzDqlT\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue,  3 Oct 2017 15:26:58 +1100 (AEDT)","by ozlabs.org (Postfix, from userid 1007)\n\tid 3y5mFt3t3fz9t48; Tue,  3 Oct 2017 15:26:58 +1100 (AEDT)"],"Authentication-Results":["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=\"p7Q1VhMo\"; \n\tdkim-atps=neutral","lists.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=\"p7Q1VhMo\"; \n\tdkim-atps=neutral","lists.ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gibson.dropbear.id.au\n\theader.i=@gibson.dropbear.id.au\n\theader.b=\"p7Q1VhMo\"; dkim-atps=neutral"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n\td=gibson.dropbear.id.au; s=201602; t=1507004818;\n\tbh=BcGVrF/P25CoMnY2WTttvJOwgAp53LKjY90sy00XAUg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=p7Q1VhMoO3Z2t+okJbyP0M3jsreWK/o41a0eHUnKQD04BaSKx6RPnnl+zdrpBV8k8\n\tCFwJJ7MbBBD13iWy5gT8vzZJAmOppH/mqHQWBzdBmzKJkMNhlBSX+tnq7EBSo1A+3B\n\t2OmuesXJBB/9Ix/+An2fMQGk+bR83eK1+1z/B9SU=","Date":"Tue, 3 Oct 2017 14:36:15 +1100","From":"David Gibson <david@gibson.dropbear.id.au>","To":"=?iso-8859-1?q?C=E9dric?= Le Goater <clg@kaod.org>","Subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","Message-ID":"<20171003033615.GA3260@umbus.fritz.box>","References":"<20170923082656.27219-1-clg@kaod.org>\n\t<378a1945-6263-dca7-3912-b4a2c61794b8@kaod.org>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"DocE+STaALJfprDB\"","Content-Disposition":"inline","In-Reply-To":"<378a1945-6263-dca7-3912-b4a2c61794b8@kaod.org>","User-Agent":"Mutt/1.9.0 (2017-09-02)","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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@lists.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":1778742,"web_url":"http://patchwork.ozlabs.org/comment/1778742/","msgid":"<7f2081f1-415a-85ca-29ed-3ab1467220a7@kaod.org>","date":"2017-10-03T06:24:07","subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","submitter":{"id":68548,"url":"http://patchwork.ozlabs.org/api/people/68548/","name":"Cédric Le Goater","email":"clg@kaod.org"},"content":"On 10/03/2017 05:36 AM, David Gibson wrote:\n> On Mon, Oct 02, 2017 at 06:27:20PM +0200, Cédric Le Goater wrote:\n>> On 09/23/2017 10:26 AM, Cédric Le Goater wrote:\n>>> Hi,\n>>>\n>>> Here are a couple of small fixes to support CPU hot unplug. There are\n>>> still some issues to be investigated as, in some occasions, after a\n>>> couple of plug and unplug, the cpu which was removed receives a 'lost'\n>>> interrupt. This showed to be the decrementer under QEMU.\n>>\n>> So this seems to be a QEMU issue only which can be solved by \n>> removing the DEE bit from the LPCR on P9 processor when the CPU \n>> is stopped in rtas. PECE3 bit on P8 processors. \n>>\n>> I think these patches are valuable fixes for 4.14. The first \n>> is trivial and the second touches the common xive part but it\n>> is only called on the pseries platform.  \n>>\n>> Could you please take a look ?\n> \n> Sorry, I think I've missed something here.\n> \n> Is there a qemu bug involved in this?  Has there been a patch sent\n> that I didn't spot?\n\n\nNo, not yet, but I will today probably. something like below to stop\nthe decrementer when a CPU is stopped:\n\n\t--- qemu.git.orig/hw/ppc/spapr_rtas.c\n\t+++ qemu.git/hw/ppc/spapr_rtas.c\n\t@@ -174,6 +174,15 @@ static void rtas_start_cpu(PowerPCCPU *c\n\t         kvm_cpu_synchronize_state(cs);\n\t \n\t         env->msr = (1ULL << MSR_SF) | (1ULL << MSR_ME);\n\t+\n\t+        /* Enable DECR interrupt */\n\t+        if (env->mmu_model == POWERPC_MMU_3_00) {\n\t+            env->spr[SPR_LPCR] |= LPCR_DEE;\n\t+        } else {\n\t+            /* P7 and P8 both have same bit for DECR */\n\t+            env->spr[SPR_LPCR] |= LPCR_P8_PECE3;\n\t+        }\n\t+\n\t         env->nip = start;\n\t         env->gpr[3] = r3;\n\t         cs->halted = 0;\n\t@@ -210,6 +219,13 @@ static void rtas_stop_self(PowerPCCPU *c\n\t      * no need to bother with specific bits, we just clear it.\n\t      */\n\t     env->msr = 0;\n\t+\n\t+    if (env->mmu_model == POWERPC_MMU_3_00) {\n\t+        env->spr[SPR_LPCR] &= ~LPCR_DEE;\n\t+    } else {\n\t+        /* P7 and P8 both have same bit for DECR */\n\t+        env->spr[SPR_LPCR] &= ~LPCR_P8_PECE3;\n\t+    }\n\t }\n\t \n\t static inline int sysparm_st(target_ulong addr, target_ulong len,\n\t\nI haven't yet because I fail to understand why the decrementer is not \ninterrupting the dying CPU under xics as it is the case under XIVE.\n\nAlso I am not sure this hack is of any use :\n\n    /*\n     * While stopping a CPU, the guest calls H_CPPR which\n     * effectively disables interrupts on XICS level.\n     * However decrementer interrupts in TCG can still\n     * wake the CPU up so here we disable interrupts in MSR\n     * as well.\n     * As rtas_start_cpu() resets the whole MSR anyway, there is\n     * no need to bother with specific bits, we just clear it.\n     */\n    env->msr = 0;\n\nand the different CPU states are confusing. Nikunj already to a look\nat this when trying to fix the TCG reboot. Anyway, the QEMU patch \nshould (re)start a thread. This is not the place to discuss.\n\nThanks,\n\nC.","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"],"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 3y5qGy1VbRz9t2x\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  3 Oct 2017 17:43:06 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3y5qGy0MRFzDqqM\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  3 Oct 2017 17:43:06 +1100 (AEDT)","from 6.mo2.mail-out.ovh.net (6.mo2.mail-out.ovh.net [87.98.165.38])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3y5qFg0CjwzDqhh\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue,  3 Oct 2017 17:41:57 +1100 (AEDT)","from player157.ha.ovh.net (b9.ovh.net [213.186.33.59])\n\tby mo2.mail-out.ovh.net (Postfix) with ESMTP id 17C6BB1FB5\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue,  3 Oct 2017 08:24:14 +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 player157.ha.ovh.net (Postfix) with ESMTPSA id 4648550009C;\n\tTue,  3 Oct 2017 08:24:07 +0200 (CEST)"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=kaod.org\n\t(client-ip=87.98.165.38; helo=6.mo2.mail-out.ovh.net;\n\tenvelope-from=clg@kaod.org; receiver=<UNKNOWN>)","X-Greylist":"delayed 600 seconds by postgrey-1.36 at bilbo;\n\tTue, 03 Oct 2017 17:41:59 AEDT","Subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","To":"David Gibson <david@gibson.dropbear.id.au>","References":"<20170923082656.27219-1-clg@kaod.org>\n\t<378a1945-6263-dca7-3912-b4a2c61794b8@kaod.org>\n\t<20171003033615.GA3260@umbus.fritz.box>","From":"=?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>","Message-ID":"<7f2081f1-415a-85ca-29ed-3ab1467220a7@kaod.org>","Date":"Tue, 3 Oct 2017 08:24:07 +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":"<20171003033615.GA3260@umbus.fritz.box>","Content-Type":"text/plain; charset=windows-1252","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","X-Ovh-Tracer-Id":"3246532385087523697","X-VR-SPAMSTATE":"OK","X-VR-SPAMSCORE":"-100","X-VR-SPAMCAUSE":"gggruggvucftvghtrhhoucdtuddrfeelledrkeehgdduudeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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@lists.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":1778746,"web_url":"http://patchwork.ozlabs.org/comment/1778746/","msgid":"<20171003065858.GL3260@umbus.fritz.box>","date":"2017-10-03T06:58:58","subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","submitter":{"id":47,"url":"http://patchwork.ozlabs.org/api/people/47/","name":"David Gibson","email":"david@gibson.dropbear.id.au"},"content":"On Tue, Oct 03, 2017 at 08:24:07AM +0200, Cédric Le Goater wrote:\n> On 10/03/2017 05:36 AM, David Gibson wrote:\n> > On Mon, Oct 02, 2017 at 06:27:20PM +0200, Cédric Le Goater wrote:\n> >> On 09/23/2017 10:26 AM, Cédric Le Goater wrote:\n> >>> Hi,\n> >>>\n> >>> Here are a couple of small fixes to support CPU hot unplug. There are\n> >>> still some issues to be investigated as, in some occasions, after a\n> >>> couple of plug and unplug, the cpu which was removed receives a 'lost'\n> >>> interrupt. This showed to be the decrementer under QEMU.\n> >>\n> >> So this seems to be a QEMU issue only which can be solved by \n> >> removing the DEE bit from the LPCR on P9 processor when the CPU \n> >> is stopped in rtas. PECE3 bit on P8 processors. \n> >>\n> >> I think these patches are valuable fixes for 4.14. The first \n> >> is trivial and the second touches the common xive part but it\n> >> is only called on the pseries platform.  \n> >>\n> >> Could you please take a look ?\n> > \n> > Sorry, I think I've missed something here.\n> > \n> > Is there a qemu bug involved in this?  Has there been a patch sent\n> > that I didn't spot?\n> \n> \n> No, not yet, but I will today probably. something like below to stop\n> the decrementer when a CPU is stopped:\n> \n> \t--- qemu.git.orig/hw/ppc/spapr_rtas.c\n> \t+++ qemu.git/hw/ppc/spapr_rtas.c\n> \t@@ -174,6 +174,15 @@ static void rtas_start_cpu(PowerPCCPU *c\n> \t         kvm_cpu_synchronize_state(cs);\n> \t \n> \t         env->msr = (1ULL << MSR_SF) | (1ULL << MSR_ME);\n> \t+\n> \t+        /* Enable DECR interrupt */\n> \t+        if (env->mmu_model == POWERPC_MMU_3_00) {\n> \t+            env->spr[SPR_LPCR] |= LPCR_DEE;\n> \t+        } else {\n> \t+            /* P7 and P8 both have same bit for DECR */\n> \t+            env->spr[SPR_LPCR] |= LPCR_P8_PECE3;\n> \t+        }\n> \t+\n> \t         env->nip = start;\n> \t         env->gpr[3] = r3;\n> \t         cs->halted = 0;\n> \t@@ -210,6 +219,13 @@ static void rtas_stop_self(PowerPCCPU *c\n> \t      * no need to bother with specific bits, we just clear it.\n> \t      */\n> \t     env->msr = 0;\n> \t+\n> \t+    if (env->mmu_model == POWERPC_MMU_3_00) {\n> \t+        env->spr[SPR_LPCR] &= ~LPCR_DEE;\n> \t+    } else {\n> \t+        /* P7 and P8 both have same bit for DECR */\n> \t+        env->spr[SPR_LPCR] &= ~LPCR_P8_PECE3;\n> \t+    }\n> \t }\n> \t \n> \t static inline int sysparm_st(target_ulong addr, target_ulong len,\n> \t\n> I haven't yet because I fail to understand why the decrementer is not \n> interrupting the dying CPU under xics as it is the case under XIVE.\n\nOh.. ok.  This sounds very similar to the problem Nikunj hit under TCG\nwith decrementer interrupts waking up a supposedly dead CPU.  He had a\ncouple of proposed fixes, but we got bogged down trying to work out\nwhy  (with TCG at least) it only seemed to bite after a system_reset,\nand not on initial boot up.\n\n> Also I am not sure this hack is of any use :\n> \n>     /*\n>      * While stopping a CPU, the guest calls H_CPPR which\n>      * effectively disables interrupts on XICS level.\n>      * However decrementer interrupts in TCG can still\n>      * wake the CPU up so here we disable interrupts in MSR\n>      * as well.\n>      * As rtas_start_cpu() resets the whole MSR anyway, there is\n>      * no need to bother with specific bits, we just clear it.\n>      */\n>     env->msr = 0;\n\nOk.. why do you think this isn't of use?  I'm pretty sure this is\nnecessary for the TCG case, since MSR is checked in cpu_has_work(),\nwhich could otherwise wake up the \"dead\" cpu.\n\n> and the different CPU states are confusing. Nikunj already to a look\n> at this when trying to fix the TCG reboot. Anyway, the QEMU patch \n> should (re)start a thread. This is not the place to discuss.\n> \n> Thanks,\n> \n> C.  \n> \n>","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"],"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 3y5qfz4SVSz9t42\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  3 Oct 2017 18:00:27 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3y5qfz3BhpzDqln\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  3 Oct 2017 18:00:27 +1100 (AEDT)","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 3y5qdM4KDwzDqhh\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue,  3 Oct 2017 17:59:03 +1100 (AEDT)","by ozlabs.org (Postfix, from userid 1007)\n\tid 3y5qdM3KHFz9t5R; Tue,  3 Oct 2017 17:59:03 +1100 (AEDT)"],"Authentication-Results":["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=\"idbsGqxB\"; \n\tdkim-atps=neutral","lists.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=\"idbsGqxB\"; \n\tdkim-atps=neutral","lists.ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gibson.dropbear.id.au\n\theader.i=@gibson.dropbear.id.au\n\theader.b=\"idbsGqxB\"; dkim-atps=neutral"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n\td=gibson.dropbear.id.au; s=201602; t=1507013943;\n\tbh=+Dv290YNl+sZh50vY27jbsC7E1ASMECUYSGu3qdfrEs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=idbsGqxBNSylpkKWjuDkAm0moZuUWjAtjv+SmnV6uw7Hdtzt+N6a3V+bDBXOgIlE4\n\teWHxyICSTf5rKFXfcu1vTqRhAqZU9Pv/xC8VxjprBvT9intmE3Pry+lSzuWY0JyDv4\n\toCjTeAgleXFb46FB1SeRxFPGx+wRD9z32pAiPWJI=","Date":"Tue, 3 Oct 2017 17:58:58 +1100","From":"David Gibson <david@gibson.dropbear.id.au>","To":"=?iso-8859-1?q?C=E9dric?= Le Goater <clg@kaod.org>","Subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","Message-ID":"<20171003065858.GL3260@umbus.fritz.box>","References":"<20170923082656.27219-1-clg@kaod.org>\n\t<378a1945-6263-dca7-3912-b4a2c61794b8@kaod.org>\n\t<20171003033615.GA3260@umbus.fritz.box>\n\t<7f2081f1-415a-85ca-29ed-3ab1467220a7@kaod.org>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"GeDkoc8jIzHasOdk\"","Content-Disposition":"inline","In-Reply-To":"<7f2081f1-415a-85ca-29ed-3ab1467220a7@kaod.org>","User-Agent":"Mutt/1.9.0 (2017-09-02)","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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@lists.ozlabs.org, nikunj@linux.vnet.ibm.com","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":1778768,"web_url":"http://patchwork.ozlabs.org/comment/1778768/","msgid":"<1507018960.25065.52.camel@kernel.crashing.org>","date":"2017-10-03T08:22:40","subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","submitter":{"id":38,"url":"http://patchwork.ozlabs.org/api/people/38/","name":"Benjamin Herrenschmidt","email":"benh@kernel.crashing.org"},"content":"On Tue, 2017-10-03 at 17:58 +1100, David Gibson wrote:\n> \n> Ok.. why do you think this isn't of use?  I'm pretty sure this is\n> necessary for the TCG case, since MSR is checked in cpu_has_work(),\n> which could otherwise wake up the \"dead\" cpu.\n\nOny if it's not in a PM state, in that case we check the corresponding\nLPCR:PECE* bit. At least on P7 and later.\n\nCheers,\nBen.","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"],"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 3y5sWW35WFz9t48\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  3 Oct 2017 19:24:07 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3y5sWW2CTxzDqjv\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  3 Oct 2017 19:24:07 +1100 (AEDT)","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 lists.ozlabs.org (Postfix) with ESMTPS id 3y5sVL6JY3zDqhh\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue,  3 Oct 2017 19:23:06 +1100 (AEDT)","from localhost (localhost.localdomain [127.0.0.1])\n\tby gate.crashing.org (8.14.1/8.13.8) with ESMTP id v938MeBo010229;\n\tTue, 3 Oct 2017 03:22:43 -0500"],"Authentication-Results":"ozlabs.org; spf=permerror (mailfrom)\n\tsmtp.mailfrom=kernel.crashing.org (client-ip=63.228.1.57;\n\thelo=gate.crashing.org; envelope-from=benh@kernel.crashing.org;\n\treceiver=<UNKNOWN>)","Message-ID":"<1507018960.25065.52.camel@kernel.crashing.org>","Subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","From":"Benjamin Herrenschmidt <benh@kernel.crashing.org>","To":"David Gibson <david@gibson.dropbear.id.au>, =?iso-8859-1?q?C=E9dric?=\n\tLe Goater <clg@kaod.org>","Date":"Tue, 03 Oct 2017 10:22:40 +0200","In-Reply-To":"<20171003065858.GL3260@umbus.fritz.box>","References":"<20170923082656.27219-1-clg@kaod.org>\n\t<378a1945-6263-dca7-3912-b4a2c61794b8@kaod.org>\n\t<20171003033615.GA3260@umbus.fritz.box>\n\t<7f2081f1-415a-85ca-29ed-3ab1467220a7@kaod.org>\n\t<20171003065858.GL3260@umbus.fritz.box>","Content-Type":"text/plain; charset=\"UTF-8\"","X-Mailer":"Evolution 3.24.5 (3.24.5-1.fc26) ","Mime-Version":"1.0","Content-Transfer-Encoding":"7bit","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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@lists.ozlabs.org, nikunj@linux.vnet.ibm.com","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":1778848,"web_url":"http://patchwork.ozlabs.org/comment/1778848/","msgid":"<87poa4cw5x.fsf@concordia.ellerman.id.au>","date":"2017-10-03T11:23:22","subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","submitter":{"id":46580,"url":"http://patchwork.ozlabs.org/api/people/46580/","name":"Michael Ellerman","email":"mpe@ellerman.id.au"},"content":"Cédric Le Goater <clg@kaod.org> writes:\n\n> On 09/23/2017 10:26 AM, Cédric Le Goater wrote:\n>> Hi,\n>> \n>> Here are a couple of small fixes to support CPU hot unplug. There are\n>> still some issues to be investigated as, in some occasions, after a\n>> couple of plug and unplug, the cpu which was removed receives a 'lost'\n>> interrupt. This showed to be the decrementer under QEMU.\n>\n> So this seems to be a QEMU issue only which can be solved by \n> removing the DEE bit from the LPCR on P9 processor when the CPU \n> is stopped in rtas. PECE3 bit on P8 processors. \n>\n> I think these patches are valuable fixes for 4.14. The first \n> is trivial and the second touches the common xive part but it\n> is only called on the pseries platform.  \n>\n> Could you please take a look ? \n\nI can.\n\nYou didn't give me much indication in the change logs of what the\nfailure mode is if I _don't_ have the fixes, which makes it hard for me\nto assess the severity. Can you flesh out the \".. or else\" case in the\nchange logs?\n\nAnd should both be tagged?\n\n  Fixes: eac1e731b59e (\"powerpc/xive: guest exploitation of the XIVE interrupt controller\")\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"],"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 3y5xY70cXPz9sBZ\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  3 Oct 2017 22:25:47 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3y5xY66fGDzDr2k\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  3 Oct 2017 22:25:46 +1100 (AEDT)","from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2])\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 3y5xVN2d5nzDqpT\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue,  3 Oct 2017 22:23:24 +1100 (AEDT)","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 3y5xVN07nGz9s8J;\n\tTue,  3 Oct 2017 22:23:23 +1100 (AEDT)"],"From":"Michael Ellerman <mpe@ellerman.id.au>","To":"=?utf-8?q?C=C3=A9dric?= Le Goater <clg@kaod.org>,\n\tlinuxppc-dev@lists.ozlabs.org","Subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","In-Reply-To":"<378a1945-6263-dca7-3912-b4a2c61794b8@kaod.org>","References":"<20170923082656.27219-1-clg@kaod.org>\n\t<378a1945-6263-dca7-3912-b4a2c61794b8@kaod.org>","Date":"Tue, 03 Oct 2017 22:23:22 +1100","Message-ID":"<87poa4cw5x.fsf@concordia.ellerman.id.au>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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":"David Gibson <david@gibson.dropbear.id.au>","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":1778951,"web_url":"http://patchwork.ozlabs.org/comment/1778951/","msgid":"<741baa16-163d-b269-b4ed-7218ef64a166@kaod.org>","date":"2017-10-03T12:58:19","subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","submitter":{"id":68548,"url":"http://patchwork.ozlabs.org/api/people/68548/","name":"Cédric Le Goater","email":"clg@kaod.org"},"content":"Hello Michael,\n\nOn 10/03/2017 01:23 PM, Michael Ellerman wrote:\n> Cédric Le Goater <clg@kaod.org> writes:\n> \n>> On 09/23/2017 10:26 AM, Cédric Le Goater wrote:\n>>> Hi,\n>>>\n>>> Here are a couple of small fixes to support CPU hot unplug. There are\n>>> still some issues to be investigated as, in some occasions, after a\n>>> couple of plug and unplug, the cpu which was removed receives a 'lost'\n>>> interrupt. This showed to be the decrementer under QEMU.\n>>\n>> So this seems to be a QEMU issue only which can be solved by \n>> removing the DEE bit from the LPCR on P9 processor when the CPU \n>> is stopped in rtas. PECE3 bit on P8 processors. \n>>\n>> I think these patches are valuable fixes for 4.14. The first \n>> is trivial and the second touches the common xive part but it\n>> is only called on the pseries platform.  \n>>\n>> Could you please take a look ? \n> \n> I can.\n> \n> You didn't give me much indication in the change logs of what the\n> failure mode is if I _don't_ have the fixes, which makes it hard for me\n> to assess the severity.\nSupport for CPU removal came recently on PowerVM and was not\ntested when the patchset was sent. A couple of cleanups of the \nXIVE internal structures are missing resulting in a kernel crash \nwhen the CPU is released. \n\nThere are still some corner cases when stressing the lpar with \nplug/unplug loops. Investigation in progress.  \n\n> Can you flesh out the \".. or else\" case in the change logs?\n\nOK. I will improve patch 2 changelog.\n\n> And should both be tagged?\n> \n>   Fixes: eac1e731b59e (\"powerpc/xive: guest exploitation of the XIVE interrupt controller\")\nyes I think so. These patches are too small to be tagged as \nadding hotplug support.\n\nThanks,\n\nC.","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"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\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 3y5zrr36tYz9sP1\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed,  4 Oct 2017 00:09:32 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3y5zrr1s9RzDqn0\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed,  4 Oct 2017 00:09:32 +1100 (AEDT)","from 8.mo4.mail-out.ovh.net (8.mo4.mail-out.ovh.net\n\t[188.165.33.112])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3y5zq675SrzDqNm\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tWed,  4 Oct 2017 00:08:02 +1100 (AEDT)","from player746.ha.ovh.net (b6.ovh.net [213.186.33.56])\n\tby mo4.mail-out.ovh.net (Postfix) with ESMTP id 766AABD3C5\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue,  3 Oct 2017 14:58:25 +0200 (CEST)","from zorba.kaod.org (deibp9eh1--blueice3n7.emea.ibm.com\n\t[195.212.29.177]) (Authenticated sender: postmaster@kaod.org)\n\tby player746.ha.ovh.net (Postfix) with ESMTPSA id 2039F500081;\n\tTue,  3 Oct 2017 14:58:20 +0200 (CEST)"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=kaod.org\n\t(client-ip=188.165.33.112; helo=8.mo4.mail-out.ovh.net;\n\tenvelope-from=clg@kaod.org; receiver=<UNKNOWN>)","X-Greylist":"delayed 571 seconds by postgrey-1.36 at bilbo;\n\tWed, 04 Oct 2017 00:08:02 AEDT","Subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","To":"Michael Ellerman <mpe@ellerman.id.au>, linuxppc-dev@lists.ozlabs.org","References":"<20170923082656.27219-1-clg@kaod.org>\n\t<378a1945-6263-dca7-3912-b4a2c61794b8@kaod.org>\n\t<87poa4cw5x.fsf@concordia.ellerman.id.au>","From":"=?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>","Message-ID":"<741baa16-163d-b269-b4ed-7218ef64a166@kaod.org>","Date":"Tue, 3 Oct 2017 14:58:19 +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":"<87poa4cw5x.fsf@concordia.ellerman.id.au>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","X-Ovh-Tracer-Id":"9903415584600067046","X-VR-SPAMSTATE":"OK","X-VR-SPAMSCORE":"-100","X-VR-SPAMCAUSE":"gggruggvucftvghtrhhoucdtuddrfeelledrkeejgdefvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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":"David Gibson <david@gibson.dropbear.id.au>","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":1779931,"web_url":"http://patchwork.ozlabs.org/comment/1779931/","msgid":"<fa6c0a3f-d350-9ee6-4cb5-3c5996da391a@kaod.org>","date":"2017-10-04T14:48:51","subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","submitter":{"id":68548,"url":"http://patchwork.ozlabs.org/api/people/68548/","name":"Cédric Le Goater","email":"clg@kaod.org"},"content":"On 10/03/2017 08:58 AM, David Gibson wrote:\n> On Tue, Oct 03, 2017 at 08:24:07AM +0200, Cédric Le Goater wrote:\n>> On 10/03/2017 05:36 AM, David Gibson wrote:\n>>> On Mon, Oct 02, 2017 at 06:27:20PM +0200, Cédric Le Goater wrote:\n>>>> On 09/23/2017 10:26 AM, Cédric Le Goater wrote:\n>>>>> Hi,\n>>>>>\n>>>>> Here are a couple of small fixes to support CPU hot unplug. There are\n>>>>> still some issues to be investigated as, in some occasions, after a\n>>>>> couple of plug and unplug, the cpu which was removed receives a 'lost'\n>>>>> interrupt. This showed to be the decrementer under QEMU.\n>>>>\n>>>> So this seems to be a QEMU issue only which can be solved by \n>>>> removing the DEE bit from the LPCR on P9 processor when the CPU \n>>>> is stopped in rtas. PECE3 bit on P8 processors. \n>>>>\n>>>> I think these patches are valuable fixes for 4.14. The first \n>>>> is trivial and the second touches the common xive part but it\n>>>> is only called on the pseries platform.  \n>>>>\n>>>> Could you please take a look ?\n>>>\n>>> Sorry, I think I've missed something here.\n>>>\n>>> Is there a qemu bug involved in this?  Has there been a patch sent\n>>> that I didn't spot?\n>>\n>>\n>> No, not yet, but I will today probably. something like below to stop\n>> the decrementer when a CPU is stopped:\n>>\n>> \t--- qemu.git.orig/hw/ppc/spapr_rtas.c\n>> \t+++ qemu.git/hw/ppc/spapr_rtas.c\n>> \t@@ -174,6 +174,15 @@ static void rtas_start_cpu(PowerPCCPU *c\n>> \t         kvm_cpu_synchronize_state(cs);\n>> \t \n>> \t         env->msr = (1ULL << MSR_SF) | (1ULL << MSR_ME);\n>> \t+\n>> \t+        /* Enable DECR interrupt */\n>> \t+        if (env->mmu_model == POWERPC_MMU_3_00) {\n>> \t+            env->spr[SPR_LPCR] |= LPCR_DEE;\n>> \t+        } else {\n>> \t+            /* P7 and P8 both have same bit for DECR */\n>> \t+            env->spr[SPR_LPCR] |= LPCR_P8_PECE3;\n>> \t+        }\n>> \t+\n>> \t         env->nip = start;\n>> \t         env->gpr[3] = r3;\n>> \t         cs->halted = 0;\n>> \t@@ -210,6 +219,13 @@ static void rtas_stop_self(PowerPCCPU *c\n>> \t      * no need to bother with specific bits, we just clear it.\n>> \t      */\n>> \t     env->msr = 0;\n>> \t+\n>> \t+    if (env->mmu_model == POWERPC_MMU_3_00) {\n>> \t+        env->spr[SPR_LPCR] &= ~LPCR_DEE;\n>> \t+    } else {\n>> \t+        /* P7 and P8 both have same bit for DECR */\n>> \t+        env->spr[SPR_LPCR] &= ~LPCR_P8_PECE3;\n>> \t+    }\n>> \t }\n>> \t \n>> \t static inline int sysparm_st(target_ulong addr, target_ulong len,\n>> \t\n>> I haven't yet because I fail to understand why the decrementer is not \n>> interrupting the dying CPU under xics as it is the case under XIVE.\n> \n> Oh.. ok.  This sounds very similar to the problem Nikunj hit under TCG\n> with decrementer interrupts waking up a supposedly dead CPU.  He had a\n> couple of proposed fixes, but we got bogged down trying to work out\n> why  (with TCG at least) it only seemed to bite after a system_reset,\n> and not on initial boot up.\n\nyes. It would be nice to fix the reset under TCG though. May be this is\nrelated. \n\n>> Also I am not sure this hack is of any use :\n>>\n>>     /*\n>>      * While stopping a CPU, the guest calls H_CPPR which\n>>      * effectively disables interrupts on XICS level.\n>>      * However decrementer interrupts in TCG can still\n>>      * wake the CPU up so here we disable interrupts in MSR\n>>      * as well.\n>>      * As rtas_start_cpu() resets the whole MSR anyway, there is\n>>      * no need to bother with specific bits, we just clear it.\n>>      */\n>>     env->msr = 0;\n> \n> Ok.. why do you think this isn't of use?  I'm pretty sure this is\n> necessary for the TCG case, since MSR is checked in cpu_has_work(),\n> which could otherwise wake up the \"dead\" cpu.\n\nwell, no, when the CPU is stopped with the 'stop-self' RTAS call, one of \nthe CPU states is switched to 1 (cs->halted=1). In cpu_has_work(), this \nis a branch in which we don't check the MSR, only pending hardware \ninterrupts are checked with their LPCR enablement bit.\n\nSo if the DECR timer fires after 'stop-self' is called (cs->halted=1) and \nbefore it is really stopped (cs->stop=1), the nearly-dead CPU will have \nsome work to do and the guest will crash. This case happens very frequently \nwhen the P9 XIVE exploitation mode is activated but it does not without, \nwhen using the XICS mode. In XICS mode, the DECR is occasionally fired but \nafter cs->stop=1, so no work is to be done.\n \nThe patch above fixes the problem but I don't understand why this works \nwith XICS. My feeling is that there is a race somewhere and \n\n\tenv->msr = 0;\n\nis just a useless workaround, in this case at least. \n\nC.\n\n\n> \n>> and the different CPU states are confusing. Nikunj already to a look\n>> at this when trying to fix the TCG reboot. Anyway, the QEMU patch \n>> should (re)start a thread. This is not the place to discuss.\n>>\n>> Thanks,\n>>\n>> C.  \n>>\n>>\n>","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"],"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 3y6fvZ51zPz9t1G\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  5 Oct 2017 02:29:14 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3y6fvZ3hvbzDr0G\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  5 Oct 2017 02:29:14 +1100 (AEDT)","from 10.mo178.mail-out.ovh.net (10.mo178.mail-out.ovh.net\n\t[46.105.76.150])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3y6ftD3Y12zDqtT\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu,  5 Oct 2017 02:28:03 +1100 (AEDT)","from player728.ha.ovh.net (b6.ovh.net [213.186.33.56])\n\tby mo178.mail-out.ovh.net (Postfix) with ESMTP id 1172C58CCF\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tWed,  4 Oct 2017 16:48:58 +0200 (CEST)","from zorba.kaod.org (deibp9eh1--blueice3n7.emea.ibm.com\n\t[195.212.29.177]) (Authenticated sender: postmaster@kaod.org)\n\tby player728.ha.ovh.net (Postfix) with ESMTPSA id CA2B454008F;\n\tWed,  4 Oct 2017 16:48:51 +0200 (CEST)"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=kaod.org\n\t(client-ip=46.105.76.150; helo=10.mo178.mail-out.ovh.net;\n\tenvelope-from=clg@kaod.org; receiver=<UNKNOWN>)","X-Greylist":"delayed 168919 seconds by postgrey-1.36 at bilbo;\n\tThu, 05 Oct 2017 02:28:04 AEDT","Subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","To":"David Gibson <david@gibson.dropbear.id.au>","References":"<20170923082656.27219-1-clg@kaod.org>\n\t<378a1945-6263-dca7-3912-b4a2c61794b8@kaod.org>\n\t<20171003033615.GA3260@umbus.fritz.box>\n\t<7f2081f1-415a-85ca-29ed-3ab1467220a7@kaod.org>\n\t<20171003065858.GL3260@umbus.fritz.box>","From":"=?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>","Message-ID":"<fa6c0a3f-d350-9ee6-4cb5-3c5996da391a@kaod.org>","Date":"Wed, 4 Oct 2017 16:48:51 +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":"<20171003065858.GL3260@umbus.fritz.box>","Content-Type":"text/plain; charset=windows-1252","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","X-Ovh-Tracer-Id":"17643414491425966909","X-VR-SPAMSTATE":"OK","X-VR-SPAMSCORE":"-100","X-VR-SPAMCAUSE":"gggruggvucftvghtrhhoucdtuddrfeelledrkeelgdekvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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@lists.ozlabs.org, nikunj@linux.vnet.ibm.com","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":1780258,"web_url":"http://patchwork.ozlabs.org/comment/1780258/","msgid":"<87infui863.fsf@localhost.localdomain.i-did-not-set--mail-host-address--so-tickle-me>","date":"2017-10-05T03:29:40","subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","submitter":{"id":17189,"url":"http://patchwork.ozlabs.org/api/people/17189/","name":"Nikunj A Dadhania","email":"nikunj@linux.vnet.ibm.com"},"content":"David Gibson <david@gibson.dropbear.id.au> writes:\n\n> On Tue, Oct 03, 2017 at 08:24:07AM +0200, Cédric Le Goater wrote:\n>> On 10/03/2017 05:36 AM, David Gibson wrote:\n>> > On Mon, Oct 02, 2017 at 06:27:20PM +0200, Cédric Le Goater wrote:\n>> >> On 09/23/2017 10:26 AM, Cédric Le Goater wrote:\n>> >>> Hi,\n>> >>>\n>> >>> Here are a couple of small fixes to support CPU hot unplug. There are\n>> >>> still some issues to be investigated as, in some occasions, after a\n>> >>> couple of plug and unplug, the cpu which was removed receives a 'lost'\n>> >>> interrupt. This showed to be the decrementer under QEMU.\n>> >>\n>> >> So this seems to be a QEMU issue only which can be solved by \n>> >> removing the DEE bit from the LPCR on P9 processor when the CPU \n>> >> is stopped in rtas. PECE3 bit on P8 processors. \n>> >>\n>> >> I think these patches are valuable fixes for 4.14. The first \n>> >> is trivial and the second touches the common xive part but it\n>> >> is only called on the pseries platform.  \n>> >>\n>> >> Could you please take a look ?\n>> > \n>> > Sorry, I think I've missed something here.\n>> > \n>> > Is there a qemu bug involved in this?  Has there been a patch sent\n>> > that I didn't spot?\n>> \n>> \n>> No, not yet, but I will today probably. something like below to stop\n>> the decrementer when a CPU is stopped:\n>> \n>> \t--- qemu.git.orig/hw/ppc/spapr_rtas.c\n>> \t+++ qemu.git/hw/ppc/spapr_rtas.c\n>> \t@@ -174,6 +174,15 @@ static void rtas_start_cpu(PowerPCCPU *c\n>> \t         kvm_cpu_synchronize_state(cs);\n>> \t \n>> \t         env->msr = (1ULL << MSR_SF) | (1ULL << MSR_ME);\n>> \t+\n>> \t+        /* Enable DECR interrupt */\n>> \t+        if (env->mmu_model == POWERPC_MMU_3_00) {\n>> \t+            env->spr[SPR_LPCR] |= LPCR_DEE;\n>> \t+        } else {\n>> \t+            /* P7 and P8 both have same bit for DECR */\n>> \t+            env->spr[SPR_LPCR] |= LPCR_P8_PECE3;\n>> \t+        }\n>> \t+\n>> \t         env->nip = start;\n>> \t         env->gpr[3] = r3;\n>> \t         cs->halted = 0;\n>> \t@@ -210,6 +219,13 @@ static void rtas_stop_self(PowerPCCPU *c\n>> \t      * no need to bother with specific bits, we just clear it.\n>> \t      */\n>> \t     env->msr = 0;\n>> \t+\n>> \t+    if (env->mmu_model == POWERPC_MMU_3_00) {\n>> \t+        env->spr[SPR_LPCR] &= ~LPCR_DEE;\n>> \t+    } else {\n>> \t+        /* P7 and P8 both have same bit for DECR */\n>> \t+        env->spr[SPR_LPCR] &= ~LPCR_P8_PECE3;\n>> \t+    }\n>> \t }\n>> \t \n>> \t static inline int sysparm_st(target_ulong addr, target_ulong len,\n>> \t\n>> I haven't yet because I fail to understand why the decrementer is not \n>> interrupting the dying CPU under xics as it is the case under XIVE.\n>\n> Oh.. ok.  This sounds very similar to the problem Nikunj hit under TCG\n> with decrementer interrupts waking up a supposedly dead CPU.  He had a\n> couple of proposed fixes, but we got bogged down trying to work out\n> why  (with TCG at least).\n\nYeah, I wasnt able to get to the exact reason for that.\n\nRegards\nNikunj","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"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\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 3y6ywf1lrVz9t3k\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  5 Oct 2017 14:31:14 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3y6ywf0pH9zDr59\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  5 Oct 2017 14:31:14 +1100 (AEDT)","from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n\t[148.163.156.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3y6yv45NhSzDr3G\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu,  5 Oct 2017 14:29:52 +1100 (AEDT)","from pps.filterd (m0098409.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv953TbL8064636\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 4 Oct 2017 23:29:50 -0400","from e23smtp01.au.ibm.com (e23smtp01.au.ibm.com [202.81.31.143])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2dd5p72tae-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 04 Oct 2017 23:29:50 -0400","from localhost\n\tby e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from <nikunj@linux.vnet.ibm.com>; \n\tThu, 5 Oct 2017 13:29:48 +1000","from d23relay08.au.ibm.com (202.81.31.227)\n\tby e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tThu, 5 Oct 2017 13:29:45 +1000","from d23av06.au.ibm.com (d23av06.au.ibm.com [9.190.235.151])\n\tby d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tv953TjBt42991834\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 5 Oct 2017 14:29:45 +1100","from d23av06.au.ibm.com (localhost [127.0.0.1])\n\tby d23av06.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tv953Ti6j030482\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 5 Oct 2017 14:29:44 +1100","from localhost.localdomain.vnet.linux.ibm.com ([9.124.35.166])\n\tby d23av06.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tv953TeiD030417\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=NO); Thu, 5 Oct 2017 14:29:42 +1100"],"Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com\n\t(client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com;\n\tenvelope-from=nikunj@linux.vnet.ibm.com; receiver=<UNKNOWN>)","From":"Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>","To":"David Gibson <david@gibson.dropbear.id.au>, =?utf-8?q?C=C3=A9dric?= Le\n\tGoater <clg@kaod.org>","Subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","In-Reply-To":"<20171003065858.GL3260@umbus.fritz.box>","References":"<20170923082656.27219-1-clg@kaod.org>\n\t<378a1945-6263-dca7-3912-b4a2c61794b8@kaod.org>\n\t<20171003033615.GA3260@umbus.fritz.box>\n\t<7f2081f1-415a-85ca-29ed-3ab1467220a7@kaod.org>\n\t<20171003065858.GL3260@umbus.fritz.box>","Date":"Thu, 05 Oct 2017 08:59:40 +0530","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","X-TM-AS-MML":"disable","x-cbid":"17100503-1617-0000-0000-00000201DA49","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17100503-1618-0000-0000-00004852595D","Message-Id":"<87infui863.fsf@localhost.localdomain.i-did-not-set--mail-host-address--so-tickle-me>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-10-05_01:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=1\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1710050045","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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@lists.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":1780406,"web_url":"http://patchwork.ozlabs.org/comment/1780406/","msgid":"<da27cec5-2b09-9fb6-6eee-41b5a57e5127@kaod.org>","date":"2017-10-05T08:18:51","subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","submitter":{"id":68548,"url":"http://patchwork.ozlabs.org/api/people/68548/","name":"Cédric Le Goater","email":"clg@kaod.org"},"content":">>> I haven't yet because I fail to understand why the decrementer is not \n>>> interrupting the dying CPU under xics as it is the case under XIVE.\n>>\n>> Oh.. ok.  This sounds very similar to the problem Nikunj hit under TCG\n>> with decrementer interrupts waking up a supposedly dead CPU.  He had a\n>> couple of proposed fixes, but we got bogged down trying to work out\n>> why  (with TCG at least).\n> \n> Yeah, I wasnt able to get to the exact reason for that.\n\nYes. Tracking all the CPU states is a nightmare.\n\n * @running: #true if CPU is currently running (lockless).\n * @has_waiter: #true if a CPU is currently waiting for the cpu_exec_end;\n * valid under cpu_list_lock.\n * @created: Indicates whether the CPU thread has been successfully created.\n * @interrupt_request: Indicates a pending interrupt request.\n * @halted: Nonzero if the CPU is in suspended state.\n * @stop: Indicates a pending stop request.\n * @stopped: Indicates the CPU has been artificially stopped.\n * @unplug: Indicates a pending CPU unplug request.\n\n\nI will spend some more time to understand why XICS is not behaving \nthe same. This is really time consuming ...\n\nC.","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"],"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 3y76YP0QB0z9t2x\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  5 Oct 2017 20:15:05 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3y76YN6YP3zDrGr\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  5 Oct 2017 20:15:04 +1100 (AEDT)","from 14.mo4.mail-out.ovh.net (14.mo4.mail-out.ovh.net\n\t[46.105.40.29])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3y76X14d7TzDr5L\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu,  5 Oct 2017 20:13:52 +1100 (AEDT)","from player746.ha.ovh.net (b6.ovh.net [213.186.33.56])\n\tby mo4.mail-out.ovh.net (Postfix) with ESMTP id 07616C3301\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu,  5 Oct 2017 10:18:57 +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 player746.ha.ovh.net (Postfix) with ESMTPSA id B4EEA5000B0;\n\tThu,  5 Oct 2017 10:18:51 +0200 (CEST)"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=kaod.org\n\t(client-ip=46.105.40.29; helo=14.mo4.mail-out.ovh.net;\n\tenvelope-from=clg@kaod.org; receiver=<UNKNOWN>)","Subject":"Re: [PATCH 0/2] powerpc/xive: fix CPU hot unplug","To":"Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>,\n\tDavid Gibson <david@gibson.dropbear.id.au>","References":"<20170923082656.27219-1-clg@kaod.org>\n\t<378a1945-6263-dca7-3912-b4a2c61794b8@kaod.org>\n\t<20171003033615.GA3260@umbus.fritz.box>\n\t<7f2081f1-415a-85ca-29ed-3ab1467220a7@kaod.org>\n\t<20171003065858.GL3260@umbus.fritz.box>\n\t<87infui863.fsf@localhost.localdomain.i-did-not-set--mail-host-address--so-tickle-me>","From":"=?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>","Message-ID":"<da27cec5-2b09-9fb6-6eee-41b5a57e5127@kaod.org>","Date":"Thu, 5 Oct 2017 10:18:51 +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":"<87infui863.fsf@localhost.localdomain.i-did-not-set--mail-host-address--so-tickle-me>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Ovh-Tracer-Id":"16929312476582939505","X-VR-SPAMSTATE":"OK","X-VR-SPAMSCORE":"-100","X-VR-SPAMCAUSE":"gggruggvucftvghtrhhoucdtuddrfeelledrledugddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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@lists.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>"}}]