diff options
author | Ryan Roberts <ryan.roberts@arm.com> | 2023-11-27 14:17:35 +0300 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2023-11-27 18:03:50 +0300 |
commit | d782ac5b2ceebee5d374e13e990655d1a140d3a6 (patch) | |
tree | 7944cf5c1ecfcbee3da0ab8bb068a7dc2b800ca3 /arch/arm64/kvm | |
parent | 0abc1b11a032199bb134fd25cd7ee0cdb26b7b03 (diff) | |
download | linux-d782ac5b2ceebee5d374e13e990655d1a140d3a6.tar.xz |
KVM: arm64: Allow guests with >48-bit IPA size on FEAT_LPA2 systems
With all the page-table infrastructure in place, we can finally increase
the maximum permisable IPA size to 52-bits on 4KB and 16KB page systems
that have FEAT_LPA2.
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20231127111737.1897081-11-ryan.roberts@arm.com
Diffstat (limited to 'arch/arm64/kvm')
-rw-r--r-- | arch/arm64/kvm/reset.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c index 5bb4de162cab..68d1d05672bd 100644 --- a/arch/arm64/kvm/reset.c +++ b/arch/arm64/kvm/reset.c @@ -280,12 +280,11 @@ int __init kvm_set_ipa_limit(void) parange = cpuid_feature_extract_unsigned_field(mmfr0, ID_AA64MMFR0_EL1_PARANGE_SHIFT); /* - * IPA size beyond 48 bits could not be supported - * on either 4K or 16K page size. Hence let's cap - * it to 48 bits, in case it's reported as larger - * on the system. + * IPA size beyond 48 bits for 4K and 16K page size is only supported + * when LPA2 is available. So if we have LPA2, enable it, else cap to 48 + * bits, in case it's reported as larger on the system. */ - if (PAGE_SIZE != SZ_64K) + if (!kvm_lpa2_is_enabled() && PAGE_SIZE != SZ_64K) parange = min(parange, (unsigned int)ID_AA64MMFR0_EL1_PARANGE_48); /* |