diff options
author | Christoffer Dall <christoffer.dall@arm.com> | 2018-11-02 08:53:22 +0100 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2018-12-19 17:47:52 +0000 |
commit | 6794ad5443a2118243e13879f94228524a1a2b92 (patch) | |
tree | e9f966b148af35f7c40688b08d35ef0e49178425 /net | |
parent | 107352a24900fb458152b92a4e72fbdc83fd5510 (diff) | |
download | linux-6794ad5443a2118243e13879f94228524a1a2b92.tar.bz2 |
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 'net')
0 files changed, 0 insertions, 0 deletions