All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <lvivier@redhat.com>
To: Greg Kurz <groug@kaod.org>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, David Gibson <david@gibson.dropbear.id.au>,
	Michael Roth <mdroth@linux.vnet.ibm.com>,
	Paul Mackerras <paulus@samba.org>,
	qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] spapr: don't call KVM_PPC_CONFIGURE_V3_MMU if HPT is in userspace
Date: Tue, 29 May 2018 10:25:11 +0200	[thread overview]
Message-ID: <b62f90f5-a602-2c2b-8b1c-cc195c51c64d@redhat.com> (raw)
In-Reply-To: <152725285229.537901.6934923933763529191.stgit@bahia.lan>

On 25/05/2018 14:54, Greg Kurz wrote:
> Since the kernel commit "dbfcf3cb9c68 powerpc/64: Call H_REGISTER_PROC_TBL
> when running as a HPT guest on POWER9", a nested guest running with PR KVM
> hangs at boot:
> 
> Preparing to boot Linux version 4.16.0-kvm-pr-hang-gku+ (greg@qemu2222.boston16) (gcc version 8.1.1 20180502 (Red Hat 8.1.1-1) (GCC)) #19 SMP Fri May 25 08:41:55 CEST 2018
> Detected machine type: 0000000000000101
> command line: root=UUID=22128c5c-30b1-4e0a-ac16-95853df31131 ro rhgb console=hvc0 early_printk disable-radix=on
> Max number of cores passed to firmware: 1024 (NR_CPUS = 1024)
> Calling ibm,client-architecture-support... done
> memory layout at init:
>   memory_limit : 0000000000000000 (16 MB aligned)
>   alloc_bottom : 0000000001b80000
>   alloc_top    : 0000000030000000
>   alloc_top_hi : 0000000100000000
>   rmo_top      : 0000000030000000
>   ram_top      : 0000000100000000
> instantiating rtas at 0x000000002fff0000... done
> prom_hold_cpus: skipped
> copying OF device tree...
> Building dt strings...
> Building dt structure...
> Device tree strings 0x0000000003d90000 -> 0x0000000003d90abb
> Device tree struct  0x0000000003da0000 -> 0x0000000003db0000
> Quiescing Open Firmware ...
> Booting Linux via __start() @ 0x0000000000400000 ...
> 
> This happens because the H_REGISTER_PROC_TBL implementation in QEMU
> always call KVM_PPC_CONFIGURE_V3_MMU when KVM is present. This fails
> in the case of PR KVM, which doesn't implement it, and QEMU returns
> H_PARAMETER to the guest, which is a BUG() condition in linux.
> 
> In the case of PR, the HPT is allocated in userspace by QEMU, so it
> doesn't make sense to call KVM_PPC_CONFIGURE_V3_MMU in the first
> place. So, skip it in this case and let the guest boot.
> 
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
> 
> Note that PR KVM requires this patch from Paul to work on POWER9:
> 
>     https://patchwork.ozlabs.org/patch/916766/
> 
> The original request was coming from people who want to run openQA in
> fedora28 under PowerVM on a POWER9 system. This requires PR KVM, which
> will be running in HPT-mode since pHyp doesn't do radix.
> 
> Cc'ing stable because fedora28 ships QEMU 2.11.x.
> ---
>  hw/ppc/spapr_hcall.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
> index 022f6d810182..12cbb317e5e8 100644
> --- a/hw/ppc/spapr_hcall.c
> +++ b/hw/ppc/spapr_hcall.c
> @@ -1420,7 +1420,7 @@ static target_ulong h_register_process_table(PowerPCCPU *cpu,
>                    ((flags & FLAG_GTSE) ? LPCR_GTSE : 0),
>                    LPCR_UPRT | LPCR_GTSE);
>  
> -    if (kvm_enabled()) {
> +    if (kvm_enabled() && !spapr->htab) {
>          return kvmppc_configure_v3_mmu(cpu, flags & FLAG_RADIX,
>                                         flags & FLAG_GTSE, cproc);
>      }
> 

Reviewed-by: Laurent Vivier <lvivier@redhat.com>

  parent reply	other threads:[~2018-05-29  8:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-25 12:54 [Qemu-devel] [PATCH] spapr: don't call KVM_PPC_CONFIGURE_V3_MMU if HPT is in userspace Greg Kurz
2018-05-25 14:13 ` Laurent Vivier
2018-05-26  9:00   ` Greg Kurz
2018-05-29  8:25 ` Laurent Vivier [this message]
2018-06-04 23:42 ` David Gibson
2018-06-05  9:14   ` Greg Kurz
2018-06-06  1:43     ` 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=b62f90f5-a602-2c2b-8b1c-cc195c51c64d@redhat.com \
    --to=lvivier@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=paulus@samba.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /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.