Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4760924rdb; Tue, 12 Dec 2023 08:35:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFVZrXgcfvGSV4++ZL9/yYW6rykrj39lVTrfHYQqGGMEkvurJYwb++R4EdLL0ikCmMFJmLV X-Received: by 2002:a17:90a:71c3:b0:286:6cc1:2cac with SMTP id m3-20020a17090a71c300b002866cc12cacmr3531826pjs.54.1702398952523; Tue, 12 Dec 2023 08:35:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702398952; cv=none; d=google.com; s=arc-20160816; b=V7KQJuUnP842MepPjvwdf+wauPq+R06ezLuxlhwQ4A6Njvk/PyqKiygYvsxSw3K6pw kuEJu0dLDW4hutqCeKYgSZbfcHSxrWpbtF9LPD1bdBZD0QgQRBW+9gvzOL5/EwjYA1vq bI+2yh4wjHhe7W1rUpiMvnfAKyUVpVY0rLPscLt2A3AG/X0sY0bduv99+dmTGOWtUrnC aF43Wk1huAPfKw3FMBuhxm1ka8RfOTIMW4q1uIgeKuqmjhTP0CryfgmuQrUonJzKXT0g T8O6hNGPBQcxb0/xVUczuui/E4WGCli305Vkc7lLZvQUv9gYp1teGglMu3zHunYOMSR4 UMTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=F1EYqlVYF1fJ33cC2a0Mertg3uhTJJ/NIkImZDHepJg=; fh=RBP3N/z2dRF20CQ37qwMigTrhQ/jDE9ZZ/B9XmmkgnU=; b=gTlRUBlDkOUSbsKVfbN8b/o/z8sfGQu7sBIvbS6ChSL6COXjZgpV0Gr/tabRq2CrYg KXbLQdoCia80sp2aHEHH/2Mg00zv6yIVvp4iWWa508j5rCry2v/thkxbaNPe0wLWmbZm NWuhoShNnC2VgkAya95kUCXakiFG0d2C05K/J8UwJTU5aHAvZO7yxxFDHIeH3r3BgDy2 79vJnO+qCzMAxJR2wYPopKqhv+sCLt/o12zEPb5tpkaGeejHtdzHHOSB9mQdgVuqugnA HNjGeXvj7RVU7zmxpiLe8+72HWjADBwcXM54RzSaDMrY7ur5y6o5SyzRcyQMg63INvPE a/Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=MJdEjsFp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id lk7-20020a17090b33c700b00286c59061e7si9424246pjb.122.2023.12.12.08.35.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 08:35:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=MJdEjsFp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 1C779801BA53; Tue, 12 Dec 2023 08:35:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233076AbjLLQf1 (ORCPT + 99 others); Tue, 12 Dec 2023 11:35:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232883AbjLLQfW (ORCPT ); Tue, 12 Dec 2023 11:35:22 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F72710B; Tue, 12 Dec 2023 08:35:26 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 1185FFF809; Tue, 12 Dec 2023 16:35:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1702398924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F1EYqlVYF1fJ33cC2a0Mertg3uhTJJ/NIkImZDHepJg=; b=MJdEjsFpVJ8ioDiw5His3fbeOd2bjIxm4S8sl0YNzERg/it60cuiPt/dVohY1zArlA7RPd J/LPXx9OPkZopk+jPGol+vP9nY2NPZEaFcWrjAF64ytr48w3FwE8H2Tzo7TeFiyHBvI0ML 0gyE6P1LJySEyPz9tEiKyCR/8DY/1ZgtHdpE/i3buNqi1bbeagMTRUNHutjCyfKwGxUgs7 ehc+A4gcnYxxG7Swuz36Zc5coOMuvHIMJrMjOzFkJU73Pcpb6KnZamxbPyxqFM3aO+fQtW EmHU0yGnK9ZMOCnuJ4XWbjp5h1Ies5nloy/gr64dj0CPMpdrAOtuMWjitwmSZg== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?UTF-8?q?Th=C3=A9o=20Lebrun?= , Thomas Petazzoni , Gregory CLEMENT , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Florian Fainelli Subject: [PATCH v5 01/22] MIPS: compressed: Use correct instruction for 64 bit code Date: Tue, 12 Dec 2023 17:34:33 +0100 Message-ID: <20231212163459.1923041-2-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231212163459.1923041-1-gregory.clement@bootlin.com> References: <20231212163459.1923041-1-gregory.clement@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 12 Dec 2023 08:35:48 -0800 (PST) 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