From: David Gibson <david@gibson.dropbear.id.au>
To: Thomas Huth <thuth@redhat.com>
Cc: "Cédric Le Goater" <clg@kaod.org>,
qemu-ppc@nongnu.org,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/3] ppc: fix hrfid, tlbia and slbia privilege
Date: Mon, 6 Jun 2016 11:10:23 +1000 [thread overview]
Message-ID: <20160606011023.GA9226@voom.fritz.box> (raw)
In-Reply-To: <5752903C.3040704@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2268 bytes --]
On Sat, Jun 04, 2016 at 10:24:28AM +0200, Thomas Huth wrote:
> On 03.06.2016 14:11, Cédric Le Goater wrote:
> > commit 74693da98894 ('ppc: tlbie, tlbia and tlbisync are HV only')
> > introduced some extra checks on the instruction privilege. slbia was
> > changed wrongly and hrfid, tlbia were forgotten.
> >
> > Signed-off-by: Cédric Le Goater <clg@kaod.org>
> > ---
> > target-ppc/translate.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/target-ppc/translate.c b/target-ppc/translate.c
> > index ad262523abca..776343170a53 100644
> > --- a/target-ppc/translate.c
> > +++ b/target-ppc/translate.c
> > @@ -4108,7 +4108,7 @@ static void gen_hrfid(DisasContext *ctx)
> > gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
> > #else
> > /* Restore CPU state */
> > - if (unlikely(!ctx->hv)) {
> > + if (unlikely(ctx->pr || !ctx->hv)) {
> > gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
> > return;
> > }
> > @@ -4845,7 +4845,7 @@ static void gen_tlbia(DisasContext *ctx)
> > #if defined(CONFIG_USER_ONLY)
> > gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
> > #else
> > - if (unlikely(ctx->pr)) {
> > + if (unlikely(ctx->pr || !ctx->hv)) {
> > gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
> > return;
> > }
> > @@ -4913,7 +4913,7 @@ static void gen_slbia(DisasContext *ctx)
> > #if defined(CONFIG_USER_ONLY)
> > gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
> > #else
> > - if (unlikely(ctx->pr || !ctx->hv)) {
> > + if (unlikely(ctx->pr)) {
> > gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
> > return;
> > }
>
> I just double-checked the PowerISA 2.07, and you're right, hrfid and
> tlbia are hypervisor-privileged, slbia is only "normal" privileged.
>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
Yes, the SLB is owned by the guest - otherwise it would need
hypercalls on every context switch. Should have caught this the first
time around, sorry.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-06-06 1:48 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-03 12:11 [Qemu-devel] [PATCH 0/3] ppc: complete the new HV mode Cédric Le Goater
2016-06-03 12:11 ` [Qemu-devel] [PATCH 1/3] ppc: Fix hreg_store_msr() so that non-HV mode cannot alter MSR:HV Cédric Le Goater
2016-06-03 12:11 ` [Qemu-devel] [PATCH 2/3] ppc: Better figure out if processor has HV mode Cédric Le Goater
2016-06-03 12:11 ` [Qemu-devel] [PATCH 3/3] ppc: fix hrfid, tlbia and slbia privilege Cédric Le Goater
2016-06-04 8:24 ` Thomas Huth
2016-06-06 1:10 ` David Gibson [this message]
2016-06-03 13:52 ` [Qemu-devel] [PATCH 0/3] ppc: complete the new HV mode Mark Cave-Ayland
2016-06-03 14:00 ` Cédric Le Goater
2016-06-03 14:06 ` Mark Cave-Ayland
2016-06-03 14:06 ` Cedric Le Goater
2016-06-03 14:14 ` Mark Cave-Ayland
2016-06-03 15:47 ` Mark Cave-Ayland
2016-06-03 17:54 ` Cédric Le Goater
2016-06-05 17:41 ` Cédric Le Goater
2016-06-05 22:26 ` Mark Cave-Ayland
2016-06-06 6:27 ` Cédric Le Goater
2016-06-06 6:30 ` Cedric Le Goater
2016-06-06 6:38 ` Mark Cave-Ayland
2016-06-07 7:04 ` Cédric Le Goater
2016-06-07 8:24 ` Mark Cave-Ayland
2016-06-06 1:47 ` David Gibson
2016-06-06 4:17 ` [Qemu-devel] [Qemu-ppc] " Benjamin Herrenschmidt
2016-06-06 7:28 ` Cédric Le Goater
2016-06-06 1:17 ` [Qemu-devel] " David Gibson
2016-06-06 3:55 ` Benjamin Herrenschmidt
2016-06-06 4:20 ` [Qemu-devel] [Qemu-ppc] " Benjamin Herrenschmidt
2016-06-06 6:29 ` Mark Cave-Ayland
2016-06-06 7:04 ` Benjamin Herrenschmidt
2016-06-06 7:06 ` Benjamin Herrenschmidt
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=20160606011023.GA9226@voom.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=clg@kaod.org \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@redhat.com \
/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.