Skip to content

Commit d782ac5

Browse files
ryanhrobMarc Zyngier
authored andcommitted
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
1 parent 0abc1b1 commit d782ac5

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

arch/arm64/kvm/reset.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,11 @@ int __init kvm_set_ipa_limit(void)
280280
parange = cpuid_feature_extract_unsigned_field(mmfr0,
281281
ID_AA64MMFR0_EL1_PARANGE_SHIFT);
282282
/*
283-
* IPA size beyond 48 bits could not be supported
284-
* on either 4K or 16K page size. Hence let's cap
285-
* it to 48 bits, in case it's reported as larger
286-
* on the system.
283+
* IPA size beyond 48 bits for 4K and 16K page size is only supported
284+
* when LPA2 is available. So if we have LPA2, enable it, else cap to 48
285+
* bits, in case it's reported as larger on the system.
287286
*/
288-
if (PAGE_SIZE != SZ_64K)
287+
if (!kvm_lpa2_is_enabled() && PAGE_SIZE != SZ_64K)
289288
parange = min(parange, (unsigned int)ID_AA64MMFR0_EL1_PARANGE_48);
290289

291290
/*

0 commit comments

Comments
 (0)