[PATCH RESEND 2/2] KVM: arm64: nv: Expose shadow page tables in debugfs

Marc Zyngier maz at kernel.org
Tue Mar 10 09:50:22 PDT 2026


On Tue, 10 Mar 2026 16:17:07 +0000,
Wei-Lin Chang <weilin.chang at arm.com> wrote:
> 
> On Tue, Mar 10, 2026 at 03:26:04PM +0000, Joey Gouly wrote:

> > > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> > > index 5d5a3bbdb95e..f88f6c4d646e 100644
> > > --- a/arch/arm64/include/asm/kvm_host.h
> > > +++ b/arch/arm64/include/asm/kvm_host.h
> > > @@ -217,6 +217,10 @@ struct kvm_s2_mmu {
> > >  	 */
> > >  	bool	nested_stage2_enabled;
> > >  
> > > +#ifdef CONFIG_PTDUMP_STAGE2_DEBUGFS
> > > +	struct dentry *shadow_pt_debugfs_dentry;
> > > +#endif
> > > +
> > >  	/*
> > >  	 * true when this MMU needs to be unmapped before being used for a new
> > >  	 * purpose.
> > > @@ -405,6 +409,9 @@ struct kvm_arch {
> > >  	 * the associated pKVM instance in the hypervisor.
> > >  	 */
> > >  	struct kvm_protected_vm pkvm;
> > > +
> > > +	/* Nested virtualization info */
> > > +	struct dentry *debugfs_nv_dentry;
> > 
> > Seems like this could be guarded with CONFIG_PTDUMP_STAGE2_DEBUGFS too, or is
> > there a reason you didn't?
> 
> Right, I was thinking this "nested" directory can also hold other NV
> related information in the future, that's why I didn't keep it behind
> the option.

We can cross that bridge when we get there. In the meantime, I'd side
with Joey and would rather not have a dangling pointer.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.



More information about the linux-arm-kernel mailing list