From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 B863234E75A for ; Tue, 14 Jul 2026 10:31:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784025069; cv=none; b=WPFCr4mWXYzuHzsKMDIS2ELzo3FNVUh+K+U+oVtYguW8hVkpLO7zoMXiPrHl7fNAzIoaUKerKFypf+Rrv5XLiz0yroMlJexFBNihGZxzM0BxtTiF6OpP93rGQ1ne3aJVj8MH2uBLm4OM4ODhksjNmPF+IMRQc1/uA05atDXpmC4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784025069; c=relaxed/simple; bh=5BX6Vd6rfp+AUoiO7b4OvXkcjYuLMslSp/o1TDfOCVQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RzXlDLO0M8NO6oxxqv5ZX++x6McpDLNsogNBvQQL2BaZ6oZ9NpF2EaIqNH98jHbFXlfe89wnCz15oaSNzGoZrdKs9V3rCW0z57tkZ3O17yLsDQ5acqAo/zi5AoUMFhR8t0A49DIvmOvx3RlQVAQJIFNf/leUerBkurruBpMq3p4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=bLIPRjQv; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="bLIPRjQv" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66E6fshM547279; Tue, 14 Jul 2026 10:30:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:reply-to:subject:to; s=pp1; bh=gy1aB4pTvay9Q185FG7c2 Tinmh3y05RKR0UNFFzQZAI=; b=bLIPRjQviX/sFrTb2p9rdV2txHQBGRLLc/rJS zdGdbD2rfz3mH982C+ysBHgiZffC5vKICZ8O6+fXJD/U//bcV+3y57km26QBOLqH xRywwgEP4qrM6d0AnieEpOWEtndb00ofU4g8Pc8kEQ/drYop6PzavBcQ+fWONG46 W4+VOIJKDmowmm8/VkxtbCigzkzN0YHuW/VtGDXXK9oBlUToetCAPz+KduG320Dv mDwxwkQE4JRmEnQmXwrmqq1QmtcttT+6J1o1MNPiLSoG13BoXpRPrHZsYOChy8ru BSPShht0SAHaU0xg/h/gZCZBZIa1avj6na3x3PZoGAnshmZ5A== Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fbegbn6q7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Jul 2026 10:30:53 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 66EAJeiE013361; Tue, 14 Jul 2026 10:30:52 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4fc2cga3wh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Jul 2026 10:30:52 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 66EAUm0F36372778 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Jul 2026 10:30:48 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5DF1520043; Tue, 14 Jul 2026 10:30:48 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 528FA20040; Tue, 14 Jul 2026 10:30:46 +0000 (GMT) Received: from linux.ibm.com (unknown [9.39.31.36]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTPS; Tue, 14 Jul 2026 10:30:46 +0000 (GMT) Date: Tue, 14 Jul 2026 16:00:43 +0530 From: Mahesh J Salgaonkar To: Nikhil Kumar Singh Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org, adityag@linux.ibm.com Subject: Re: [PATCH] powerpc/64s: Clarify copy_and_flush() cache sync loop comment Message-ID: Reply-To: mahesh@linux.ibm.com References: <20260701182756.273019-1-nikhilks@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260701182756.273019-1-nikhilks@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=fOcJG5ae c=1 sm=1 tr=0 ts=6a560fdd cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=kj9zAlcOel0A:10 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=RzCfie-kr_QcCd8fBx8p:22 a=VnNF1IyMAAAA:8 a=k39Bn-rZO4FkpeY6yEkA:9 a=CjuIK1q_8ugA:10 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE0MDEwNiBTYWx0ZWRfX5OB/axAlwJf3 3BOgQL7JEDgvctd5pigwWRDJGb2MJLSEK+/6oNvK9MdW545IlPBzHg71hOWlABhemsTQKD37Crr IeZd4577kKnhjoj66pzVkZOx0jkFQeg1hCuiTKLRnY+B7L2jRwDT/3Dn0wNf43kSTEwYyrK2cB/ rKykMGieE7BkhLzMbfzZP7r+hqcVnJ4mi58TjqR5HWhuaEnncwV6VFCWM7ZCIXeO3D1mJdKtzTP RypD5nP6OLuHWpOLWy5tdvb87CmaL1CZYgCUsnTsXFlT7L4K66F2ozEdpsPuNkKckSuaQF6lxn2 fnnG//+MXE64P+vxFDNU4YKgR25D+QcvRA5rQo/Sx3dYXBLTC+UnUG5dbhRYT8jwRaWFyUky/X5 jZDRsQy4J8S6WqoSegQG5trCz1CPLBmyfoGhmwZOBlyGnHJHuBWApitt37q7ePTE+5BjSrgBGsV 8wk0ANOeTSJdQWw/KkA== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE0MDEwNiBTYWx0ZWRfX093ah9Aw3b7e d70gx1es6atUDGVjBH0KiR8+7ecQmwXMOcGWPBGRmM60EltVt1LngYb2Bf3iyNZNAAR8W012A2e gWA03NAnGEJ+oO4fUCPcJeX3wzO6UmI= X-Proofpoint-GUID: if6q_xhqXc59JZ9jnbDfbe38AgJ2l5Z7 X-Proofpoint-ORIG-GUID: _0qBIYgcTkHkQPWMiZb_zJclb4l1-3Zk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-14_02,2026-07-10_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 impostorscore=0 suspectscore=0 adultscore=0 priorityscore=1501 malwarescore=0 clxscore=1011 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607140106 On 2026-07-01 23:57:56 Wed, Nikhil Kumar Singh wrote: > The value loaded into r0 in copy_and_flush() represents the number of > 8-byte words processed between cache synchronization operations. > > The existing comment refers to cache line size, which can make it appear > that the value is a cache line size in bytes rather than a loop count. > Clarify the comment to explain that the loop processes 8 words (64 bytes) > per cache synchronization iteration, and that increasing the value would > skip cache maintenance for intermediate cache lines. > > This is a comment-only change with no functional impact. > > Signed-off-by: Nikhil Kumar Singh > --- > arch/powerpc/kernel/head_64.S | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S > index 63432a33ec49..e21c2bce8f7e 100644 > --- a/arch/powerpc/kernel/head_64.S > +++ b/arch/powerpc/kernel/head_64.S > @@ -713,14 +713,14 @@ p_end: .8byte _end - copy_to_here > _GLOBAL(copy_and_flush) > addi r5,r5,-8 > addi r6,r6,-8 > -4: li r0,8 /* Use the smallest common */ > - /* denominator cache line */ > - /* size. This results in */ > - /* extra cache line flushes */ > - /* but operation is correct. */ > - /* Can't get cache line size */ > - /* from NACA as it is being */ > - /* moved too. */ > +4: li r0,8 /* r0 is the number of 8-byte words */ > + /* to copy per cache sync iteration. */ > + /* 8 words * 8 bytes = 64 bytes. 64B is */ > + /* the current default cache line size. */ > + /* This is a loop count, not a byte */ > + /* count. Increasing it will skip */ > + /* dcbst/icbi for lines in between and */ > + /* leave stale instructions in icache. */ Looks good to me. The previous comment was misleading which makes one to think r0 as cache line size which is not the case. Reviewed-by: Mahesh Salgaonkar Thanks, -Mahesh.