]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Do not try to map PUDs when they are folded into PMD
authorMarc Zyngier <maz@kernel.org>
Wed, 2 Sep 2020 10:18:29 +0000 (11:18 +0100)
committerMarc Zyngier <maz@kernel.org>
Fri, 4 Sep 2020 09:52:49 +0000 (10:52 +0100)
commitd1e407ed98d76c42a85f8997b5e62180915ab402
treeb7a5ffc84ac51399649c443659283543ed381423
parent16a7e52da85ea6b8d76c1037e491574147f35036
KVM: arm64: Do not try to map PUDs when they are folded into PMD

For the obscure cases where PMD and PUD are the same size
(64kB pages with 42bit VA, for example, which results in only
two levels of page tables), we can't map anything as a PUD,
because there is... erm... no PUD to speak of. Everything is
either a PMD or a PTE.

So let's only try and map a PUD when its size is different from
that of a PMD.

Cc: stable@vger.kernel.org
Fixes: 729e4390b338 ("KVM: arm64: Add support for creating PUD hugepages at stage 2")
Reported-by: Gavin Shan <gshan@redhat.com>
Reported-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Tested-by: Gavin Shan <gshan@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Alexandru Elisei <alexandru.elisei@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/mmu.c