KVM: arm64: Unify handling THP backed host memory
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Thu, 7 May 2020 12:35:46 +0000 (20:35 +0800)
committerMarc Zyngier <maz@kernel.org>
Sat, 16 May 2020 14:05:02 +0000 (15:05 +0100)
commit0529c9021252a58b6d3808da86986a614b900b1b
tree04995559765da1a9c84113ea5d2b657d68ef6413
parent9f2836146b11cdf98d5c8f8f71b0fce28fbd83c8
KVM: arm64: Unify handling THP backed host memory

We support mapping host memory backed by PMD transparent hugepages
at stage2 as huge pages. However the checks are now spread across
two different places. Let us unify the handling of the THPs to
keep the code cleaner (and future proof for PUD THP support).
This patch moves transparent_hugepage_adjust() closer to the caller
to avoid a forward declaration for fault_supports_stage2_huge_mappings().

Also, since we already handle the case where the host VA and the guest
PA may not be aligned, the explicit VM_BUG_ON() is not required.

Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200507123546.1875-3-yuzenghui@huawei.com
arch/arm64/kvm/mmu.c