All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Henrique Barboza <danielhb413@gmail.com>
To: Matheus Ferst <matheus.ferst@eldorado.org.br>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Cc: clg@kaod.org, david@gibson.dropbear.id.au, groug@kaod.org,
	farosas@linux.ibm.com, laurent@vivier.eu
Subject: Re: [PATCH 5/6] target/ppc: fix PMU Group A register read/write exceptions
Date: Mon, 27 Jun 2022 15:00:30 -0300	[thread overview]
Message-ID: <f3ea7123-ba0f-3955-9f32-af7d13054e39@gmail.com> (raw)
In-Reply-To: <20220627141104.669152-6-matheus.ferst@eldorado.org.br>



On 6/27/22 11:11, Matheus Ferst wrote:
> 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>

>   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;
>       }
>   


  reply	other threads:[~2022-06-27 18:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27 14:10 [PATCH 0/6] Fix gen_*_exception error codes Matheus Ferst
2022-06-27 14:10 ` [PATCH 1/6] target/ppc: Fix gen_priv_exception error value in mfspr/mtspr Matheus Ferst
2022-06-27 14:11 ` [PATCH 2/6] target/ppc: fix exception error value in slbfee Matheus Ferst
2022-07-13 20:05   ` Daniel Henrique Barboza
2022-06-27 14:11 ` [PATCH 3/6] target/ppc: remove mfdcrux and mtdcrux Matheus Ferst
2022-06-27 17:49   ` Fabiano Rosas
2022-06-27 14:11 ` [PATCH 4/6] target/ppc: fix exception error code in helper_{load, store}_dcr Matheus Ferst
2022-07-13 20:07   ` [PATCH 4/6] target/ppc: fix exception error code in helper_{load,store}_dcr Daniel Henrique Barboza
2022-06-27 14:11 ` [PATCH 5/6] target/ppc: fix PMU Group A register read/write exceptions Matheus Ferst
2022-06-27 18:00   ` Daniel Henrique Barboza [this message]
2022-06-27 14:11 ` [PATCH 6/6] target/ppc: fix exception error code in spr_write_excp_vector Matheus Ferst
2022-07-13 20:08   ` Daniel Henrique Barboza
2022-07-14 13:00 ` [PATCH 0/6] Fix gen_*_exception error codes Daniel Henrique Barboza

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f3ea7123-ba0f-3955-9f32-af7d13054e39@gmail.com \
    --to=danielhb413@gmail.com \
    --cc=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=farosas@linux.ibm.com \
    --cc=groug@kaod.org \
    --cc=laurent@vivier.eu \
    --cc=matheus.ferst@eldorado.org.br \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.