From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8534719ADA4; Sat, 14 Mar 2026 09:39:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773481160; cv=none; b=fveqHd05tAERa3w+Xx4UbjAm3HIJdY5iKti3CFkyFNBrBeZKb0Flag9Yt0VQIxTegVrgCNchthCG6v9PmvqeqnbQOf4icheoXprknlQiY7M0up+Lz/LtS5ALsddZY5RCm3V4BF7KD3jucmQeMZbSJ+lxRmGKA1ebggmES30q48Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773481160; c=relaxed/simple; bh=HwkVyx/aHIXnmb+H9DTjTRCjKgpN6+EWshBqsYuDWLI=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=p5OTm6PkKAXMUbU/grXl8bNb+L+Sm+6/Gtzkmlkr3ZUp9t7X/6mXRY+ptkNmCf2qDgoocBJKf7/48U+l6uQoiZdyAyWCLjl6PCEriOrqXXZVFF9/M0zrz8vq73X/rBCR+eylLBdUL7gha/fKqvGZVOZqtIiKINzl1VloEAHe8WU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YzNQYoNB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YzNQYoNB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C511C116C6; Sat, 14 Mar 2026 09:39:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773481160; bh=HwkVyx/aHIXnmb+H9DTjTRCjKgpN6+EWshBqsYuDWLI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YzNQYoNBPzaAsSuR1Axcu2SZy0ExrVcUOUlzwRnYw8E05dLCZGlNM6K+52qKCBMKA ezjcYL2GElQmJksWvi7EWcubk19e6vLV0t7vqAwds+UfupXwW1QmQeQxBE1bfAbXze XHQFuNZzN23VDRKnJB0uIOW8CyZjEyRpT2wJbqkReHsCAkLoQY0VJmIk7AUVe6faDX fuw8xHg1qSA5LD2NiVkQYxCf95E8G2PRAFG4S4KyKBLyB17QlBVh2LP1q6iXqDktcz mJCW6Y/ksqU0utSCroLse9WzuIeKLFiHOiXRFFlsaprjfg31HKvifZaLACVWw6jQHr M/ZCQt++MuyVg== Received: from 91-161-240-24.subs.proxad.net ([91.161.240.24] helo=lobster-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w1LSn-00000001vif-2ktP; Sat, 14 Mar 2026 09:39:17 +0000 Date: Sat, 14 Mar 2026 09:39:17 +0000 Message-ID: <87ldfuda2i.wl-maz@kernel.org> From: Marc Zyngier To: Wei-Lin Chang Cc: Sebastian Ene , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Oliver Upton , Joey Gouly , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon Subject: Re: [PATCH RESEND 2/2] KVM: arm64: nv: Expose shadow page tables in debugfs In-Reply-To: <3virc5zxa7aow3qfuyyjwvzlmnjk4wlsfmmg7lixhder7rhd6q@qtlumbj33fks> References: <20260308231829.864983-1-weilin.chang@arm.com> <20260308231829.864983-3-weilin.chang@arm.com> <3virc5zxa7aow3qfuyyjwvzlmnjk4wlsfmmg7lixhder7rhd6q@qtlumbj33fks> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 91.161.240.24 X-SA-Exim-Rcpt-To: weilin.chang@arm.com, sebastianene@google.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, oupton@kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Fri, 13 Mar 2026 22:28:38 +0000, Wei-Lin Chang 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-0x-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.