qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@ozlabs.org>
To: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	David Gibson <david@gibson.dropbear.id.au>,
	Alexander Graf <agraf@suse.de>, Ram Pai <linuxram@us.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: [Qemu-devel] [PATCH] spapr: Add ibm, processor-storage-keys property to CPU DT node
Date: Thu, 24 Aug 2017 12:54:48 +1000	[thread overview]
Message-ID: <20170824025448.GA27401@fergus.ozlabs.ibm.com> (raw)
In-Reply-To: <20170821200036.15036-1-bauerman@linux.vnet.ibm.com>

On Mon, Aug 21, 2017 at 05:00:36PM -0300, Thiago Jung Bauermann wrote:
> LoPAPR says:
> 
>     “ibm,processor-storage-keys”
> 
>     property name indicating the number of virtual storage keys supported
>     by the processor described by this node.
> 
>     prop-encoded-array: Consists of two cells encoded as with encode-int.
>     The first cell represents the number of virtual storage keys supported
>     for data accesses while the second cell represents the number of
>     virtual storage keys supported for instruction accesses. The cell value
>     of zero indicates that no storage keys are supported for the access
>     type.
> 
> pHyp provides the property above but there's a bug in P8 firmware where the
> second cell is zero even though POWER8 supports instruction access keys.
> This bug will be fixed for P9.
> 
> Tested with KVM on POWER8 Firenze machine and with TCG on x86_64 machine.
> 
> Signed-off-by: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
> ---
> 
> The sysfs files are provided by this patch for Linux:

Those sysfs files relate to the kernel's support for userspace
processes using storage keys.  That is quite distinct from KVM's
support for guests using storage keys, so I think that using those
sysfs files to indicate what the guest can do is wrong.

In fact KVM allows guests to specify storage keys in the HPTE values
that they set, except that there is a bug (for which Ram Pai has
posted a patch) that means that KVM loses the top two bits of the key
number.

What I would suggest is that we use the 'pad' field in the struct
kvm_ppc_smmu_info to report the number of keys supported by KVM for
guest use.  That will be 0 in all current kernels, indicating that
keys are not supported, which is reasonable because of the bug.  I
will make sure the patch fixing the bug goes in first.

We could either have two u16 fields for the number of keys for data
and instruction, or we could have a u32 field for the number of keys
and a separate bit in the flags field to indicate that instruction
keys are supported.  Which would be preferable?

Paul.

  parent reply	other threads:[~2017-08-24  2:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 20:00 [Qemu-devel] [PATCH] spapr: Add ibm, processor-storage-keys property to CPU DT node Thiago Jung Bauermann
2017-08-22  2:02 ` David Gibson
2017-08-23 23:14   ` Thiago Jung Bauermann
2017-08-24  1:34     ` David Gibson
2017-08-22  7:17 ` no-reply
2017-08-24  2:54 ` Paul Mackerras [this message]
2017-08-24  4:02   ` David Gibson
2017-08-24  4:15     ` Paul Mackerras
2017-08-24  4:27       ` David Gibson
2017-08-24 18:11   ` Ram Pai
2017-08-25  4:23     ` David Gibson
2017-08-28 17:50       ` Ram Pai
2017-08-29  1:57         ` David Gibson
2017-08-28 17:53   ` Ram Pai
2017-08-29  1:40     ` David Gibson
2017-08-29 16:31       ` Ram Pai
2017-08-30  0: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=20170824025448.GA27401@fergus.ozlabs.ibm.com \
    --to=paulus@ozlabs.org \
    --cc=agraf@suse.de \
    --cc=bauerman@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=linuxram@us.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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 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).