From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Guenter Roeck <linux@roeck-us.net>,
Michael Ellerman <michael@ellerman.id.au>
Cc: Michael Neuling <mikey@neuling.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc/64s: Clear PCR on boot
Date: Mon, 28 May 2018 23:28:34 +1000 [thread overview]
Message-ID: <7e6878a1b6c16ea0e18ce0bd9cc7ae5d2de17359.camel@kernel.crashing.org> (raw)
In-Reply-To: <20180527034503.GA31985@roeck-us.net>
On Sat, 2018-05-26 at 20:45 -0700, Guenter Roeck wrote:
>
> I already have a patch, or at least one that does the trick for me.
> Getting qemu patched was not the problem. I just want to be sure that
> the problem is indeed a qemu problem.
Hey Guenter !
It's not quite the right patch though. The PCR is a hypervisor
priviledged register, your patch makes it supervisor accessible.
I don't have all my stuff at hand to provide a "proper" or tested patch
but it should look like
spr_register_hv(env, SPR_PCR, "PCR",
SPR_NOACCESS, SPR_NOACCESS,
SPR_NOACCESS, SPR_NOACCESS,
&spr_read_generic, &spr_write_generic, 0);
Additionally the TCG ppc instruction decoder should be made to check
the PCR for varous instructions (that or use a specific write callback
that affects the CPU flags) but that's less urgent.
Cheers,
Ben.
> Thanks,
> Guenter
>
> ---
> > From 1617bac264b4c49d817b6947611affa9b73318f6 Mon Sep 17 00:00:00 2001
>
> From: Guenter Roeck <linux@roeck-us.net>
> Date: Fri, 25 May 2018 06:38:40 -0700
> Subject: [PATCH] PowerPC: Permit privileged access to SPR_PCR for POWER7+
>
> Without this access, Linux mainline bails out.
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> target/ppc/translate_init.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c
> index 391b94b..3b09c49 100644
> --- a/target/ppc/translate_init.c
> +++ b/target/ppc/translate_init.c
> @@ -7953,11 +7953,12 @@ static void gen_spr_power6_common(CPUPPCState *env)
> #endif
> /*
> * Register PCR to report POWERPC_EXCP_PRIV_REG instead of
> - * POWERPC_EXCP_INVAL_SPR.
> + * POWERPC_EXCP_INVAL_SPR in userspace. Permit privileged
> + * access.
> */
> spr_register(env, SPR_PCR, "PCR",
> SPR_NOACCESS, SPR_NOACCESS,
> - SPR_NOACCESS, SPR_NOACCESS,
> + &spr_read_generic, &spr_write_generic,
> 0x00000000);
> }
>
prev parent reply other threads:[~2018-05-28 13:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-25 13:33 [PATCH] powerpc/64s: Clear PCR on boot Guenter Roeck
2018-05-27 2:22 ` Michael Ellerman
2018-05-27 3:45 ` Guenter Roeck
2018-05-28 13:28 ` Benjamin Herrenschmidt [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=7e6878a1b6c16ea0e18ce0bd9cc7ae5d2de17359.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=michael@ellerman.id.au \
--cc=mikey@neuling.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.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).