From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EFD17360B4; Thu, 21 Dec 2023 14:55:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alpha.franken.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alpha.franken.de Received: from uucp by elvis.franken.de with local-rmail (Exim 3.36 #1) id 1rGKSr-0002PV-00; Thu, 21 Dec 2023 15:55:57 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id AD3D4C0A2B; Thu, 21 Dec 2023 15:38:20 +0100 (CET) Date: Thu, 21 Dec 2023 15:38:20 +0100 From: Thomas Bogendoerfer To: Gregory CLEMENT Cc: Paul Burton , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?iso-8859-1?Q?Th=E9o?= Lebrun , Thomas Petazzoni , Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= , Florian Fainelli Subject: Re: [PATCH v5 01/22] MIPS: compressed: Use correct instruction for 64 bit code Message-ID: References: <20231212163459.1923041-1-gregory.clement@bootlin.com> <20231212163459.1923041-2-gregory.clement@bootlin.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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231212163459.1923041-2-gregory.clement@bootlin.com> On Tue, Dec 12, 2023 at 05:34:33PM +0100, Gregory CLEMENT wrote: > The code clearing BSS already use macro or use correct instruction > depending if the CPU is 32 bits or 64 bits. However, a few > instructions remained 32 bits only. > > By using the accurate MACRO, it is now possible to deal with memory > address beyond 32 bits. As a side effect, when using 64bits processor, > it also divides the loop number needed to clear the BSS by 2. > > Reviewed-by: Philippe Mathieu-Daudé > Reviewed-by: Florian Fainelli > Signed-off-by: Gregory CLEMENT > --- > arch/mips/boot/compressed/head.S | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/mips/boot/compressed/head.S b/arch/mips/boot/compressed/head.S > index 5795d0af1e1b2..d237a834b85ee 100644 > --- a/arch/mips/boot/compressed/head.S > +++ b/arch/mips/boot/compressed/head.S > @@ -25,8 +25,8 @@ > /* Clear BSS */ > PTR_LA a0, _edata > PTR_LA a2, _end > -1: sw zero, 0(a0) > - addiu a0, a0, 4 > +1: PTR_S zero, 0(a0) > + PTR_ADDIU a0, a0, PTRSIZE > bne a2, a0, 1b > > PTR_LA a0, (.heap) /* heap address */ > -- > 2.42.0 applied to mips-next. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]