[PATCH] PowerPC: Permit privileged access to SPR_PCR for POWER7+

From: Guenter Roeck
Date: Fri May 25 2018 - 09:38:40 EST


Without this access, Linux mainline bails out.

Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
---
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);
}

--
2.7.4