qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Greg Kurz <groug@kaod.org>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	Suraj Jitindar Singh <sjitindarsingh@gmail.com>,
	Thomas Huth <thuth@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/4] spapr: only update SDR1 once per-cpu during CAS
Date: Sun, 10 Sep 2017 11:58:14 +1000	[thread overview]
Message-ID: <20170910015814.GW2735@umbus.fritz.box> (raw)
In-Reply-To: <150456161545.17000.9223127644314285105.stgit@bahia.lan>

[-- Attachment #1: Type: text/plain, Size: 2140 bytes --]

On Mon, Sep 04, 2017 at 11:46:55PM +0200, Greg Kurz wrote:
> Commit b55d295e3ec9 added the possibility to support HPT resizing with KVM.
> In the case of PR, we need to pass the userspace address of the HPT to KVM
> using the SDR1 slot.
> This is handled by kvmppc_update_sdr1() which uses CPU_FOREACH() to update
> all CPUs. It is hence not needed to call kvmppc_update_sdr1() for each CPU.
> 
> Signed-off-by: Greg Kurz <groug@kaod.org>

Applied to ppc-for-2.11.

> ---
>  hw/ppc/spapr_hcall.c |   14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
> index 8b3c0e17e75c..6ab8c188f381 100644
> --- a/hw/ppc/spapr_hcall.c
> +++ b/hw/ppc/spapr_hcall.c
> @@ -1559,20 +1559,16 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu,
>          }
>  
>          if (spapr->htab_shift < maxshift) {
> -            CPUState *cs;
> -
>              /* Guest doesn't know about HPT resizing, so we
>               * pre-emptively resize for the maximum permitted RAM.  At
>               * the point this is called, nothing should have been
>               * entered into the existing HPT */
>              spapr_reallocate_hpt(spapr, maxshift, &error_fatal);
> -            CPU_FOREACH(cs) {
> -                if (kvm_enabled()) {
> -                    /* For KVM PR, update the HPT pointer */
> -                    target_ulong sdr1 = (target_ulong)(uintptr_t)spapr->htab
> -                        | (spapr->htab_shift - 18);
> -                    kvmppc_update_sdr1(sdr1);
> -                }
> +            if (kvm_enabled()) {
> +                /* For KVM PR, update the HPT pointer */
> +                target_ulong sdr1 = (target_ulong)(uintptr_t)spapr->htab
> +                    | (spapr->htab_shift - 18);
> +                kvmppc_update_sdr1(sdr1);
>              }
>          }
>      }
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-09-10  1:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-04 21:46 [Qemu-devel] [PATCH 0/4] ppc: fix migration with KVM PR (nested) Greg Kurz
2017-09-04 21:46 ` [Qemu-devel] [PATCH 1/4] spapr: only update SDR1 once per-cpu during CAS Greg Kurz
2017-09-10  1:58   ` David Gibson [this message]
2017-09-04 21:47 ` [Qemu-devel] [PATCH 2/4] spapr: introduce a helper to compute the address of the HPT Greg Kurz
2017-09-10  3:41   ` David Gibson
2017-09-11 12:04     ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2017-09-11 12:50       ` David Gibson
2017-09-11 13:54         ` Greg Kurz
2017-09-04 21:47 ` [Qemu-devel] [PATCH 3/4] ppc: kvm: introduce a helper to update SDR1 for a single CPU Greg Kurz
2017-09-10  3:56   ` David Gibson
2017-09-04 21:47 ` [Qemu-devel] [PATCH 4/4] ppc: kvm: update HPT pointer in KVM PR after migration Greg Kurz
2017-09-05 14:36 ` [Qemu-devel] [Qemu-ppc] [PATCH 0/4] ppc: fix migration with KVM PR (nested) Greg Kurz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170910015814.GW2735@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=sjitindarsingh@gmail.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).