[PATCH RESEND 2/2] KVM: arm64: nv: Expose shadow page tables in debugfs
Marc Zyngier
maz at kernel.org
Sat Mar 14 02:39:17 PDT 2026
On Fri, 13 Mar 2026 22:28:38 +0000,
Wei-Lin Chang <weilin.chang at arm.com> wrote:
>
> On Wed, Mar 11, 2026 at 03:41:32PM +0000, Sebastian Ene wrote:
> > On Sun, Mar 08, 2026 at 11:18:29PM +0000, Wei-Lin Chang wrote:
[...]
> > > +void kvm_nested_s2_ptdump_create_debugfs(struct kvm_s2_mmu *mmu)
> > > +{
> > > + struct dentry *dent;
> > > + /* format: 0x<vttbr>-0x<vtcr>-s2-{en, dis}abled\0 */
> > > + char file_name[2 + 16 + 1 + 2 + 16 + 4 + 3 + 6];
> >
> > Can you hide the size of this definition behind a macro ?
>
> Sure, no problem.
I don't think a macro helps that much on its own. I'd rather this is
made a bit more foolproof by directly expressing the actual string
this results into, and use that for the size:
#define S2FNAMESZ sizeof("0x0123456789abcdef-0x0123456789abcdef-s2-disabled")
char file_name[S2FNAME];
which is less ambiguous. The compiler will happily optimise this to a
nice constant that also accounts for the final '\0'.
Thanks,
M.
--
Jazz isn't dead. It just smells funny.
More information about the linux-arm-kernel
mailing list