From: Ram Pai <linuxram@us.ibm.com>
To: kvm-ppc@vger.kernel.org
Subject: Re: [RFC PATCH] kvmppc: protection keys fix
Date: Fri, 18 Aug 2017 17:24:57 +0000 [thread overview]
Message-ID: <20170818172457.GD5545@ram.oc3035372033.ibm.com> (raw)
In-Reply-To: <1501258978-6666-1-git-send-email-linuxram@us.ibm.com>
On Fri, Aug 18, 2017 at 10:02:01AM +1000, Paul Mackerras wrote:
> On Thu, Aug 17, 2017 at 03:01:31PM -0700, Ram Pai wrote:
> > On Thu, Aug 17, 2017 at 05:54:45PM -0300, Thiago Jung Bauermann wrote:
> [snip]
> > >
> > > I'm currently preparing a patch for that. One question: did I understand
> > > correctly that Paul Mackerras' answer on this thread¹ means that KVM
> > > doesn't need to reserve any keys for itself and can pass on 32 keys to
> > > the guest?
> >
> > No. KVM does use key 31 for emulated MMIO.
> >
> > if (!(memslot && !(memslot->flags & KVM_MEMSLOT_INVALID))) {
> > /* Emulated MMIO - mark this with key1 */
> > pteh |= HPTE_V_ABSENT;
> > ptel |= HPTE_R_KEY_HI |
> > HPTE_R_KEY_LO;
> > goto do_insert;
> > }
>
> Actually, the guest *can* use all 32 keys. We only use key 31 on
> absent HPTEs (see the HPTE_V_ABSENT flag above - these are HPTEs that
> the guest thinks are valid but are not actually mapped in the real
> HPT).
Ok. looks like you use the HPTE_V_ABSENT flag to determine if a key fault
on key 31, needs to be redirected to the guest or handled internally.
RP
next prev parent reply other threads:[~2017-08-18 17:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-28 16:22 [RFC PATCH] kvmppc: protection keys fix Ram Pai
2017-07-31 5:35 ` Paul Mackerras
2017-07-31 5:56 ` Balbir Singh
2017-08-02 8:49 ` Aneesh Kumar K.V
2017-08-02 9:54 ` Paul Mackerras
2017-08-17 15:58 ` Ram Pai
2017-08-17 20:54 ` Thiago Jung Bauermann
2017-08-17 22:01 ` Ram Pai
2017-08-18 0:02 ` Paul Mackerras
2017-08-18 17:24 ` Ram Pai [this message]
2017-08-31 3:41 ` Paul Mackerras
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=20170818172457.GD5545@ram.oc3035372033.ibm.com \
--to=linuxram@us.ibm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox