[PATCH v2] KVM: arm64: Disable stage-2 ptdump of pKVM

Vincent Donnefort vdonnefort at google.com
Thu Sep 24 03:04:59 PDT 2026


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 <fuad.tabba at linux.dev>
Signed-off-by: Vincent Donnefort <vdonnefort at google.com>
---

Notes:
    v2:
      - Point Fixes tag to fce886a60207 (Fuad)
      - Pick up Reviewed-by from Fuad
    
    v1: https://lore.kernel.org/all/20260917081510.1539013-1-vdonnefort@google.com/

 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,

base-commit: fd73f4a6659897191fa0d40695fe370925dd3780
-- 
2.56.0.rc1.310.g51773c2048-goog




More information about the linux-arm-kernel mailing list