Oh, one more thing...

On 16/12/2019 4:37 pm, Jordan Crouse wrote:
[...]
@@ -651,6 +659,7 @@ static int arm_smmu_init_domain_context(struct iommu_domain 
*domain,
        enum io_pgtable_fmt fmt;
        struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
        struct arm_smmu_cfg *cfg = &smmu_domain->cfg;
+       u32 quirks = 0;
mutex_lock(&smmu_domain->init_mutex);
        if (smmu_domain->smmu)
@@ -719,6 +728,8 @@ static int arm_smmu_init_domain_context(struct iommu_domain 
*domain,
                oas = smmu->ipa_size;
                if (cfg->fmt == ARM_SMMU_CTX_FMT_AARCH64) {
                        fmt = ARM_64_LPAE_S1;
+                       if (smmu_domain->split_pagetables)
+                               quirks |= IO_PGTABLE_QUIRK_ARM_TTBR1;

To avoid me forgetting and questioning it again in future, I'd recommend sticking a comment somewhere near here that we don't reduce cfg->ias in this case because we're currently assuming SEP_UPSTREAM.

Robin.

                } else if (cfg->fmt == ARM_SMMU_CTX_FMT_AARCH32_L) {
                        fmt = ARM_32_LPAE_S1;
                        ias = min(ias, 32UL);
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to