From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Subject: Re: [PATCH v2 1/9] hw/intc/arm_gicv5: Ignore low bits in IRS_IST_BASER.ADDR
Date: Wed, 21 Oct 2026 16:51:07 +0200 [thread overview]
Message-ID: <dbe41dfd-bc07-41ea-a2ca-8e9adc6261a0@linaro.org> (raw)
In-Reply-To: <20260914160020.327787-2-peter.maydell@linaro.org>
On 9/14/26 18:00, Peter Maydell wrote:
> The IRS_IST_BASER.ADDR documentation says:
>
> For IRS_IST_CFGR.STRUCTURE = 0:
> Bits[N:0] of the resulting address are 0 where N depends on the ISTSZ
> and LPI_ID_BITS fields in IRS_IST_CFGR as follows:
> N = Max(5, (ISTSZ + 1) + LPI_ID_BITS)
> For IRS_IST_CFGR.STRUCTURE = 1:
>
> Bits[N:0] of the resulting address are 0 where N depends on L2SZ,
> ISTSZ, and LPI_ID_BITS in IRS_IST_CFGR as follows:
> N = Max(5, LPI_ID_BITS - ((10 - ISTSZ) + (2 * L2SZ)) + 2)
>
> This enforces that the IST is aligned to the size of the IST table,
> or to a 64-byte boundary if the table is smaller than 64 bytes, even
> if the guest programs the low bits in the ADDR field to specify an
> insufficiently aligned address.
>
> We were missing this check, and instead trusted the guest-provided
> address to be sufficiently aligned already; add the alignment
> enforcement.
>
> The GICv5 spec defines the masking to be used with the expressions
> quoted above, which work with the raw field values from the
> IRS_IST_CFGR register; these simplify down to some straightforward
> expressions based on the sanitized values we've already extracted
> form those fields. You can get to the expressions we use here either
> by working through the simplification of the GIC spec expressions, or
> from first principles (the number of bits needed for the size of the
> table in bytes is the number of bits that index it plus the number of
> bits specifying the size of an individual table entry).
>
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
> ---
> hw/intc/arm_gicv5.c | 28 ++++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
next prev parent reply other threads:[~2026-10-21 14:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 16:00 [PATCH v2 0/9] hw/intc/arm_gicv5: Minor fixes and cleanups Peter Maydell
2026-09-14 16:00 ` [PATCH v2 1/9] hw/intc/arm_gicv5: Ignore low bits in IRS_IST_BASER.ADDR Peter Maydell
2026-10-21 14:51 ` Richard Henderson [this message]
2026-09-14 16:00 ` [PATCH v2 2/9] hw/intc/arm_gicv5: Ignore low bits in L1_ISTE.L2_ADDR Peter Maydell
2026-10-21 14:52 ` Richard Henderson
2026-09-14 16:00 ` [PATCH v2 3/9] hw/intc/arm_gicv5: Regularize spacing in config_readl() switch Peter Maydell
2026-10-21 14:52 ` Richard Henderson
2026-09-14 16:00 ` [PATCH v2 4/9] hw/intc/arm_gicv5: Use cached IRS_IST_BASER.VALID state Peter Maydell
2026-10-21 14:53 ` Richard Henderson
2026-09-14 16:00 ` [PATCH v2 5/9] hw/intc/arm_gicv5: Free memory in finalize Peter Maydell
2026-09-14 16:00 ` [PATCH v2 6/9] target/arm: GICv5 cpuif: Use arm_cpu_set_irq() to set IRQ/FIQ status Peter Maydell
2026-10-07 13:20 ` Philippe Mathieu-Daudé
2026-09-14 16:00 ` [PATCH v2 7/9] target/arm: Only allow GICv5 on CPUs without AArch32 at EL1..3 Peter Maydell
2026-09-14 16:00 ` [PATCH v2 8/9] hw/intc/arm_gicv5: Pass CPU index to CPU interface Peter Maydell
2026-09-21 12:17 ` Philippe Mathieu-Daudé
2026-09-14 16:00 ` [PATCH v2 9/9] hw/intc/arm_gicv5: Pass cpuidx rather than iaffid in gicv5_get_hppi() Peter Maydell
2026-09-21 12:17 ` Philippe Mathieu-Daudé
2026-10-07 12:53 ` [PATCH v2 0/9] hw/intc/arm_gicv5: Minor fixes and cleanups Peter Maydell
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=dbe41dfd-bc07-41ea-a2ca-8e9adc6261a0@linaro.org \
--to=richard.henderson@linaro.org \
--cc=qemu-devel@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.