[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 19/22] target/arm: Implement GPC exceptions
From: |
Peter Maydell |
Subject: |
Re: [PATCH 19/22] target/arm: Implement GPC exceptions |
Date: |
Fri, 10 Feb 2023 13:53:01 +0000 |
On Tue, 24 Jan 2023 at 00:02, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Handle GPC Fault types in arm_deliver_fault, reporting as
> either a GPC exception at EL3, or falling through to insn
> or data aborts at various exception levels.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> +static unsigned encode_gpcsc(ARMMMUFaultInfo *fi)
> +{
> + static uint8_t const gpcsc[] = {
> + [GPCF_AddressSize] = 0b00000,
> + [GPCF_Walk] = 0b00010,
> + [GPCF_Fail] = 0b00110,
> + [GPCF_EABT] = 0b01010,
> + };
> +
> + /* Note that we've validated fi->gpcf and fi->level above. */
> + return gpcsc[fi->gpcf] | fi->level;
GPCSC is 6 bits, and you've only put the top 5 bits in the
gpcsc[] array here, so you either need to shift that right
by 1, or else have the array entries all have an extra 0
on the least-significant end.
The comment says gpcf and level have been validated, but
the code assumes that GPCF_AddressSize implies level 0,
which isn't validated.
Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH 19/22] target/arm: Implement GPC exceptions,
Peter Maydell <=