.flush_iotlb_all can not just wait for previous tlbi operations to be
completed, but should also invalid all TLBs of the related domain.
Signed-off-by: Zhen Lei
Reviewed-by: Robin Murphy
---
drivers/iommu/arm-smmu-v3.c | 10 +-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git
Add a bootup option to make the system manager can choose which mode to
be used. The default mode is strict.
Signed-off-by: Zhen Lei
---
Documentation/admin-guide/kernel-parameters.txt | 13 +
drivers/iommu/arm-smmu-v3.c | 22 +-
2 files
ut, because msidata=1 is overridden by
cmd0, that means VAL=0, sync_idx=1.
Zhen Lei (2):
iommu/arm-smmu-v3: fix unexpected CMD_SYNC timeout
iommu/arm-smmu-v3: avoid redundant CMD_SYNCs if possible
drivers/iommu/arm-smmu-v3.c | 30 +-
1 file
use msidata=1 is overridden by
cmd0, that means VAL=0, sync_idx=1.
This is not a functional problem, just make the caller wait for a long
time until TIMEOUT. It's rare to happen, because any other CMD_SYNCs
during the waiting period will break it.
Signed-off-by: Zhen Lei
--
/3. See below:
CMD_SYNCs reduced: 19542181
CMD_SYNCs total:58098548(include reduced)
CMDs total: 116197099 (TLBI:SYNC about 1:1)
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 22 +++---
1 file changed, 19 insertions(+), 3 deletions
SIG_IRQ mode into a single function,
to ensure better performance and good coding style.
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 26 +++---
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
smmu execute cmd1
smmu execute TLBI
smmu execute cmd0
poll timeout, because msidata=1 is overridden by
cmd0, that means VAL=0, sync_idx=1.
Zhen Lei (2):
iommu/arm-smmu-v3: fix unexpected CMD_SYNC timeout
iommu/arm-smmu-
/3. See below:
CMD_SYNCs reduced: 19542181
CMD_SYNCs total:58098548(include reduced)
CMDs total: 116197099 (TLBI:SYNC about 1:1)
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 22 +++---
1 file changed, 19 insertions(+), 3 deletions
Remove the words "pci", to make this function can also be used by
non-pci devices.
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 6d6712
Add a new local variable to store the value of log2size, so that it will
not be overridden by L1 table size.
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm
In context descriptor, the offset of IR0 is 8, the offset of OR0 is 10.
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 2a5f810..43120ad 100644
--- a
Because we will choose the minimum value between STRTAB_L1_SZ_SHIFT and
IDR1.SIDSIZE, so enlarge STRTAB_L1_SZ_SHIFT will not impact the platforms
whose IDR1.SIDSIZE is smaller than old STRTAB_L1_SZ_SHIFT value.
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 2 +-
1 file changed, 1
The element size of cfg->strtab is just one DWORD, should use multiply
operation.
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index ba7fe2d..2a5f810 100
Now we only use TT0 translation, disable TT1 translation will safer.
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 43120ad..6d6712e 100644
--- a
support a master
with only one stream id. If some platforms that a master belongs to more than
one
SMMUs or have more than one device-id, we should dynamic memory allocation to
record
all information.
Zhen Lei (8):
iommu/arm-smmu: fix the assignment of log2size field
iommu/arm-smmu: fix the
Some broken SMMUv3 devices treat CMD_PREFETCH_CONFIG as illegal command,
it's ugly to print error information. CMD_PREFETCH_CONFIG is just used to
prefetch the configuration for a specified StreamID, without this command
will not impact SMMUv3 function.
Signed-off-by: Zhen Lei
---
drivers/
Now, we only support a master with only one stream id. It will cover most
hardware platforms and coding so easy.
Please refer Documentation\devicetree\bindings\iommu\iommu.txt on how to
bind device tree.
Signed-off-by: Zhen Lei
---
arch/arm64/include/asm/device.h | 2 +
drivers/iommu/arm-smmu
For pci devices, only the root nodes have "iommus" property. So we
should traverse all of its sub nodes in of_xlate.
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 119 +---
1 file changed, 89 insertions(+), 30 deletions(-)
di
It can be replaced by of_iommu_list(in of_iommu.c).
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 22 ++
1 file changed, 2 insertions(+), 20 deletions(-)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index c569539..39c55f6 100644
--- a
Because we will choose the minimum value between STRTAB_L1_SZ_SHIFT and
IDR1.SIDSIZE, so enlarge STRTAB_L1_SZ_SHIFT will not impact the platforms
whose IDR1.SIDSIZE is smaller than old STRTAB_L1_SZ_SHIFT value.
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 5 +++--
1 file changed, 3
The element size of cfg->strtab is just one DWORD, should use multiply
operation.
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 56a1fbe..48be7eb 100
ifferences just because of add tabs.
scripts/checkpatch.pl 0006-iommu-arm-smmu-to-support-probe-deferral.patch
WARNING: else is not generally useful after a break or return
#161: FILE: drivers/iommu/arm-smmu-v3.c:1938:
+ return -ENODEV;
+ } else {
Zhen Lei (9):
iommu/arm-smmu
Hisilicon SMMUv3 devices treat CMD_PREFETCH_CONFIG as a illegal command,
execute it will trigger GERROR interrupt. Although the gerror code manage
to turn the prefetch into a SYNC, and the system can continue to run
normally, but it's ugly to print error information.
Signed-off-by: Zhe
This patch support a master with multiple stream IDs, but doesn't support a
master behinds more than one SMMUs.
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 39 +--
1 file changed, 37 insertions(+), 2 deletions(-)
diff --git a/drivers/iomm
Remove the words "pci", to make this function can also be used by
non-pci devices.
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 39c55f
In SMMU_CBn_TCR when LPAE enabled, the offset of IRGN0 is 8, the offset
of ORGN0 is 10.
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 48be7eb
Add a new local variable to store the value of L1 talbe size, so that it
will not conflict with L1 talbe log2entries(stored in variable size).
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 17 +
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers
s.
patch 9/9 add support for a master with multiple stream IDs.
Zhen Lei (5):
iommu/arm-smmu: to support probe deferral
iommu/arm-smmu: remove arm_smmu_devices
iommu/arm-smmu: rename __arm_smmu_get_pci_sid
iommu/arm-smmu: add support for non-pci devices
iommu/arm-smmu: describe the limita
This patch support a master with multiple stream IDs, but doesn't support a
master behinds more than one SMMUs.
Reviewed-by: Robin Murphy
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 40 ++--
1 file changed, 38 insertions(+), 2 dele
It can be replaced by of_iommu_list(in of_iommu.c).
Reviewed-by: Robin Murphy
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 22 ++
1 file changed, 2 insertions(+), 20 deletions(-)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index
*/
if (!root->archdata.iommu)
return -ENODEV;
__arm_smmu_add_pci_device(pdev, root->archdata.iommu);
Reviewed-by: Robin Murphy
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 147 +++-
1 file changed, 117 insertion
Only support #iommu-cells = <1>.
Signed-off-by: Zhen Lei
---
Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt | 6 ++
1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt
b/Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt
Remove the words "pci", to make this function can also be used by
non-pci devices.
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 9daf4c
This patch eliminate the strong dependence on Laurent's series(to support
probe deferral). That means, no matter whether Laurent's series upstreamed
or not, the smmu-v3 driver will always work well.
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 20 ++
t probe deferral.
patch 7/9 according to Robin Murphy's suggestion, remove global variable
arm_smmu_devices, thanks.
patch 9/9 add support for a master with multiple stream IDs.
Zhen Lei (5):
iommu/arm-smmu: to support probe deferral
iommu/arm-smmu: rename __arm_smmu_get_pci_sid
iommu/
This patch support a master with multiple stream IDs, but doesn't support a
master behinds more than one SMMUs.
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 40 ++--
1 file changed, 38 insertions(+), 2 deletions(-)
diff --git a/drivers/iomm
Only support #iommu-cells = <1>.
Signed-off-by: Zhen Lei
---
Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt | 6 ++
1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt
b/Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt
Remove the word "pci", to make this function can also be used by
non-pci devices.
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 3a54af
*/
if (!root->archdata.iommu)
return -ENODEV;
__arm_smmu_add_pci_device(pdev, root->archdata.iommu);
Signed-off-by: Zhen Lei
---
drivers/iommu/arm-smmu-v3.c | 110 +---
1 file changed, 83 insertions(+), 27 deletions(-)
diff --g
//w8 = ent->tlbi.leaf
andx4, x4, #0xf000
ubfiz x1, x7, #8, #2
orr x1, x0, x1
orrx2, x6, x2, lsl #48
orrx0, x4, x8
orrx2, x2, x5
orrx1, x1, x0
b 3e8
Signed-off-by: Zhen Lei
---
drive
/lists.linuxfoundation.org/pipermail/iommu/2021-October/059831.html
Zhen Lei (1):
iommu/arm-smmu-v3: Simplify useless instructions in
arm_smmu_cmdq_build_cmd()
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 11 ---
1 file changed, 8 insertions(+),
201 - 241 of 241 matches
Mail list logo