public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Wei-Lin Chang <weilin.chang@arm.com>
Cc: Sebastian Ene <sebastianene@google.com>,
	linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
	linux-kernel@vger.kernel.org, Oliver Upton <oupton@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>
Subject: Re: [PATCH RESEND 2/2] KVM: arm64: nv: Expose shadow page tables in debugfs
Date: Sat, 14 Mar 2026 09:39:17 +0000	[thread overview]
Message-ID: <87ldfuda2i.wl-maz@kernel.org> (raw)
In-Reply-To: <3virc5zxa7aow3qfuyyjwvzlmnjk4wlsfmmg7lixhder7rhd6q@qtlumbj33fks>

On Fri, 13 Mar 2026 22:28:38 +0000,
Wei-Lin Chang <weilin.chang@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.

  reply	other threads:[~2026-03-14  9:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-08 23:18 [PATCH RESEND 0/2] KVM: arm64: nv: Expose shadow page tables in debugfs Wei-Lin Chang
2026-03-08 23:18 ` [PATCH RESEND 1/2] KVM: arm64: ptdump: Make KVM ptdump code s2 mmu aware Wei-Lin Chang
2026-03-08 23:18 ` [PATCH RESEND 2/2] KVM: arm64: nv: Expose shadow page tables in debugfs Wei-Lin Chang
2026-03-10 15:26   ` Joey Gouly
2026-03-10 16:17     ` Wei-Lin Chang
2026-03-10 16:50       ` Marc Zyngier
2026-03-10 17:41         ` Wei-Lin Chang
2026-03-11 15:41   ` Sebastian Ene
2026-03-13 22:28     ` Wei-Lin Chang
2026-03-14  9:39       ` Marc Zyngier [this message]
2026-03-16 10:52         ` Wei-Lin Chang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ldfuda2i.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oupton@kernel.org \
    --cc=sebastianene@google.com \
    --cc=suzuki.poulose@arm.com \
    --cc=weilin.chang@arm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox