qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Joel Stanley <joel@jms.id.au>
Cc: "Alexander Graf" <agraf@suse.de>,
	qemu-ppc@nongnu.org, "QEMU Developers" <qemu-devel@nongnu.org>,
	"Cédric Le Goater" <clg@kaod.org>, "Greg Kurz" <groug@kaod.org>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Michael Neuling" <mikey@neuling.org>
Subject: Re: [Qemu-devel] [PATCH v2] target/ppc: Allow privileged access to SPR_PCR
Date: Mon, 4 Jun 2018 19:12:31 +1000	[thread overview]
Message-ID: <20180604091231.GR4251@umbus> (raw)
In-Reply-To: <CACPK8XfrL8U_DCu3Ek9e+Gvj9oSn2+c9JnUBf0i4+OTz96-JRw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1451 bytes --]

On Mon, Jun 04, 2018 at 06:06:04PM +0930, Joel Stanley wrote:
> On 4 June 2018 at 17:34, David Gibson <david@gibson.dropbear.id.au> wrote:
> > On Thu, May 31, 2018 at 10:34:29PM +0930, Joel Stanley wrote:
> >> @@ -98,6 +99,15 @@ void helper_store_ptcr(CPUPPCState *env, target_ulong val)
> >>          tlb_flush(CPU(cpu));
> >>      }
> >>  }
> >> +
> >> +void helper_store_pcr(CPUPPCState *env, target_ulong value)
> >> +{
> >> +    if (value != 0) {
> >> +        error_report("Invalid PCR value 0x"TARGET_FMT_lx, value);
> >> +        return;
> >> +    }
> >
> > I don't see a lot of point to this check.  For now the only user just
> > clears the PCR, but why limit yourself to that explicitly?
> 
> As we're not emulating the features of the register when the value is
> non-zero, I thought it would make make sense to do something.

Ah.. I see what you mean.

Ok, the check makes sense in that case - but it needs a comment saying
it should go away once we actually put the proper PCR checks in the
various bits of TCG that should have them.

> 
> I'll drop it in v3.
> 
> >
> >> +    env->spr[SPR_PCR] = value;
> >
> > You definitely should be masking against pcr_mask too.
> 
> Okay. Thanks for the review.
> 

-- 
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: 833 bytes --]

      reply	other threads:[~2018-06-04  9:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 13:04 [Qemu-devel] [PATCH v2] target/ppc: Allow privileged access to SPR_PCR Joel Stanley
2018-06-01 12:16 ` Greg Kurz
2018-06-04  8:04 ` David Gibson
2018-06-04  8:36   ` Joel Stanley
2018-06-04  9:12     ` David Gibson [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=20180604091231.GR4251@umbus \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=benh@kernel.crashing.org \
    --cc=clg@kaod.org \
    --cc=groug@kaod.org \
    --cc=joel@jms.id.au \
    --cc=mikey@neuling.org \
    --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).