[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/6] target/ppc: Fix gen_priv_exception error value in mfspr/mtsp
From: |
Matheus Ferst |
Subject: |
[PATCH 1/6] target/ppc: Fix gen_priv_exception error value in mfspr/mtspr |
Date: |
Mon, 27 Jun 2022 11:10:59 -0300 |
The code in linux-user/ppc/cpu_loop.c expects POWERPC_EXCP_PRIV
exception with error POWERPC_EXCP_PRIV_OPC or POWERPC_EXCP_PRIV_REG,
while POWERPC_EXCP_INVAL_SPR is expected in POWERPC_EXCP_INVAL
exceptions. This mismatch caused an EXCP_DUMP with the message "Unknown
privilege violation (03)", as seen in [1].
[1] https://gitlab.com/qemu-project/qemu/-/issues/588
Fixes: 9b2fadda3e01 ("ppc: Rework generation of priv and inval interrupts")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/588
Reviewed-by: Fabiano Rosas <farosas@linux.ibm.com>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
---
This patch was split from
https://lists.gnu.org/archive/html/qemu-ppc/2022-01/msg00400.html
---
target/ppc/translate.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 1d6daa4608..55f34eb490 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -4789,11 +4789,11 @@ static inline void gen_op_mfspr(DisasContext *ctx)
*/
if (sprn & 0x10) {
if (ctx->pr) {
- gen_priv_exception(ctx, POWERPC_EXCP_INVAL_SPR);
+ gen_priv_exception(ctx, POWERPC_EXCP_PRIV_REG);
}
} else {
if (ctx->pr || sprn == 0 || sprn == 4 || sprn == 5 || sprn == 6) {
- gen_hvpriv_exception(ctx, POWERPC_EXCP_INVAL_SPR);
+ gen_hvpriv_exception(ctx, POWERPC_EXCP_PRIV_REG);
}
}
}
@@ -4976,11 +4976,11 @@ static void gen_mtspr(DisasContext *ctx)
*/
if (sprn & 0x10) {
if (ctx->pr) {
- gen_priv_exception(ctx, POWERPC_EXCP_INVAL_SPR);
+ gen_priv_exception(ctx, POWERPC_EXCP_PRIV_REG);
}
} else {
if (ctx->pr || sprn == 0) {
- gen_hvpriv_exception(ctx, POWERPC_EXCP_INVAL_SPR);
+ gen_hvpriv_exception(ctx, POWERPC_EXCP_PRIV_REG);
}
}
}
--
2.25.1
- [PATCH 0/6] Fix gen_*_exception error codes, Matheus Ferst, 2022/06/27
- [PATCH 1/6] target/ppc: Fix gen_priv_exception error value in mfspr/mtspr,
Matheus Ferst <=
- [PATCH 2/6] target/ppc: fix exception error value in slbfee, Matheus Ferst, 2022/06/27
- [PATCH 3/6] target/ppc: remove mfdcrux and mtdcrux, Matheus Ferst, 2022/06/27
- [PATCH 4/6] target/ppc: fix exception error code in helper_{load, store}_dcr, Matheus Ferst, 2022/06/27
- [PATCH 5/6] target/ppc: fix PMU Group A register read/write exceptions, Matheus Ferst, 2022/06/27
- [PATCH 6/6] target/ppc: fix exception error code in spr_write_excp_vector, Matheus Ferst, 2022/06/27