From: Jan Kiszka <jan.kis...@siemens.com> We only support stage-2 translations, so quite a bit of inherited logic from Linux can be dropped.
Signed-off-by: Jan Kiszka <jan.kis...@siemens.com> --- hypervisor/arch/arm64/smmu.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/hypervisor/arch/arm64/smmu.c b/hypervisor/arch/arm64/smmu.c index e8dbf186..dc476618 100644 --- a/hypervisor/arch/arm64/smmu.c +++ b/hypervisor/arch/arm64/smmu.c @@ -34,8 +34,7 @@ #define ARM_SMMU_FEAT_COHERENT_WALK (1 << 0) #define ARM_SMMU_FEAT_STREAM_MATCH (1 << 1) -#define ARM_SMMU_FEAT_TRANS_S1 (1 << 2) -#define ARM_SMMU_FEAT_TRANS_S2 (1 << 3) +/* unused bits 2 and 3 */ #define ARM_SMMU_FEAT_VMID16 (1 << 6) #define ARM_SMMU_FEAT_FMT_AARCH64_4K (1 << 7) #define ARM_SMMU_FEAT_FMT_AARCH64_16K (1 << 8) @@ -602,16 +601,8 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu) /* Only stage 2 translation is supported */ id &= ~(ID0_S1TS | ID0_NTS); - if (id & ID0_S2TS) { - smmu->features |= ARM_SMMU_FEAT_TRANS_S2; - printk("\tStage 2 translation\n"); - } - - if (!(smmu->features & - (ARM_SMMU_FEAT_TRANS_S1 | ARM_SMMU_FEAT_TRANS_S2))) { - printk("\tNo translation support!\n"); - return -ENODEV; - } + if (!(id & ID0_S2TS)) + return trace_error(-EIO); /* * In order for DMA API calls to work properly, we must defer to what @@ -742,14 +733,8 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu) else pgsize_bitmap |= smmu->pgsize_bitmap; printk("\tsupported page sizes: 0x%08lx\n", smmu->pgsize_bitmap); - - if (smmu->features & ARM_SMMU_FEAT_TRANS_S1) - printk("\tStage-1: %lu-bit VA -> %lu-bit IPA\n", - smmu->va_size, smmu->ipa_size); - - if (smmu->features & ARM_SMMU_FEAT_TRANS_S2) - printk("\tStage-2: %lu-bit IPA -> %lu-bit PA\n", - smmu->ipa_size, smmu->pa_size); + printk("\tstage-2: %lu-bit IPA -> %lu-bit PA\n", + smmu->ipa_size, smmu->pa_size); return 0; } -- 2.26.2 -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to jailhouse-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/04866b908593d05c8c8be29fda6c890d83a99a6c.1601023807.git.jan.kiszka%40siemens.com.