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 C69FA42D774 for ; Fri, 17 Jul 2026 14:53:54 +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=1784300040; cv=none; b=ZPN/zsFI2pwJjZTic+v3F5OXUs2wSVslTcHY+E7GpjzZ406v2B7uV3twzNiermB1BXuUvWFmp4O5g65IkgJhoLwweeMW142u0D/LMt13DQFGEfmSJuxTp62CfsTDOl+dwptycv25w2JbVfYTa3U+GW4SvY+jtSHI4ec6NIP4sJY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784300040; c=relaxed/simple; bh=qTIGBAvwUBChoTdhlPh11VJC2qGmsG4BEe0a7On0/Fw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CPq6uCVTrZ3+OfIQqsq1MX+g6lrwwl+ONS1aW71XUcjAqQMSFmOn4tNs2Eho+Kfi0ecAh4z3TKBjxNhQiRMxnHlnePsy8ikDxaC1San7yEZmyCjvQksy8eGzdxWlnv3loTWFfIOYcaGHSh5W4uX1FifpywtwAUv70xq05UyvQZc= 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=WpMqs1EF; 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="WpMqs1EF" Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66HEBmDG2164833; Fri, 17 Jul 2026 14:53:30 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=RoD28vbB7VQ2CpVZ/w+ac AmXh860NLyZOZNU2jktAbw=; b=WpMqs1EFF7k6tknE1CUdt3iZHyMSpiQx6aw/N ePMbJ1lXdSpmMjwXxy8e+q6YKtGK+qBeaYcQZOS0a+CG39AewfUMv8VotnxARipa Nhl70Vwgqggnz3R29899rou+TEpfKNc56/bMcbvEgIGY1DeiA78O8ClSpj4VsOJd fPc7LhY767cn4O+Wp5vhoig5brnpgqTxd01kBbBtJiol+90MEjL05vGMHI17QXZe IQJ+LykmRFAumnmbRkveW7TvNoN+ynYQR4qBlbTwyouMGiC3PqvGrLU2bxNbyc8Q 6qM+lM5ndCtl8pLtqBysIDuz5UvrLGQDsAjRqiPfry4S7zJRg== 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 4fbf2ap08x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Jul 2026 14:53:29 +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 66HEngdA030832; Fri, 17 Jul 2026 14:53:28 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4fc2cgsxd0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Jul 2026 14:53:28 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 66HErPHG30212564 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Jul 2026 14:53:25 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1339620043; Fri, 17 Jul 2026 14:53:25 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BBB3C20040; Fri, 17 Jul 2026 14:53:22 +0000 (GMT) Received: from linux.ibm.com (unknown [9.124.217.166]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTPS; Fri, 17 Jul 2026 14:53:22 +0000 (GMT) Date: Fri, 17 Jul 2026 20:22:34 +0530 From: Mahesh J Salgaonkar To: Nikhil Kumar Singh Cc: linuxppc-dev@lists.ozlabs.org, mkchauras@gmail.com, 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 v2] 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> <20260706082708.43918-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: <20260706082708.43918-1-nikhilks@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-Spam-Info: AW1haW4tMjYwN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oint-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-17_04,2026-07-17_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 bulkscore=0 impostorscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 spamscore=0 suspectscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607170150 On 2026-07-06 13:57:08 Mon, 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 | 20 ++++++++++++-------- > 1 file changed, 12 insertions(+), 8 deletions(-) > > diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S > index 63432a33ec49..a54f6f979173 100644 > --- a/arch/powerpc/kernel/head_64.S > +++ b/arch/powerpc/kernel/head_64.S > @@ -713,14 +713,18 @@ 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 may skip */ > + /* dcbst/icbi for lines in between and */ > + /* leave stale instructions in icache. */ > + /* 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. */ 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.