]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: arm64: Move host page ownership tracking to the hyp vmemmap
authorQuentin Perret <qperret@google.com>
Wed, 18 Dec 2024 19:40:45 +0000 (19:40 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 20 Dec 2024 09:43:59 +0000 (09:43 +0000)
commite94a7dea2972bd9a5ee3ed4312f7198370969407
tree229cf6edb46e662b05511731088fdca1e63b88d5
parentb35875d466ad3cb08866eac067cca0581d4293d7
KVM: arm64: Move host page ownership tracking to the hyp vmemmap

We currently store part of the page-tracking state in PTE software bits
for the host, guests and the hypervisor. This is sub-optimal when e.g.
sharing pages as this forces to break block mappings purely to support
this software tracking. This causes an unnecessarily fragmented stage-2
page-table for the host in particular when it shares pages with Secure,
which can lead to measurable regressions. Moreover, having this state
stored in the page-table forces us to do multiple costly walks on the
page transition path, hence causing overhead.

In order to work around these problems, move the host-side page-tracking
logic from SW bits in its stage-2 PTEs to the hypervisor's vmemmap.

Tested-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Quentin Perret <qperret@google.com>
Link: https://lore.kernel.org/r/20241218194059.3670226-5-qperret@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/hyp/include/nvhe/memory.h
arch/arm64/kvm/hyp/nvhe/mem_protect.c
arch/arm64/kvm/hyp/nvhe/setup.c