[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/30] target/ppc: fix PMU Group A register read/write exceptions
From: |
Daniel Henrique Barboza |
Subject: |
[PULL 12/30] target/ppc: fix PMU Group A register read/write exceptions |
Date: |
Mon, 18 Jul 2022 14:21:50 -0300 |
From: Matheus Ferst <matheus.ferst@eldorado.org.br>
A call to "gen_(hv)priv_exception" should use POWERPC_EXCP_PRIV_* as the
'error' argument instead of POWERPC_EXCP_INVAL_*, and POWERPC_EXCP_FU is
an exception type, not an exception error code. To correctly set
FSCR[IC], we should raise Facility Unavailable with this exception type
and IC value as the error code.
Fixes: 565cb1096733 ("target/ppc: add user read/write functions for MMCR0")
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20220627141104.669152-6-matheus.ferst@eldorado.org.br>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
target/ppc/power8-pmu-regs.c.inc | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/target/ppc/power8-pmu-regs.c.inc b/target/ppc/power8-pmu-regs.c.inc
index 2bab6cece7..c3cc919ee4 100644
--- a/target/ppc/power8-pmu-regs.c.inc
+++ b/target/ppc/power8-pmu-regs.c.inc
@@ -22,7 +22,7 @@
static bool spr_groupA_read_allowed(DisasContext *ctx)
{
if (!ctx->mmcr0_pmcc0 && ctx->mmcr0_pmcc1) {
- gen_hvpriv_exception(ctx, POWERPC_EXCP_FU);
+ gen_exception_err(ctx, POWERPC_EXCP_FU, FSCR_IC_PMU);
return false;
}
@@ -46,10 +46,10 @@ static bool spr_groupA_write_allowed(DisasContext *ctx)
if (ctx->mmcr0_pmcc1) {
/* PMCC = 0b01 */
- gen_hvpriv_exception(ctx, POWERPC_EXCP_FU);
+ gen_exception_err(ctx, POWERPC_EXCP_FU, FSCR_IC_PMU);
} else {
/* PMCC = 0b00 */
- gen_hvpriv_exception(ctx, POWERPC_EXCP_INVAL_SPR);
+ gen_hvpriv_exception(ctx, POWERPC_EXCP_PRIV_REG);
}
return false;
@@ -214,7 +214,7 @@ void spr_read_PMC56_ureg(DisasContext *ctx, int gprn, int
sprn)
* Interrupt.
*/
if (ctx->mmcr0_pmcc0 && ctx->mmcr0_pmcc1) {
- gen_hvpriv_exception(ctx, POWERPC_EXCP_FU);
+ gen_exception_err(ctx, POWERPC_EXCP_FU, FSCR_IC_PMU);
return;
}
@@ -249,7 +249,7 @@ void spr_write_PMC56_ureg(DisasContext *ctx, int sprn, int
gprn)
* Interrupt.
*/
if (ctx->mmcr0_pmcc0 && ctx->mmcr0_pmcc1) {
- gen_hvpriv_exception(ctx, POWERPC_EXCP_FU);
+ gen_exception_err(ctx, POWERPC_EXCP_FU, FSCR_IC_PMU);
return;
}
--
2.36.1
- [PULL 02/30] ppc/40x: Allocate IRQ lines with qdev_init_gpio_in(), (continued)
- [PULL 02/30] ppc/40x: Allocate IRQ lines with qdev_init_gpio_in(), Daniel Henrique Barboza, 2022/07/18
- [PULL 03/30] ppc/6xx: Allocate IRQ lines with qdev_init_gpio_in(), Daniel Henrique Barboza, 2022/07/18
- [PULL 04/30] ppc/e500: Allocate IRQ lines with qdev_init_gpio_in(), Daniel Henrique Barboza, 2022/07/18
- [PULL 05/30] ppc: Remove unused irq_inputs, Daniel Henrique Barboza, 2022/07/18
- [PULL 06/30] hw/ppc: pass random seed to fdt, Daniel Henrique Barboza, 2022/07/18
- [PULL 07/30] target/ppc/kvm: Skip current and parent directories in kvmppc_find_cpu_dt, Daniel Henrique Barboza, 2022/07/18
- [PULL 08/30] target/ppc: Fix gen_priv_exception error value in mfspr/mtspr, Daniel Henrique Barboza, 2022/07/18
- [PULL 11/30] target/ppc: fix exception error code in helper_{load, store}_dcr, Daniel Henrique Barboza, 2022/07/18
- [PULL 09/30] target/ppc: fix exception error value in slbfee, Daniel Henrique Barboza, 2022/07/18
- [PULL 13/30] target/ppc: fix exception error code in spr_write_excp_vector, Daniel Henrique Barboza, 2022/07/18
- [PULL 12/30] target/ppc: fix PMU Group A register read/write exceptions,
Daniel Henrique Barboza <=
- [PULL 10/30] target/ppc: remove mfdcrux and mtdcrux, Daniel Henrique Barboza, 2022/07/18
- [PULL 16/30] target/ppc: receive DisasContext explicitly in GEN_PRIV, Daniel Henrique Barboza, 2022/07/18
- [PULL 14/30] target/ppc: Move tlbie[l] to decode tree, Daniel Henrique Barboza, 2022/07/18
- [PULL 15/30] target/ppc: Implement ISA 3.00 tlbie[l], Daniel Henrique Barboza, 2022/07/18
- [PULL 19/30] target/ppc: Move slbieg to decodetree, Daniel Henrique Barboza, 2022/07/18
- [PULL 20/30] target/ppc: Move slbia to decodetree, Daniel Henrique Barboza, 2022/07/18
- [PULL 18/30] target/ppc: Move slbie to decodetree, Daniel Henrique Barboza, 2022/07/18
- [PULL 22/30] target/ppc: Move slbmfev to decodetree, Daniel Henrique Barboza, 2022/07/18
- [PULL 23/30] target/ppc: Move slbmfee to decodetree, Daniel Henrique Barboza, 2022/07/18
- [PULL 24/30] target/ppc: Move slbfee to decodetree, Daniel Henrique Barboza, 2022/07/18