* [PATCH v2 0/2] Add arm-smmu-v3 support for Laguna SMMU silicon erratum workaround
@ 2026-09-11 21:21 Peter Griffin
2026-09-11 21:21 ` [PATCH v2 1/2] dt-bindings: iommu: arm,smmu-v3: Add arm,instdata-override property Peter Griffin
2026-09-11 21:21 ` [PATCH v2 2/2] iommu/arm-smmu-v3: Add support for arm,instdata-override DT property Peter Griffin
0 siblings, 2 replies; 5+ messages in thread
From: Peter Griffin @ 2026-09-11 21:21 UTC (permalink / raw)
To: Will Deacon, Robin Murphy, Joerg Roedel (AMD),
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Pranjal Shrivastava, Daniel Mentz, Mostafa Saleh,
linux-arm-kernel, iommu, devicetree, linux-kernel, kernel-team,
tudor.ambarus, andre.draszik, willmcvicker, jyescas,
Peter Griffin
Hi folks,
The Google Tensor G5 SoC (Laguna) has a silicon erratum with the SMMU
integration where the AxPROT[2] signal is always 1, which makes all
transactions appear as instructions.
As a software workaround we make use of the INSTCFG override feature to
force all incoming traffic to data.
To enable this workaround, the "arm,instdata-override" DT property can be
provided in the device tree entry for the SMMU, similar to how existing
errata workarounds are handled by this driver.
The first patch in this series adds the DT bindings documentation for the
property and the second patch adds the associated driver changes. The
Laguna SMMU device tree changes will be sent separately (as that will
go via Arm SoC tree).
Note existing silicon errata DT options in this driver tend to use a vendor
prefix e.g. hisilicon,broken-prefetch-cmd or
cavium,cn9900-broken-page1-regspace. But Rob agreed in the v1 thread that
using "arm,instdata-override" makes sense here in case other SoCs need
to use this.
The Arm SMMU spec that documents the instcfg feature can be found at this
link: https://developer.arm.com/documentation/ihi0070/ha/
regards,
Peter
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
---
Changes in v2:
- Add a more verbose commit message of the silicon errata issue (Will/Robin)
- Make clear it is a silicon errata software workaround not a "feature" (Rob)
- Fixup incorrect bracket (Sashiko / Nicolin)
- Add a note about why "bypass" is not required in commit message (Nicolin)
- Remove feature flag (Nicolin)
- Move override feature/DT property sanity check closer to the
register read (Peter)
- Rebase on next-20260911
- Link to v1: https://lore.kernel.org/r/20260724-arm-smmu-v3-instcfg-override-v1-0-e7acf4a8a525@linaro.org
---
Peter Griffin (2):
dt-bindings: iommu: arm,smmu-v3: Add arm,instdata-override property
iommu/arm-smmu-v3: Add support for arm,instdata-override DT property
.../devicetree/bindings/iommu/arm,smmu-v3.yaml | 10 +++++++++
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 25 ++++++++++++++++++----
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 6 ++++++
3 files changed, 37 insertions(+), 4 deletions(-)
---
base-commit: 68142f986ff04b2b70b31db00f719bf690f64a9a
change-id: 20260724-arm-smmu-v3-instcfg-override-b5650fdbfe34
Best regards,
--
Peter Griffin <peter.griffin@linaro.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/2] dt-bindings: iommu: arm,smmu-v3: Add arm,instdata-override property
2026-09-11 21:21 [PATCH v2 0/2] Add arm-smmu-v3 support for Laguna SMMU silicon erratum workaround Peter Griffin
@ 2026-09-11 21:21 ` Peter Griffin
2026-09-24 14:41 ` Rob Herring (Arm)
2026-09-11 21:21 ` [PATCH v2 2/2] iommu/arm-smmu-v3: Add support for arm,instdata-override DT property Peter Griffin
1 sibling, 1 reply; 5+ messages in thread
From: Peter Griffin @ 2026-09-11 21:21 UTC (permalink / raw)
To: Will Deacon, Robin Murphy, Joerg Roedel (AMD),
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Pranjal Shrivastava, Daniel Mentz, Mostafa Saleh,
linux-arm-kernel, iommu, devicetree, linux-kernel, kernel-team,
tudor.ambarus, andre.draszik, willmcvicker, jyescas,
Peter Griffin
arm,instdata-override DT property is intended to be used for SMMUs that
have a silicon integration issue with the AxPROT[2] signal always being 1
making all transactions appear as instructions.
Google Tensor G5 (Laguna) is an example of an SoC with this silicon
erratum. The DT property can be specified to enable a software
workaround which overrides the incoming attribute to data.
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
---
---
Documentation/devicetree/bindings/iommu/arm,smmu-v3.yaml | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu-v3.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu-v3.yaml
index 82957334bea24..3c044e4f03d4e 100644
--- a/Documentation/devicetree/bindings/iommu/arm,smmu-v3.yaml
+++ b/Documentation/devicetree/bindings/iommu/arm,smmu-v3.yaml
@@ -83,6 +83,16 @@ properties:
register access with page 0 offsets. Set for Cavium ThunderX2 silicon that
doesn't support SMMU page1 register space.
+ arm,instdata-override:
+ type: boolean
+ description:
+ Some SoCs like Google Tensor G5 (Laguna) have an SMMU integration
+ silicon erratum where AxPROT[2] signal is always 1, making all
+ transactions appear as instructions.
+
+ This property enables a software workaround to override the
+ instruction/data attribute of incoming traffic to data.
+
allOf:
- if:
not:
--
2.55.0.1007.g17ff1f9808-goog
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] iommu/arm-smmu-v3: Add support for arm,instdata-override DT property
2026-09-11 21:21 [PATCH v2 0/2] Add arm-smmu-v3 support for Laguna SMMU silicon erratum workaround Peter Griffin
2026-09-11 21:21 ` [PATCH v2 1/2] dt-bindings: iommu: arm,smmu-v3: Add arm,instdata-override property Peter Griffin
@ 2026-09-11 21:21 ` Peter Griffin
2026-09-24 23:06 ` Jason Gunthorpe
1 sibling, 1 reply; 5+ messages in thread
From: Peter Griffin @ 2026-09-11 21:21 UTC (permalink / raw)
To: Will Deacon, Robin Murphy, Joerg Roedel (AMD),
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Pranjal Shrivastava, Daniel Mentz, Mostafa Saleh,
linux-arm-kernel, iommu, devicetree, linux-kernel, kernel-team,
tudor.ambarus, andre.draszik, willmcvicker, jyescas,
Peter Griffin
The Google Tensor G5 SoC (Laguna) has a silicon errata with the SMMU
integration where the AxPROT[2] signal is always 1, which makes all
transactions appear as instructions.
To avoid F_PERMISSION faults (due to the VMSAv8-64 requirement that
unprivilieged writable buffers are treated as Privileged Execute-Never
(PXN)), as a software workaround we make use of the INSTCFG override
feature to force all incoming traffic to data.
To enable this workaround, the "arm,instdata-override" DT property can be
provided in the device tree entry for the SMMU, similar to how existing
errata workarounds are handled by this driver.
Note this is added for "stage-1" and "stage-2" but we intentionally leave
out "bypass" as nothing is downstream of the SMMU that makes use of the
Instruction/Data attribute.
Signed-off-by: Pranjal Shrivastava <praan@google.com>
[peter.griffin: ported to upstream, updated commit message, remove
feature flag]
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
---
Changes in v2
- Fixup incorrect bracket (Sashiko / Nicolin)
- Add more verbose description of the issue (Will/Robin)
- Add note about why "bypass" is not required (Nicolin)
- Remove ARM_SMMU_FEAT_PERMS_OVR flag (Nicolin)
- Move check closer to IDR1_ATTR_TYPES_OVR read
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 25 +++++++++++++++++++++----
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 6 ++++++
2 files changed, 27 insertions(+), 4 deletions(-)
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 5732f3ba0122d..f88647be94475 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -91,6 +91,7 @@ DEFINE_MUTEX(arm_smmu_asid_lock);
static struct arm_smmu_option_prop arm_smmu_options[] = {
{ ARM_SMMU_OPT_SKIP_PREFETCH, "hisilicon,broken-prefetch-cmd" },
{ ARM_SMMU_OPT_PAGE0_REGS_ONLY, "cavium,cn9900-broken-page1-regspace"},
+ { ARM_SMMU_OPT_OVR_INSTCFG_DATA, "arm,instdata-override"},
{ 0, NULL},
};
@@ -1271,7 +1272,8 @@ void arm_smmu_get_ste_used(const __le64 *ent, __le64 *used_bits)
cpu_to_le64(STRTAB_STE_1_S1DSS | STRTAB_STE_1_S1CIR |
STRTAB_STE_1_S1COR | STRTAB_STE_1_S1CSH |
STRTAB_STE_1_S1STALLD | STRTAB_STE_1_STRW |
- STRTAB_STE_1_EATS | STRTAB_STE_1_MEV);
+ STRTAB_STE_1_EATS | STRTAB_STE_1_MEV |
+ STRTAB_STE_1_INSTCFG);
used_bits[2] |= cpu_to_le64(STRTAB_STE_2_S2VMID);
/*
@@ -1287,7 +1289,8 @@ void arm_smmu_get_ste_used(const __le64 *ent, __le64 *used_bits)
if (cfg & BIT(1)) {
used_bits[1] |=
cpu_to_le64(STRTAB_STE_1_S2FWB | STRTAB_STE_1_EATS |
- STRTAB_STE_1_SHCFG | STRTAB_STE_1_MEV);
+ STRTAB_STE_1_SHCFG | STRTAB_STE_1_MEV |
+ STRTAB_STE_1_INSTCFG);
used_bits[2] |=
cpu_to_le64(STRTAB_STE_2_S2VMID | STRTAB_STE_2_VTCR |
STRTAB_STE_2_S2AA64 | STRTAB_STE_2_S2ENDI |
@@ -1900,7 +1903,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));
if ((smmu->features & ARM_SMMU_FEAT_ATTR_TYPES_OVR) &&
s1dss == STRTAB_STE_1_S1DSS_BYPASS)
@@ -1952,7 +1959,11 @@ void arm_smmu_make_s2_domain_ste(struct arm_smmu_ste *target,
target->data[1] = cpu_to_le64(
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));
if (pgtbl_cfg->quirks & IO_PGTABLE_QUIRK_ARM_S2FWB)
target->data[1] |= cpu_to_le64(STRTAB_STE_1_S2FWB);
@@ -5155,6 +5166,12 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu)
if (reg & IDR1_ATTR_TYPES_OVR)
smmu->features |= ARM_SMMU_FEAT_ATTR_TYPES_OVR;
+ if ((smmu->options & ARM_SMMU_OPT_OVR_INSTCFG_DATA) &&
+ !(reg & IDR1_ATTR_PERMS_OVR)) {
+ dev_err(smmu->dev, "Inst/Data attribute override not supported\n");
+ return -ENXIO;
+ }
+
/* Queue sizes, capped to ensure natural alignment */
smmu->cmdq.q.llq.max_n_shift = min_t(u32, CMDQ_MAX_SZ_SHIFT,
FIELD_GET(IDR1_CMDQS, reg));
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
index dd2fee2f560e6..efbac8ca6d7a0 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
@@ -52,6 +52,7 @@ struct arm_vsmmu;
#define IDR1_QUEUES_PRESET (1 << 29)
#define IDR1_REL (1 << 28)
#define IDR1_ATTR_TYPES_OVR (1 << 27)
+#define IDR1_ATTR_PERMS_OVR (1 << 26)
#define IDR1_CMDQS GENMASK(25, 21)
#define IDR1_EVTQS GENMASK(20, 16)
#define IDR1_PRIQS GENMASK(15, 11)
@@ -285,6 +286,10 @@ static inline u32 arm_smmu_strtab_l2_idx(u32 sid)
#define STRTAB_STE_1_SHCFG GENMASK_ULL(45, 44)
#define STRTAB_STE_1_SHCFG_INCOMING 1UL
+#define STRTAB_STE_1_INSTCFG GENMASK_ULL(51, 50)
+#define STRTAB_STE_1_INSTCFG_INCOMING 0UL
+#define STRTAB_STE_1_INSTCFG_DATA 2UL
+
#define STRTAB_STE_2_S2VMID GENMASK_ULL(15, 0)
#define STRTAB_STE_2_VTCR GENMASK_ULL(50, 32)
#define STRTAB_STE_2_VTCR_S2T0SZ GENMASK_ULL(5, 0)
@@ -934,6 +939,7 @@ struct arm_smmu_device {
#define ARM_SMMU_OPT_MSIPOLL (1 << 2)
#define ARM_SMMU_OPT_CMDQ_FORCE_SYNC (1 << 3)
#define ARM_SMMU_OPT_TEGRA241_CMDQV (1 << 4)
+#define ARM_SMMU_OPT_OVR_INSTCFG_DATA (1 << 5)
u32 options;
struct arm_smmu_cmdq cmdq;
--
2.55.0.1007.g17ff1f9808-goog
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: iommu: arm,smmu-v3: Add arm,instdata-override property
2026-09-11 21:21 ` [PATCH v2 1/2] dt-bindings: iommu: arm,smmu-v3: Add arm,instdata-override property Peter Griffin
@ 2026-09-24 14:41 ` Rob Herring (Arm)
0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring (Arm) @ 2026-09-24 14:41 UTC (permalink / raw)
To: Peter Griffin
Cc: Joerg Roedel (AMD),
Pranjal Shrivastava, linux-arm-kernel, devicetree, Robin Murphy,
Mostafa Saleh, Daniel Mentz, linux-kernel, willmcvicker,
tudor.ambarus, Conor Dooley, iommu, kernel-team, andre.draszik,
Krzysztof Kozlowski, Will Deacon, jyescas
On Fri, 11 Sep 2026 21:21:05 +0000, Peter Griffin wrote:
> arm,instdata-override DT property is intended to be used for SMMUs that
> have a silicon integration issue with the AxPROT[2] signal always being 1
> making all transactions appear as instructions.
>
> Google Tensor G5 (Laguna) is an example of an SoC with this silicon
> erratum. The DT property can be specified to enable a software
> workaround which overrides the incoming attribute to data.
>
> Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
> ---
> ---
> Documentation/devicetree/bindings/iommu/arm,smmu-v3.yaml | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/2] iommu/arm-smmu-v3: Add support for arm,instdata-override DT property
2026-09-11 21:21 ` [PATCH v2 2/2] iommu/arm-smmu-v3: Add support for arm,instdata-override DT property Peter Griffin
@ 2026-09-24 23:06 ` Jason Gunthorpe
0 siblings, 0 replies; 5+ messages in thread
From: Jason Gunthorpe @ 2026-09-24 23:06 UTC (permalink / raw)
To: Peter Griffin
Cc: Will Deacon, Robin Murphy, Joerg Roedel (AMD),
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Pranjal Shrivastava, Daniel Mentz, Mostafa Saleh,
linux-arm-kernel, iommu, devicetree, linux-kernel, kernel-team,
tudor.ambarus, andre.draszik, willmcvicker, jyescas
On Fri, Sep 11, 2026 at 09:21:06PM +0000, Peter Griffin wrote:
> The Google Tensor G5 SoC (Laguna) has a silicon errata with the SMMU
> integration where the AxPROT[2] signal is always 1, which makes all
> transactions appear as instructions.
>
> To avoid F_PERMISSION faults (due to the VMSAv8-64 requirement that
> unprivilieged writable buffers are treated as Privileged Execute-Never
> (PXN)), as a software workaround we make use of the INSTCFG override
> feature to force all incoming traffic to data.
>
> To enable this workaround, the "arm,instdata-override" DT property can be
> provided in the device tree entry for the SMMU, similar to how existing
> errata workarounds are handled by this driver.
>
> Note this is added for "stage-1" and "stage-2" but we intentionally leave
> out "bypass" as nothing is downstream of the SMMU that makes use of the
> Instruction/Data attribute.
>
> Signed-off-by: Pranjal Shrivastava <praan@google.com>
> [peter.griffin: ported to upstream, updated commit message, remove
> feature flag]
> Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
> ---
> Changes in v2
> - Fixup incorrect bracket (Sashiko / Nicolin)
> - Add more verbose description of the issue (Will/Robin)
> - Add note about why "bypass" is not required (Nicolin)
> - Remove ARM_SMMU_FEAT_PERMS_OVR flag (Nicolin)
> - Move check closer to IDR1_ATTR_TYPES_OVR read
> ---
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 25 +++++++++++++++++++++----
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 6 ++++++
> 2 files changed, 27 insertions(+), 4 deletions(-)
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Jason
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-09-24 23:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11 21:21 [PATCH v2 0/2] Add arm-smmu-v3 support for Laguna SMMU silicon erratum workaround Peter Griffin
2026-09-11 21:21 ` [PATCH v2 1/2] dt-bindings: iommu: arm,smmu-v3: Add arm,instdata-override property Peter Griffin
2026-09-24 14:41 ` Rob Herring (Arm)
2026-09-11 21:21 ` [PATCH v2 2/2] iommu/arm-smmu-v3: Add support for arm,instdata-override DT property Peter Griffin
2026-09-24 23:06 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®