All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: kvm-ppc@vger.kernel.org
Subject: Re: [PATCH] KVM: PPC: Book3S PR: Enable use on POWER9 inside HPT-mode guests
Date: Thu, 31 May 2018 06:02:12 +0000	[thread overview]
Message-ID: <20180531080212.26c53238@bahia.lan> (raw)
In-Reply-To: <20180519055638.GA24787@fergus.ozlabs.ibm.com>

On Sat, 19 May 2018 15:56:38 +1000
Paul Mackerras <paulus@ozlabs.org> wrote:

> This relaxes the restriction on using PR KVM on POWER9.  The existing
> code does work inside a guest partition running in HPT mode, because
> hypercalls such as H_ENTER use the old HPTE format, not the new
> format used by POWER9, and so no change to PR KVM's HPT manipulation
> code is required.  PR KVM will still refuse to run if the kernel is
> using radix translation or if it is running bare-metal.
> 
> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
> ---

With your other patch applied (https://patchwork.ozlabs.org/patch/916766/).

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

>  arch/powerpc/kvm/book3s_pr.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
> index 67061d3..3d0251e 100644
> --- a/arch/powerpc/kvm/book3s_pr.c
> +++ b/arch/powerpc/kvm/book3s_pr.c
> @@ -1735,9 +1735,16 @@ static void kvmppc_core_destroy_vm_pr(struct kvm *kvm)
>  static int kvmppc_core_check_processor_compat_pr(void)
>  {
>  	/*
> -	 * Disable KVM for Power9 untill the required bits merged.
> +	 * PR KVM can work on POWER9 inside a guest partition
> +	 * running in HPT mode.  It can't work if we are using
> +	 * radix translation (because radix provides no way for
> +	 * a process to have unique translations in quadrant 3)
> +	 * or in a bare-metal HPT-mode host (because POWER9
> +	 * uses a modified HPTE format which the PR KVM code
> +	 * has not been adapted to use).
>  	 */
> -	if (cpu_has_feature(CPU_FTR_ARCH_300))
> +	if (cpu_has_feature(CPU_FTR_ARCH_300) &&
> +	    (radix_enabled() || cpu_has_feature(CPU_FTR_HVMODE)))
>  		return -EIO;
>  	return 0;
>  }


      parent reply	other threads:[~2018-05-31  6:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-19  5:56 [PATCH] KVM: PPC: Book3S PR: Enable use on POWER9 inside HPT-mode guests Paul Mackerras
2018-05-23 17:04 ` Greg Kurz
2018-05-23 23:12 ` Paul Mackerras
2018-05-25 10:48 ` Greg Kurz
2018-05-29  1:59 ` Paul Mackerras
2018-05-29 11:55 ` Greg Kurz
2018-05-31  6:02 ` Greg Kurz [this message]

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=20180531080212.26c53238@bahia.lan \
    --to=groug@kaod.org \
    --cc=kvm-ppc@vger.kernel.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.