OSDN Git Service

kvm: arm64: Make stage2 page table layout dynamic
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Wed, 26 Sep 2018 16:32:46 +0000 (17:32 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Mon, 1 Oct 2018 12:50:31 +0000 (13:50 +0100)
commit61fa5a867b6521b4c55865b88bf70c93078d0cf8
treebc5d97168a556b6732288709e279f8ac16d21cfd
parent865b30cdd9b286820aef44393bafc4c0ccee53d0
kvm: arm64: Make stage2 page table layout dynamic

Switch to dynamic stage2 page table layout based on the given
VM. So far we had a common stage2 table layout determined at
compile time. Make decision based on the VM instance depending
on the IPA limit for the VM. Adds helpers to compute the stage2
parameters based on the guest's IPA and uses them to make the decisions.

The IPA limit is still fixed to 40bits and the build time check
to ensure the stage2 doesn't exceed the host kernels page table
levels is retained. Also make sure that we use the pud/pmd level
helpers from the host only when they are not folded.

Cc: Christoffer Dall <cdall@kernel.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm64/include/asm/stage2_pgtable.h