From: Eric Auger <eric.auger@redhat.com>
To: Nabih Estefan <nabihestefan@google.com>, peter.maydell@linaro.org
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org,
qemu-block@nongnu.org, its@irrelevant.dk, kbusch@kernel.org,
roqueh@google.com
Subject: Re: [PATCH 1/2] hw/arm/smmuv3: Check StreamIDs against SMMU_IDR1.SIDSIZE value
Date: Fri, 23 Feb 2024 08:55:36 +0100 [thread overview]
Message-ID: <25ce0183-3c08-4ead-a5d9-36dcd0879c4e@redhat.com> (raw)
In-Reply-To: <20240221171716.1260192-2-nabihestefan@google.com>
Hi,
On 2/21/24 18:17, Nabih Estefan wrote:
> From: Roque Arcudia Hernandez <roqueh@google.com>
>
> Current implementation checks the StreamIDs against STRTAB_BASE_CFG.LOG2SIZE
> register field value and a constant SMMU_IDR1_SIDSIZE which is also used as
> initial value for field SMMU_IDR1.SIDSIZE.
>
> This limits the possibility of extending the SMMUv3 by inheritance and
> redefining the value of SMMU_IDR1.SIDSIZE because the check is hardcoded to the
> constant SMMU_IDR1_SIDSIZE rather than the register value.
>
> Signed-off-by: Roque Arcudia Hernandez <roqueh@google.com>
> Signed-off-by: Nabih Estefan <nabihestefan@google.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Thanks
Eric
> ---
> hw/arm/smmuv3.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
> index 9eb56a70f3..a01031821a 100644
> --- a/hw/arm/smmuv3.c
> +++ b/hw/arm/smmuv3.c
> @@ -580,15 +580,17 @@ static int smmu_find_ste(SMMUv3State *s, uint32_t sid, STE *ste,
> {
> dma_addr_t addr, strtab_base;
> uint32_t log2size;
> + uint32_t idr1_sidsize;
> int strtab_size_shift;
> int ret;
>
> trace_smmuv3_find_ste(sid, s->features, s->sid_split);
> log2size = FIELD_EX32(s->strtab_base_cfg, STRTAB_BASE_CFG, LOG2SIZE);
> + idr1_sidsize = FIELD_EX32(s->idr[1], IDR1, SIDSIZE);
> /*
> * Check SID range against both guest-configured and implementation limits
> */
> - if (sid >= (1 << MIN(log2size, SMMU_IDR1_SIDSIZE))) {
> + if (sid >= (1 << MIN(log2size, idr1_sidsize))) {
> event->type = SMMU_EVT_C_BAD_STREAMID;
> return -EINVAL;
> }
next prev parent reply other threads:[~2024-02-23 7:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-21 17:17 [PATCH 0/2] ARM SMMUv3 StreamID Implementation Nabih Estefan
2024-02-21 17:17 ` [PATCH 1/2] hw/arm/smmuv3: Check StreamIDs against SMMU_IDR1.SIDSIZE value Nabih Estefan
2024-02-23 7:55 ` Eric Auger [this message]
2024-02-21 17:17 ` [PATCH 2/2] hw/arm/smmu-common: Create virtual function for implementation defined StreamID Nabih Estefan
2024-02-23 8:09 ` Eric Auger
2025-01-09 17:34 ` [PATCH 0/2] ARM SMMUv3 StreamID Implementation Alex Bennée
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=25ce0183-3c08-4ead-a5d9-36dcd0879c4e@redhat.com \
--to=eric.auger@redhat.com \
--cc=its@irrelevant.dk \
--cc=kbusch@kernel.org \
--cc=nabihestefan@google.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=roqueh@google.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).