[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/24] hw/arm/smmuv3: Advertise SMMUv3.1-XNX feature
From: |
Peter Maydell |
Subject: |
[PULL 18/24] hw/arm/smmuv3: Advertise SMMUv3.1-XNX feature |
Date: |
Thu, 19 Oct 2023 14:35:31 +0100 |
The SMMUv3.1-XNX feature is mandatory for an SMMUv3.1 if S2P is
supported, so we should theoretically have implemented it as part of
the recent S2P work. Fortunately, for us the implementation is a
no-op.
This feature is about interpretation of the stage 2 page table
descriptor XN bits, which control execute permissions.
For QEMU, the permission bits passed to an IOMMU (via MemTxAttrs and
IOMMUAccessFlags) only indicate read and write; we do not distinguish
data reads from instruction reads outside the CPU proper. In the
SMMU architecture's terms, our interconnect between the client device
and the SMMU doesn't have the ability to convey the INST attribute,
and we therefore use the default value of "data" for this attribute.
We also do not support the bits in the Stream Table Entry that can
override the on-the-bus transaction attribute permissions (we do not
set SMMU_IDR1.ATTR_PERMS_OVR=1).
These two things together mean that for our implementation, it never
has to deal with transactions with the INST attribute, and so it can
correctly ignore the XN bits entirely. So we already implement
FEAT_XNX's "XN field is now 2 bits, not 1" behaviour to the extent
that we need to.
Advertise the presence of the feature in SMMU_IDR3.XNX.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Mostafa Saleh <smostafa@google.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Message-id: 20230914145705.1648377-4-peter.maydell@linaro.org
---
hw/arm/smmuv3.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
index f03d58300fa..c3871ae067f 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -279,6 +279,10 @@ static void smmuv3_init_regs(SMMUv3State *s)
s->idr[1] = FIELD_DP32(s->idr[1], IDR1, CMDQS, SMMU_CMDQS);
s->idr[3] = FIELD_DP32(s->idr[3], IDR3, HAD, 1);
+ if (FIELD_EX32(s->idr[0], IDR0, S2P)) {
+ /* XNX is a stage-2-specific feature */
+ s->idr[3] = FIELD_DP32(s->idr[3], IDR3, XNX, 1);
+ }
s->idr[3] = FIELD_DP32(s->idr[3], IDR3, RIL, 1);
s->idr[3] = FIELD_DP32(s->idr[3], IDR3, BBML, 2);
--
2.34.1
- [PULL 11/24] include/hw/arm: move BSA definitions to bsa.h, (continued)
- [PULL 11/24] include/hw/arm: move BSA definitions to bsa.h, Peter Maydell, 2023/10/19
- [PULL 07/24] elf2dmp: limit print length for sign_rsds, Peter Maydell, 2023/10/19
- [PULL 09/24] target/arm: Fix CNTPCT_EL0 trapping from EL0 when HCR_EL2.E2H is 0, Peter Maydell, 2023/10/19
- [PULL 10/24] {include/}hw/arm: refactor virt PPI logic, Peter Maydell, 2023/10/19
- [PULL 13/24] arm/kvm: convert to kvm_set_one_reg, Peter Maydell, 2023/10/19
- [PULL 21/24] target/arm/common-semi-target.h: Remove unnecessary boot.h include, Peter Maydell, 2023/10/19
- [PULL 23/24] hw/timer/npcm7xx_timer: Prevent timer from counting down past zero, Peter Maydell, 2023/10/19
- [PULL 16/24] hw/arm/smmuv3: Update ID register bit field definitions, Peter Maydell, 2023/10/19
- [PULL 17/24] hw/arm/smmuv3: Sort ID register setting into field order, Peter Maydell, 2023/10/19
- [PULL 24/24] contrib/elf2dmp: Use g_malloc(), g_new() and g_free(), Peter Maydell, 2023/10/19
- [PULL 18/24] hw/arm/smmuv3: Advertise SMMUv3.1-XNX feature,
Peter Maydell <=
- [PULL 19/24] target/arm: Implement FEAT_HPMN0, Peter Maydell, 2023/10/19
- [PULL 03/24] xlnx-bbram: hw/nvram: Remove deprecated device reset, Peter Maydell, 2023/10/19
- [PULL 04/24] xlnx-zynqmp-efuse: hw/nvram: Remove deprecated device reset, Peter Maydell, 2023/10/19
- [PULL 05/24] xlnx-versal-efuse: hw/nvram: Remove deprecated device reset, Peter Maydell, 2023/10/19
- [PULL 06/24] xlnx-bbram: hw/nvram: Use dot in device type name, Peter Maydell, 2023/10/19
- [PULL 08/24] elf2dmp: check array bounds in pdb_get_file_size, Peter Maydell, 2023/10/19
- [PULL 15/24] target/arm: Permit T32 LDM with single register, Peter Maydell, 2023/10/19
- [PULL 22/24] target/arm/arm-powerctl: Correctly init CPUs when powered on to lower EL, Peter Maydell, 2023/10/19
- [PULL 20/24] target/arm/kvm64.c: Remove unused include, Peter Maydell, 2023/10/19
- Re: [PULL 00/24] target-arm queue, Stefan Hajnoczi, 2023/10/20