Skip to content

Commit 352bd64

Browse files
jgunthorpewilldeacon
authored andcommitted
iommu/arm-smmu-v3: Add a global static BLOCKED domain
Using the same design as the IDENTITY domain install an STRTAB_STE_0_CFG_ABORT STE. Reviewed-by: Michael Shavit <[email protected]> Reviewed-by: Nicolin Chen <[email protected]> Tested-by: Shameer Kolothum <[email protected]> Tested-by: Nicolin Chen <[email protected]> Tested-by: Moritz Fischer <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 12dacfb commit 352bd64

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2674,6 +2674,24 @@ static struct iommu_domain arm_smmu_identity_domain = {
26742674
.ops = &arm_smmu_identity_ops,
26752675
};
26762676

2677+
static int arm_smmu_attach_dev_blocked(struct iommu_domain *domain,
2678+
struct device *dev)
2679+
{
2680+
struct arm_smmu_ste ste;
2681+
2682+
arm_smmu_make_abort_ste(&ste);
2683+
return arm_smmu_attach_dev_ste(dev, &ste);
2684+
}
2685+
2686+
static const struct iommu_domain_ops arm_smmu_blocked_ops = {
2687+
.attach_dev = arm_smmu_attach_dev_blocked,
2688+
};
2689+
2690+
static struct iommu_domain arm_smmu_blocked_domain = {
2691+
.type = IOMMU_DOMAIN_BLOCKED,
2692+
.ops = &arm_smmu_blocked_ops,
2693+
};
2694+
26772695
static int arm_smmu_map_pages(struct iommu_domain *domain, unsigned long iova,
26782696
phys_addr_t paddr, size_t pgsize, size_t pgcount,
26792697
int prot, gfp_t gfp, size_t *mapped)
@@ -3064,6 +3082,7 @@ static void arm_smmu_remove_dev_pasid(struct device *dev, ioasid_t pasid)
30643082

30653083
static struct iommu_ops arm_smmu_ops = {
30663084
.identity_domain = &arm_smmu_identity_domain,
3085+
.blocked_domain = &arm_smmu_blocked_domain,
30673086
.capable = arm_smmu_capable,
30683087
.domain_alloc = arm_smmu_domain_alloc,
30693088
.probe_device = arm_smmu_probe_device,

0 commit comments

Comments
 (0)