]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 9 Nov 2020 13:46:50 +0000 (14:46 +0100)
commitbc7c1ee641f18a67bed2007797d172685a8348a6
treeef58243016f621eefc5df9d5f5980f717b074431
parentb845cb8f169f2c79f3dab00db7504f705870ff3d
KVM: arm64: Do not try to map PUDs when they are folded into PMD

BugLink: https://bugs.launchpad.net/bugs/1896824
commit 3fb884ffe921c99483a84b0175f3c03f048e9069 upstream.

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: b8e0ba7c8bea ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
virt/kvm/arm/mmu.c