Hello Stefano,
> On 2 Dec 2020, at 12:53 am, Stefano Stabellini <[email protected]> wrote:
>
> On Thu, 26 Nov 2020, Rahul Singh wrote:
>> Linux SMMUv3 driver supports both Stage-1 and Stage-2 translations.
>> As of now only Stage-2 translation support has been tested.
>>
>> Once Stage-1 translation support is tested this patch can be added.
>>
>> Signed-off-by: Rahul Singh <[email protected]>
>
> [...]
>
>
>> @@ -1871,19 +1476,9 @@ static int arm_smmu_domain_finalise(struct
>> iommu_domain *domain,
>> }
>>
>> /* Restrict the stage to what we can actually support */
>> - if (!(smmu->features & ARM_SMMU_FEAT_TRANS_S1))
>> - smmu_domain->stage = ARM_SMMU_DOMAIN_S2;
>> - if (!(smmu->features & ARM_SMMU_FEAT_TRANS_S2))
>> - smmu_domain->stage = ARM_SMMU_DOMAIN_S1;
>> + smmu_domain->stage = ARM_SMMU_DOMAIN_S2;
>
> It would be good to add an helpful error message if
> ARM_SMMU_FEAT_TRANS_S2 is missing.
>
Ack. I will add error message.
Regards,
Rahul
>
>> switch (smmu_domain->stage) {
>> - case ARM_SMMU_DOMAIN_S1:
>> - ias = (smmu->features & ARM_SMMU_FEAT_VAX) ? 52 : 48;
>> - ias = min_t(unsigned long, ias, VA_BITS);
>> - oas = smmu->ias;
>> - fmt = ARM_64_LPAE_S1;
>> - finalise_stage_fn = arm_smmu_domain_finalise_s1;
>> - break;
>> case ARM_SMMU_DOMAIN_NESTED:
>> case ARM_SMMU_DOMAIN_S2:
>> ias = smmu->ias;