linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@ozlabs.org>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: linuxppc-dev@ozlabs.org, Michael Ellerman <michael@ellerman.id.au>
Subject: Re: [PATCH] powerpc/64: Don't try to use radix MMU under a hypervisor
Date: Wed, 21 Dec 2016 08:09:53 +1100	[thread overview]
Message-ID: <20161220210953.GB19107@fergus.ozlabs.ibm.com> (raw)
In-Reply-To: <87lgvau04h.fsf@linux.vnet.ibm.com>

On Tue, Dec 20, 2016 at 08:19:02PM +0530, Aneesh Kumar K.V wrote:
> Paul Mackerras <paulus@ozlabs.org> writes:
> 
> > Currently, if the kernel is running on a POWER9 processor under a
> > hypervisor, it will try to use the radix MMU even though it doesn't
> > have the necessary code to use radix under a hypervisor (it doesn't
> > negotiate use of radix, and it doesn't do the H_REGISTER_PROC_TBL
> > hcall).  The result is that the guest kernel will crash when it tries
> > to turn on the MMU, because it will still actually be using the HPT
> > MMU, but it won't have set up any SLB or HPT entries.  It does this
> > because the only thing that the kernel looks at in deciding to use
> > radix, on any platform, is the ibm,pa-features property on the cpu
> > device nodes.
> >
> > This fixes it by looking for the /chosen/ibm,architecture-vec-5
> > property, and if it exists, clearing the radix MMU feature bit.
> > We do this before we decide whether to initialize for radix or HPT.
> > This property is created by the hypervisor as a result of the guest
> > calling the ibm,client-architecture-support method to indicate
> > its capabilities, so it only exists on systems with a hypervisor.
> > The reason for using this property is that in future, when we
> > have support for using radix under a hypervisor, we will need
> > to check this property to see whether the hypervisor agreed to
> > us using radix.
> 
> Hypervisor that doesn't support radix should clear the ibm,pa-features
> radix feature bit right ? We look at that before setting
> MMU_FTR_TYPE_RADIX. So how did we end up enabling radix in the above
> case ?

Two points in response:

1. The ibm,pa-features property specifies the capabilities of the
processor, not the platform.  The radix bit would be set on POWER9
even if the hypervisor doesn't support radix.

2. The hypervisor might well support radix, but the kernel definitely
cannot operate with radix under a hypervisor, because it doesn't put
the necessary things in the ibm,client-architecture support call, and
it doesn't call the H_REGISTER_PROC_TBL hcall.  That means that the
CPU has no way to find our 1st level (process scoped) radix trees even
if the partition was in radix mode.  Most likely the hypervisor will
put the partition into HPT mode because the kernel didn't ask for
radix in the CAS call, but even if the hypervisor put the partition
into radix mode, it still wouldn't work.

Paul.

  reply	other threads:[~2016-12-20 21:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-20 11:40 [PATCH] powerpc/64: Don't try to use radix MMU under a hypervisor Paul Mackerras
2016-12-20 14:49 ` Aneesh Kumar K.V
2016-12-20 21:09   ` Paul Mackerras [this message]
2016-12-21  0:46 ` Suraj Jitindar Singh

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=20161220210953.GB19107@fergus.ozlabs.ibm.com \
    --to=paulus@ozlabs.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=michael@ellerman.id.au \
    /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).