KVM: arm64: Use fallback mapping sizes for contiguous huge page sizes
authorGavin Shan <gshan@redhat.com>
Sun, 25 Oct 2020 23:06:26 +0000 (10:06 +1100)
committerMarc Zyngier <maz@kernel.org>
Thu, 29 Oct 2020 20:39:46 +0000 (20:39 +0000)
commit2f40c46021bbb3ecd5c5f05764ecccbc276bc690
treef3db09cfd7404c2c32351280389f79f100723cc1
parente2fc6a9f686d037cbd9b08b9fb657685b4a722d3
KVM: arm64: Use fallback mapping sizes for contiguous huge page sizes

Although huge pages can be created out of multiple contiguous PMDs
or PTEs, the corresponding sizes are not supported at Stage-2 yet.

Instead of failing the mapping, fall back to the nearer supported
mapping size (CONT_PMD to PMD and CONT_PTE to PTE respectively).

Suggested-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Gavin Shan <gshan@redhat.com>
[maz: rewritten commit message]
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20201025230626.18501-1-gshan@redhat.com
arch/arm64/kvm/mmu.c