KVM: arm64: Use ARM64_MIN_PARANGE_BITS as the minimum supported IPA
authorAnshuman Khandual <anshuman.khandual@arm.com>
Thu, 12 Aug 2021 05:09:51 +0000 (10:39 +0530)
committerMarc Zyngier <maz@kernel.org>
Wed, 18 Aug 2021 08:26:06 +0000 (09:26 +0100)
Drop hard coded value for the minimum supported IPA range bits (i.e 32).
Instead use ARM64_MIN_PARANGE_BITS which improves the code readability.

Cc: Marc Zyngier <maz@kernel.org>
Cc: James Morse <james.morse@arm.com>
Cc: Alexandru Elisei <alexandru.elisei@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: kvmarm@lists.cs.columbia.edu
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/1628744994-16623-3-git-send-email-anshuman.khandual@arm.com
arch/arm64/kvm/reset.c

index 18ffc6a..08fd487 100644 (file)
@@ -364,7 +364,7 @@ int kvm_arm_setup_stage2(struct kvm *kvm, unsigned long type)
        phys_shift = KVM_VM_TYPE_ARM_IPA_SIZE(type);
        if (phys_shift) {
                if (phys_shift > kvm_ipa_limit ||
-                   phys_shift < 32)
+                   phys_shift < ARM64_MIN_PARANGE_BITS)
                        return -EINVAL;
        } else {
                phys_shift = KVM_PHYS_SHIFT;