Work around the problem that the PC register is not saved with the right address when taking a user space PVR access exception. Signed-off-by: Jason Wessel --- target-ppc/translate_init.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -92,6 +92,12 @@ static void spr_write_clear (void *opaqu } #endif +static void spr_read_generic_fault_user(void *opaque, int sprn) +{ + DisasContext *ctx = opaque; + GEN_EXCP_PRIVREG(ctx); +} + /* SPR common to all PowerPC */ /* XER */ static void spr_read_xer (void *opaque, int sprn) @@ -5942,7 +5948,7 @@ static void init_ppc_proc (CPUPPCState * /* Register SPR common to all PowerPC implementations */ gen_spr_generic(env); spr_register(env, SPR_PVR, "PVR", - SPR_NOACCESS, SPR_NOACCESS, + &spr_read_generic_fault_user, SPR_NOACCESS, &spr_read_generic, SPR_NOACCESS, def->pvr); /* PowerPC implementation specific initialisations (SPRs, timers, ...) */