]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
KVM: x86/mmu: Rename slot_handle_leaf to slot_handle_level_4k
authorDavid Matlack <dmatlack@google.com>
Tue, 19 Oct 2021 16:22:23 +0000 (16:22 +0000)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 9 Dec 2021 10:10:49 +0000 (11:10 +0100)
commit1c273492f296b3beee7660ab1aaf2f94cfc8285d
tree03c2c03466a3d009b120f920020d384ddd1f8446
parent2963281b9537a310dca9859ec86964fafbaf0b87
KVM: x86/mmu: Rename slot_handle_leaf to slot_handle_level_4k

BugLink: https://bugs.launchpad.net/bugs/1953731
[ Upstream commit 610265ea3da117db435868bd109f1861534a5634 ]

slot_handle_leaf is a misnomer because it only operates on 4K SPTEs
whereas "leaf" is used to describe any valid terminal SPTE (4K or
large page). Rename slot_handle_leaf to slot_handle_level_4k to
avoid confusion.

Making this change makes it more obvious there is a benign discrepency
between the legacy MMU and the TDP MMU when it comes to dirty logging.
The legacy MMU only iterates through 4K SPTEs when zapping for
collapsing and when clearing D-bits. The TDP MMU, on the other hand,
iterates through SPTEs on all levels.

The TDP MMU behavior of zapping SPTEs at all levels is technically
overkill for its current dirty logging implementation, which always
demotes to 4k SPTES, but both the TDP MMU and legacy MMU zap if and only
if the SPTE can be replaced by a larger page, i.e. will not spuriously
zap 2m (or larger) SPTEs. Opportunistically add comments to explain this
discrepency in the code.

Signed-off-by: David Matlack <dmatlack@google.com>
Message-Id: <20211019162223.3935109-1-dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/x86/kvm/mmu/mmu.c