Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Peter Griffin" <peter.griffin@linaro.org>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH 2/2] iommu/arm-smmu-v3: Override for Inst/Data attribute
Date: Fri, 24 Jul 2026 12:48:23 +0000	[thread overview]
Message-ID: <20260724124823.D8D4A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260724-arm-smmu-v3-instcfg-override-v1-2-e7acf4a8a525@linaro.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Incorrect parenthesis placement in `arm_smmu_make_cdtable_ste()` causes the `STRTAB_STE_1_INSTCFG` bitfield to be evaluated outside the `cpu_to_le64()` macro. On big-endian platforms, this mixes little-endian data with host-endian data, leading to corruption of the Stream Table Entry.
--

--- Patch [2]: [PATCH 2/2] iommu/arm-smmu-v3: Override for Inst/Data attribute ---
commit af569c8fadcbad6c95ec600eb667d4a653e847dd
Author: Peter Griffin <peter.griffin@linaro.org>

iommu/arm-smmu-v3: Override for Inst/Data attribute

This commit adds an option to override the instruction/data attribute of
incoming traffic to Data by setting the INSTCFG override in all Stream Table
Entries. The option is configurable via the arm,instdata-override device tree
property.

> diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> index 57b750ebcd3d6..2b39cb5aa49d0 100644
> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
[ ... ]
> @@ -1835,7 +1838,11 @@ void arm_smmu_make_cdtable_ste(struct arm_smmu_ste *target,
>  			 STRTAB_STE_1_S1STALLD :
>  			 0) |
>  		FIELD_PREP(STRTAB_STE_1_EATS,
> -			   ats_enabled ? STRTAB_STE_1_EATS_TRANS : 0));
> +			   ats_enabled ? STRTAB_STE_1_EATS_TRANS : 0)) |
> +		FIELD_PREP(STRTAB_STE_1_INSTCFG,
> +			   smmu->options & ARM_SMMU_OPT_OVR_INSTCFG_DATA ?
> +				   STRTAB_STE_1_INSTCFG_DATA :
> +				   STRTAB_STE_1_INSTCFG_INCOMING);

[Severity: High]
Does this prematurely close the cpu_to_le64() macro?

By having the extra parenthesis after 0, the STRTAB_STE_1_INSTCFG field
appears to be bitwise-ORed in host endianness rather than being
little-endian swapped along with the rest of the fields.

On big-endian platforms, could this mix little-endian and host-endian data,
leading to corruption of the Stream Table Entry?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260724-arm-smmu-v3-instcfg-override-v1-0-e7acf4a8a525@linaro.org?part=2

      reply	other threads:[~2026-07-24 12:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24 12:39 [PATCH 0/2] Add arm-smmu-v3 support for instcfg data override feature Peter Griffin
2026-07-24 12:39 ` [PATCH 1/2] dt-bindings: iommu: add arm,instdata-override property documentation Peter Griffin
2026-07-24 12:39 ` [PATCH 2/2] iommu/arm-smmu-v3: Override for Inst/Data attribute Peter Griffin
2026-07-24 12:48   ` sashiko-bot [this message]

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=20260724124823.D8D4A1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=peter.griffin@linaro.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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