Message ID | 57307863.1070706@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Mon, May 09, 2016 at 12:45:39PM +0100, Robin Murphy wrote: > Thanks a lot! I was expecting to pick this up again after the merge > window and post an updated version then; as you may already have > found, patch 5 conflicts somewhat with the SMMUv2 context format > changes in Will's updates branch. The correct resolution requires a > bit of rewriting, so below is what that patch looks like when > rebased on top of Will's branch. If you'd prefer it in actual merge > resolution format, shout and I'll give that a go. Okay, hmm, but the patch does not apply here, even after fixing the line breaks. I'll push my tree soon, can you rebase this patch on-top the core branch then? It should already contain patches 1-4. Joerg
On 09/05/16 15:51, Joerg Roedel wrote: > On Mon, May 09, 2016 at 12:45:39PM +0100, Robin Murphy wrote: >> Thanks a lot! I was expecting to pick this up again after the merge >> window and post an updated version then; as you may already have >> found, patch 5 conflicts somewhat with the SMMUv2 context format >> changes in Will's updates branch. The correct resolution requires a >> bit of rewriting, so below is what that patch looks like when >> rebased on top of Will's branch. If you'd prefer it in actual merge >> resolution format, shout and I'll give that a go. > > Okay, hmm, but the patch does not apply here, even after fixing the line > breaks. I'll push my tree soon, can you rebase this patch on-top the > core branch then? It should already contain patches 1-4. Bah, I saw last week's "Merge remote-tracking branch 'will/for-joerg/arm-smmu/updates' into HEAD" commit on that branch without spotting it was no longer up to date, sorry. Yes, it's probably safest if I rebase on top of your merge of everything else - I'll keep an eye out. Thanks, Robin. > > > Joerg >
On Mon, May 09, 2016 at 04:18:39PM +0100, Robin Murphy wrote: > Bah, I saw last week's "Merge remote-tracking branch > 'will/for-joerg/arm-smmu/updates' into HEAD" commit on that branch > without spotting it was no longer up to date, sorry. Yes, it's > probably safest if I rebase on top of your merge of everything else > - I'll keep an eye out. My tree is pushed now, you can rebase this one patch on the core branch and resend. Thanks, Joerg
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 4ff73ff64e49..ebab33e77d67 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -590,6 +590,7 @@ struct arm_smmu_device { unsigned long ias; /* IPA */ unsigned long oas; /* PA */ + unsigned long pgsize_bitmap; #define ARM_SMMU_MAX_ASIDS (1 << 16) unsigned int asid_bits; @@ -1516,8 +1517,6 @@ static int arm_smmu_domain_finalise_s2(struct arm_smmu_domain *smmu_domain, return 0; } -static struct iommu_ops arm_smmu_ops; - static int arm_smmu_domain_finalise(struct iommu_domain *domain) { int ret; @@ -1555,7 +1554,7 @@ static int arm_smmu_domain_finalise(struct iommu_domain *domain) } pgtbl_cfg = (struct io_pgtable_cfg) { - .pgsize_bitmap = arm_smmu_ops.pgsize_bitmap, + .pgsize_bitmap = smmu->pgsize_bitmap, .ias = ias, .oas = oas, .tlb = &arm_smmu_gather_ops, @@ -1566,7 +1565,7 @@ static int arm_smmu_domain_finalise(struct iommu_domain *domain) if (!pgtbl_ops) return -ENOMEM; - arm_smmu_ops.pgsize_bitmap = pgtbl_cfg.pgsize_bitmap; + domain->pgsize_bitmap = pgtbl_cfg.pgsize_bitmap; smmu_domain->pgtbl_ops = pgtbl_ops; ret = finalise_stage_fn(smmu_domain, &pgtbl_cfg); @@ -2410,7 +2409,6 @@ static int arm_smmu_device_probe(struct arm_smmu_device *smmu) { u32 reg; bool coherent; - unsigned long pgsize_bitmap = 0; /* IDR0 */ reg = readl_relaxed(smmu->base + ARM_SMMU_IDR0); @@ -2541,13 +2539,16 @@ static int arm_smmu_device_probe(struct arm_smmu_device *smmu) /* Page sizes */ if (reg & IDR5_GRAN64K) - pgsize_bitmap |= SZ_64K | SZ_512M; + smmu->pgsize_bitmap |= SZ_64K | SZ_512M; if (reg & IDR5_GRAN16K) - pgsize_bitmap |= SZ_16K | SZ_32M; + smmu->pgsize_bitmap |= SZ_16K | SZ_32M; if (reg & IDR5_GRAN4K) - pgsize_bitmap |= SZ_4K | SZ_2M | SZ_1G; + smmu->pgsize_bitmap |= SZ_4K | SZ_2M | SZ_1G; - arm_smmu_ops.pgsize_bitmap &= pgsize_bitmap; + if (arm_smmu_ops.pgsize_bitmap == -1UL) + arm_smmu_ops.pgsize_bitmap = smmu->pgsize_bitmap; + else + arm_smmu_ops.pgsize_bitmap |= smmu->pgsize_bitmap; /* Output address size */ switch (reg & IDR5_OAS_MASK << IDR5_OAS_SHIFT) { diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 0bda956a025c..bf30490d6b18 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -343,6 +343,7 @@ struct arm_smmu_device { unsigned long va_size; unsigned long ipa_size; unsigned long pa_size; + unsigned long pgsize_bitmap; u32 num_global_irqs; u32 num_context_irqs; @@ -388,8 +389,6 @@ struct arm_smmu_domain { struct iommu_domain domain; }; -static struct iommu_ops arm_smmu_ops; - static DEFINE_SPINLOCK(arm_smmu_devices_lock); static LIST_HEAD(arm_smmu_devices); @@ -949,7 +948,7 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain, } pgtbl_cfg = (struct io_pgtable_cfg) { - .pgsize_bitmap = arm_smmu_ops.pgsize_bitmap, + .pgsize_bitmap = smmu->pgsize_bitmap, .ias = ias, .oas = oas,