From 0dea17ffe6757a6249d143e607e786144aceee9c Mon Sep 17 00:00:00 2001 From: Vincent Donnefort Date: Thu, 24 Sep 2026 11:04:59 +0100 Subject: [PATCH] KVM: arm64: Disable stage-2 ptdump of pKVM With pKVM enabled, guest stage-2 page tables are owned and managed by the hypervisor. The host's pgt is uninitialised. Skip registering stage-2 ptdump debugfs files when protected KVM is enabled. Fixes: fce886a60207 ("KVM: arm64: Plumb the pKVM MMU in KVM") Reviewed-by: Fuad Tabba Signed-off-by: Vincent Donnefort Tested-by: Fuad Tabba Link: https://patch.msgid.link/20260924100459.831013-1-vdonnefort@google.com Signed-off-by: Marc Zyngier --- arch/arm64/kvm/ptdump.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/kvm/ptdump.c b/arch/arm64/kvm/ptdump.c index 69899797dbad..87e5e7a4e612 100644 --- a/arch/arm64/kvm/ptdump.c +++ b/arch/arm64/kvm/ptdump.c @@ -300,6 +300,10 @@ void kvm_nested_s2_ptdump_remove_debugfs(struct kvm_s2_mmu *mmu) void kvm_s2_ptdump_create_debugfs(struct kvm *kvm) { + /* pKVM handles the page-tables in the hypervisor */ + if (is_protected_kvm_enabled()) + return; + debugfs_create_file("stage2_page_tables", 0400, kvm->debugfs_dentry, &kvm->arch.mmu, &kvm_ptdump_guest_fops); debugfs_create_file("ipa_range", 0400, kvm->debugfs_dentry,