[{"id":1765888,"web_url":"http://patchwork.ozlabs.org/comment/1765888/","msgid":"<20170910015814.GW2735@umbus.fritz.box>","list_archive_url":null,"date":"2017-09-10T01:58:14","subject":"Re: [Qemu-devel] [PATCH 1/4] spapr: only update SDR1 once per-cpu\n\tduring CAS","submitter":{"id":47,"url":"http://patchwork.ozlabs.org/api/people/47/","name":"David Gibson","email":"david@gibson.dropbear.id.au"},"content":"On Mon, Sep 04, 2017 at 11:46:55PM +0200, Greg Kurz wrote:\n> Commit b55d295e3ec9 added the possibility to support HPT resizing with KVM.\n> In the case of PR, we need to pass the userspace address of the HPT to KVM\n> using the SDR1 slot.\n> This is handled by kvmppc_update_sdr1() which uses CPU_FOREACH() to update\n> all CPUs. It is hence not needed to call kvmppc_update_sdr1() for each CPU.\n> \n> Signed-off-by: Greg Kurz <groug@kaod.org>\n\nApplied to ppc-for-2.11.\n\n> ---\n>  hw/ppc/spapr_hcall.c |   14 +++++---------\n>  1 file changed, 5 insertions(+), 9 deletions(-)\n> \n> diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c\n> index 8b3c0e17e75c..6ab8c188f381 100644\n> --- a/hw/ppc/spapr_hcall.c\n> +++ b/hw/ppc/spapr_hcall.c\n> @@ -1559,20 +1559,16 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu,\n>          }\n>  \n>          if (spapr->htab_shift < maxshift) {\n> -            CPUState *cs;\n> -\n>              /* Guest doesn't know about HPT resizing, so we\n>               * pre-emptively resize for the maximum permitted RAM.  At\n>               * the point this is called, nothing should have been\n>               * entered into the existing HPT */\n>              spapr_reallocate_hpt(spapr, maxshift, &error_fatal);\n> -            CPU_FOREACH(cs) {\n> -                if (kvm_enabled()) {\n> -                    /* For KVM PR, update the HPT pointer */\n> -                    target_ulong sdr1 = (target_ulong)(uintptr_t)spapr->htab\n> -                        | (spapr->htab_shift - 18);\n> -                    kvmppc_update_sdr1(sdr1);\n> -                }\n> +            if (kvm_enabled()) {\n> +                /* For KVM PR, update the HPT pointer */\n> +                target_ulong sdr1 = (target_ulong)(uintptr_t)spapr->htab\n> +                    | (spapr->htab_shift - 18);\n> +                kvmppc_update_sdr1(sdr1);\n>              }\n>          }\n>      }\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>)","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=\"BQMMRIoR\"; \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 3xqZ4N6J9Pz9sBZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 10 Sep 2017 11:59:32 +1000 (AEST)","from localhost ([::1]:51430 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 1dqrX1-0000JR-1w\n\tfor incoming@patchwork.ozlabs.org; Sat, 09 Sep 2017 21:59:31 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:35436)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <dgibson@ozlabs.org>) id 1dqrWR-0000Iv-20\n\tfor qemu-devel@nongnu.org; Sat, 09 Sep 2017 21:58:55 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <dgibson@ozlabs.org>) id 1dqrWQ-0002O9-0e\n\tfor qemu-devel@nongnu.org; Sat, 09 Sep 2017 21:58:55 -0400","from ozlabs.org ([2401:3900:2:1::2]:41647)\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 1dqrWP-0002Ms-LN; Sat, 09 Sep 2017 21:58:53 -0400","by ozlabs.org (Postfix, from userid 1007)\n\tid 3xqZ3W22xpz9sBZ; Sun, 10 Sep 2017 11:58:47 +1000 (AEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n\td=gibson.dropbear.id.au; s=201602; t=1505008727;\n\tbh=TxbmmX6mFud5+n/0rFvxB5rPX5M/UU5cUtB6PX0LJjQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=BQMMRIoRC6lKFwf/f3Bj6Dz85fGQAw8TXGt7SiSA2FWkKLaB9QnC6fW/ObHdwmxKD\n\t8wpqDwHo5dfChqO4Yt0yMaMF5Krhe2gn/kDfJ7dqdAFOB3WT4zQYY2G6cqc4HyOWuK\n\thm9iNJWR80MW6bT5eh2JF8mlyhsGq3Izm3/ehw2I=","Date":"Sun, 10 Sep 2017 11:58:14 +1000","From":"David Gibson <david@gibson.dropbear.id.au>","To":"Greg Kurz <groug@kaod.org>","Message-ID":"<20170910015814.GW2735@umbus.fritz.box>","References":"<150456160452.17000.3290192176290246589.stgit@bahia.lan>\n\t<150456161545.17000.9223127644314285105.stgit@bahia.lan>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"eLx2Oic5rP1+EtIt\"","Content-Disposition":"inline","In-Reply-To":"<150456161545.17000.9223127644314285105.stgit@bahia.lan>","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 1/4] spapr: only update SDR1 once per-cpu\n\tduring CAS","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":"Thomas Huth <thuth@redhat.com>, qemu-ppc@nongnu.org,\n\tqemu-devel@nongnu.org, Suraj Jitindar Singh <sjitindarsingh@gmail.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>"}}]