mirror of https://gitlab.com/qemu-project/qemu
ppc: Do not take exceptions on unknown SPRs in privileged mode
The architecture specifies that mtspr/mfspr on an unknown SPR number should act as a nop in privileged mode. I haven't removed the warning however as it can be useful for diagnosing. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
c76c22d51d
commit
4d6a0680fa
|
@ -4351,8 +4351,11 @@ static inline void gen_op_mfspr(DisasContext *ctx)
|
||||||
qemu_log("Trying to read invalid spr %d (0x%03x) at "
|
qemu_log("Trying to read invalid spr %d (0x%03x) at "
|
||||||
TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);
|
TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);
|
||||||
}
|
}
|
||||||
|
/* Only generate an exception in user space, otherwise this is a nop */
|
||||||
|
if (ctx->pr) {
|
||||||
gen_inval_exception(ctx, POWERPC_EXCP_INVAL_SPR);
|
gen_inval_exception(ctx, POWERPC_EXCP_INVAL_SPR);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gen_mfspr(DisasContext *ctx)
|
static void gen_mfspr(DisasContext *ctx)
|
||||||
|
@ -4503,8 +4506,12 @@ static void gen_mtspr(DisasContext *ctx)
|
||||||
}
|
}
|
||||||
fprintf(stderr, "Trying to write invalid spr %d (0x%03x) at "
|
fprintf(stderr, "Trying to write invalid spr %d (0x%03x) at "
|
||||||
TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);
|
TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);
|
||||||
|
|
||||||
|
/* Only generate an exception in user space, otherwise this is a nop */
|
||||||
|
if (ctx->pr) {
|
||||||
gen_inval_exception(ctx, POWERPC_EXCP_INVAL_SPR);
|
gen_inval_exception(ctx, POWERPC_EXCP_INVAL_SPR);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** Cache management ***/
|
/*** Cache management ***/
|
||||||
|
|
Loading…
Reference in New Issue