target/ppc: fix PMU Group A register read/write exceptions
commitc35553b5e727dccfabc074e3658b082d63675dcc
authorMatheus Ferst <matheus.ferst@eldorado.org.br>
Mon, 27 Jun 2022 14:11:03 +0000 (27 11:11 -0300)
committerDaniel Henrique Barboza <danielhb413@gmail.com>
Mon, 18 Jul 2022 16:59:43 +0000 (18 13:59 -0300)
tree89d6a5e9de3047a5ffde07b8dbb88abbe93dc0c4
parente89851798597d93554676cfdcbb2f1e0f38cdb68
target/ppc: fix PMU Group A register read/write exceptions

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