KVM: arm64: Register ptdump with debugfs on guest creation
authorSebastian Ene <sebastianene@google.com>
Mon, 9 Sep 2024 12:47:21 +0000 (12:47 +0000)
committerMarc Zyngier <maz@kernel.org>
Tue, 10 Sep 2024 20:32:51 +0000 (21:32 +0100)
commit7c4f73548ed15476daf1101f66648085eda65067
treebff6a61499f134c4c03039205afb99944af58614
parent79c4c7284f92d5e780c8532c343ca2cacfaf5125
KVM: arm64: Register ptdump with debugfs on guest creation

While arch/*/mem/ptdump handles the kernel pagetable dumping code,
introduce KVM/ptdump to show the guest stage-2 pagetables. The
separation is necessary because most of the definitions from the
stage-2 pagetable reside in the KVM path and we will be invoking
functionality specific to KVM. Introduce the PTDUMP_STAGE2_DEBUGFS config.

When a guest is created, register a new file entry under the guest
debugfs dir which allows userspace to show the contents of the guest
stage-2 pagetables when accessed.

[maz: moved function prototypes from kvm_host.h to kvm_mmu.h]

Signed-off-by: Sebastian Ene <sebastianene@google.com>
Reviewed-by: Vincent Donnefort <vdonnefort@google.com>
Link: https://lore.kernel.org/r/20240909124721.1672199-6-sebastianene@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_mmu.h
arch/arm64/kvm/Kconfig
arch/arm64/kvm/Makefile
arch/arm64/kvm/arm.c
arch/arm64/kvm/ptdump.c [new file with mode: 0644]