From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 12EDF27467E for ; Thu, 11 Dec 2025 11:45:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765453543; cv=none; b=pNNEiiz06oLwxkQcHGfb7msACM0j4jPZxWa6ipGDAztZf+HIh+VePMp4YeiCmF+Dtg3kvpmndwYACo7wQXvo88XgkD5xUnfWfGULslt6nr3edFSwwzmDk1562d7nop4WXDVaDZksppOvePc1ic0iJU6wmsjpLv1b1P2dIa1Roxo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765453543; c=relaxed/simple; bh=rN5yRpqOyACESPEfa4bzc9IaPvmpBvavtX+UHQvMFNg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=CklMdO1RiWlgYiyKQp5XtO475DzzL8JfgdgVeR4u8oxxlN26NnyX5mVt+DexrtNJ+s4LdV5Gr99PX5o9kSYLl7Srt6F219B+RDf/pUGdF48zzCIpZxeo2eRwn6LOybAqlR9qf4aVF7p1+Or5ZoOViWBbOANNcDjz4RWtC/Tx3hU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2FEEAFEC; Thu, 11 Dec 2025 03:45:33 -0800 (PST) Received: from [10.163.80.88] (unknown [10.163.80.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A13493F740; Thu, 11 Dec 2025 03:45:38 -0800 (PST) Message-ID: Date: Thu, 11 Dec 2025 17:15:35 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/4] arm64: ptdump: use seq_puts() in pt_dump_seq_puts() macro To: Josephine Pfeiffer , catalin.marinas@arm.com, will@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20251018170416.3355249-1-hi@josie.lol> Content-Language: en-US From: Anshuman Khandual In-Reply-To: <20251018170416.3355249-1-hi@josie.lol> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 18/10/25 10:34 PM, Josephine Pfeiffer wrote: > The pt_dump_seq_puts() macro incorrectly uses seq_printf() instead of > seq_puts(). This is both a performance issue and conceptually wrong, > as the macro name suggests plain string output (puts) but the > implementation uses formatted output (printf). > > All call sites pass constant strings without format specifiers, so > using seq_printf() adds unnecessary overhead for format string parsing. > > This bug was introduced in commit ae5d1cf358a5 ("arm64: dump: Make the > page table dumping seq_file optional") in 2016, where seq_puts() was > replaced with a new pt_dump_seq_puts() macro that mistakenly used > seq_printf(). > > Fixes: ae5d1cf358a5 ("arm64: dump: Make the page table dumping seq_file optional") > Signed-off-by: Josephine Pfeiffer > --- > arch/arm64/mm/ptdump.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/mm/ptdump.c b/arch/arm64/mm/ptdump.c > index ab9899ca1e5f..a35fcd62bf75 100644 > --- a/arch/arm64/mm/ptdump.c > +++ b/arch/arm64/mm/ptdump.c > @@ -35,7 +35,7 @@ > #define pt_dump_seq_puts(m, fmt) \ > ({ \ > if (m) \ > - seq_printf(m, fmt); \ > + seq_puts(m, fmt); \ > }) > > static const struct ptdump_prot_bits pte_bits[] = { LGTM and also did no see any problem while dumping via the sysfs file /sys/kernel/debug/kernel_page_tables Reviewed-by: Anshuman Khandual