summaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/kvm_arm.h
diff options
context:
space:
mode:
authorChristoffer Dall2018-11-02 08:53:22 +0100
committerMarc Zyngier2018-12-19 18:47:52 +0100
commit6794ad5443a2118243e13879f94228524a1a2b92 (patch)
treee9f966b148af35f7c40688b08d35ef0e49178425 /arch/arm64/include/asm/kvm_arm.h
parentarm/arm64: KVM: vgic: Force VM halt when changing the active state of GICv3 P... (diff)
downloadkernel-qcow2-linux-6794ad5443a2118243e13879f94228524a1a2b92.tar.gz
kernel-qcow2-linux-6794ad5443a2118243e13879f94228524a1a2b92.tar.xz
kernel-qcow2-linux-6794ad5443a2118243e13879f94228524a1a2b92.zip
KVM: arm/arm64: Fix unintended stage 2 PMD mappings
There are two things we need to take care of when we create block mappings in the stage 2 page tables: (1) The alignment within a PMD between the host address range and the guest IPA range must be the same, since otherwise we end up mapping pages with the wrong offset. (2) The head and tail of a memory slot may not cover a full block size, and we have to take care to not map those with block descriptors, since we could expose memory to the guest that the host did not intend to expose. So far, we have been taking care of (1), but not (2), and our commentary describing (1) was somewhat confusing. This commit attempts to factor out the checks of both into a common function, and if we don't pass the check, we won't attempt any PMD mappings for neither hugetlbfs nor THP. Note that we used to only check the alignment for THP, not for hugetlbfs, but as far as I can tell the check needs to be applied to both scenarios. Cc: Ralph Palutke <ralph.palutke@fau.de> Cc: Lukas Braun <koomi@moshbit.net> Reported-by: Lukas Braun <koomi@moshbit.net> Signed-off-by: Christoffer Dall <christoffer.dall@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/kvm_arm.h')
0 files changed, 0 insertions, 0 deletions