All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, david@gibson.dropbear.id.au
Subject: Re: [Qemu-devel] [QEMU-PPC] [PATCH 1/2] target/ppc: Move setting of patb_entry on hash table init
Date: Fri, 24 Nov 2017 14:16:44 +0100	[thread overview]
Message-ID: <20171124141644.6e7beac0@bahia.lab.toulouse-stg.fr.ibm.com> (raw)
In-Reply-To: <20171124042325.28012-2-sjitindarsingh@gmail.com>

On Fri, 24 Nov 2017 15:23:24 +1100
Suraj Jitindar Singh <sjitindarsingh@gmail.com> wrote:

> The patb_entry is used to store the location of the process table in
> guest memory. The msb is also used to indicate the mmu mode of the
> guest, that is patb_entry & 1 << 63 ? radix_mode : hash_mode.
> 
> Currently we set this to zero in spapr_setup_hpt_and_vrma() since if
> this function gets called then we know we're hash. However some code
> paths, such as setting up the hpt on incoming migration of a hash guest,
> call spapr_reallocate_hpt() directly bypassing this higher level
> function. Since we assume radix if the host is capable this results in
> the msb in patb_entry being left set so in spapr_post_load() we call
> kvmppc_configure_v3_mmu() and tell the host we're radix which as
> expected means addresses cannot be translated once we actually run the cpu.
> 
> To fix this move the zeroing of patb_entry into spapr_reallocate_hpt().
> 
> Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
> ---

Reviewed-by: Greg Kurz <groug@kaod.org>

>  hw/ppc/spapr.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 6841bd294b..e7af47bab0 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -1373,6 +1373,8 @@ void spapr_reallocate_hpt(sPAPRMachineState *spapr, int shift,
>              DIRTY_HPTE(HPTE(spapr->htab, i));
>          }
>      }
> +    /* We're setting up a hash table, so that means we're not radix */
> +    spapr->patb_entry = 0;
>  }
>  
>  void spapr_setup_hpt_and_vrma(sPAPRMachineState *spapr)
> @@ -1392,8 +1394,6 @@ void spapr_setup_hpt_and_vrma(sPAPRMachineState *spapr)
>          spapr->rma_size = kvmppc_rma_size(spapr_node0_size(MACHINE(spapr)),
>                                            spapr->htab_shift);
>      }
> -    /* We're setting up a hash table, so that means we're not radix */
> -    spapr->patb_entry = 0;
>  }
>  
>  static void find_unknown_sysbus_device(SysBusDevice *sbdev, void *opaque)

  reply	other threads:[~2017-11-24 13:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-24  4:23 [Qemu-devel] [QEMU-PPC] [PATCH 0/2] target/ppc: hpt on radix and compat migration fixes Suraj Jitindar Singh
2017-11-24  4:23 ` [Qemu-devel] [QEMU-PPC] [PATCH 1/2] target/ppc: Move setting of patb_entry on hash table init Suraj Jitindar Singh
2017-11-24 13:16   ` Greg Kurz [this message]
2017-11-24  4:23 ` [Qemu-devel] [QEMU-PPC] [PATCH 2/2] target/ppc: Fix setting of cpu->compat_pvr on incoming migration Suraj Jitindar Singh
2017-11-24 17:09   ` Greg Kurz
2017-11-24  4:28 ` [Qemu-devel] [QEMU-PPC] [PATCH 0/2] target/ppc: hpt on radix and compat migration fixes David Gibson

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=20171124141644.6e7beac0@bahia.lab.toulouse-stg.fr.ibm.com \
    --to=groug@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=sjitindarsingh@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.