[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/6] target/ppc: fix exception error value in slbfee
From: |
Matheus Ferst |
Subject: |
[PATCH 2/6] target/ppc: fix exception error value in slbfee |
Date: |
Mon, 27 Jun 2022 11:11:00 -0300 |
Testing on a POWER9 DD2.3, we observed that the Linux kernel delivers a
signal with si_code ILL_PRVOPC (5) when a userspace application tries to
use slbfee. To obtain this behavior on linux-user, we should use
POWERPC_EXCP_PRIV with POWERPC_EXCP_PRIV_OPC.
No functional change is intended for softmmu targets as
gen_hvpriv_exception uses the same 'exception' argument
(POWERPC_EXCP_HV_EMU) for raise_exception_*, and the powerpc_excp_*
methods do not use lower bits of the exception error code when handling
POWERPC_EXCP_{INVAL,PRIV}.
Reported-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
---
target/ppc/translate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 55f34eb490..d7e5670c20 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -5386,12 +5386,12 @@ static void gen_slbmfev(DisasContext *ctx)
static void gen_slbfee_(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
- gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
+ gen_hvpriv_exception(ctx, POWERPC_EXCP_PRIV_OPC);
#else
TCGLabel *l1, *l2;
if (unlikely(ctx->pr)) {
- gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
+ gen_hvpriv_exception(ctx, POWERPC_EXCP_PRIV_OPC);
return;
}
gen_helper_find_slb_vsid(cpu_gpr[rS(ctx->opcode)], cpu_env,
--
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, 2022/06/27
- [PATCH 2/6] target/ppc: fix exception error value in slbfee,
Matheus Ferst <=
- [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