From patchwork Thu Jul 8 13:35:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1502262 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=aAIrxg8D; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=k6nZs24S; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GLHNg4PFDz9sRf for ; Thu, 8 Jul 2021 23:35:31 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=R1at8utsQ9y54wjXzo1f8ijdlKQqM65GOde4dlaRFRI=; b=aAIrxg8DkVpCWs BF8I/aRjzYq6c/CyTH9LHFF1KoRaluDC6R2ECnxH9wZvanWNqK4loXEf1Jo/HRMIzlRhi/yJ2PPdA Spnp6LJJwndOavhlYm12mb3SECxeg8NcZ47s8Glp4Mfnbm8D23g84Pnu7Zmiwgo0vpMWqpARhPrzE kYy4E+Bq3V+tFJ9miGV8pgcCQJIqWRLN+/ISBb/gJYJTRJBzVGAKeKDQ5AHxBIvUZ7q7Ot5nlkzdg UFyjKn/cjUaXr3zD3ocnpzFwUjq09D4XPJLyd+qgr29gS9rFDHFaZm9QGLz0gAatWcpyJ4ZfT4IDT +i00cdOy8OPmK9WJ0rIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m1UBY-00H6Ku-Ky; Thu, 08 Jul 2021 13:35:24 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m1UBV-00H6KW-KE for opensbi@lists.infradead.org; Thu, 08 Jul 2021 13:35:22 +0000 Received: by mail-pf1-x42b.google.com with SMTP id a127so5447520pfa.10 for ; Thu, 08 Jul 2021 06:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=isckgzdDZGXFutyTzRLXo7EEYQOZoWkAp0UUOedFfV8=; b=k6nZs24Sma2REEG+DnveE8YNn1ucpcT831gK23ztkr1JL26f50ljd/QL1SP5roOF0P M8fFYbx/SFAq8I+C/ys6xFIySyekwzvkKXJ/xLYJOigOnV9f+E+wOGTBLg0Y0RdPCUQP 8LB6wnm9ShqHCeoVTarftBwRnwA318UoqLjzztSh8kZRfsUnnA4yiphR+NVJbYnHNooI nlsk3T4rmnrhisG8eMLcq4yXdT/Iy0k6wGlvzGpCUKz+TctTSS8NHn6jylXBA2o/Z6Up ZBuNArqr1booFLYhotRgWMzLQ6dcO1k3Jq1wJ93U5PjCVF7xX5YED0x61Iwb3ajvker1 PxbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=isckgzdDZGXFutyTzRLXo7EEYQOZoWkAp0UUOedFfV8=; b=LIqIrZlsoy+JtAe+ZpISKx0AGSq5GbY8S/6xVEjQEwG5a6wnmfXi635B6bF4Y0TrOO Sck5k9EEv8bOC2tLm0njeOmFI2eq+AlTb0JW0PSRoEWRUxtdnzPqO4cTc54Ccj9NX1NW ayEeQ9MfEMgLV4bU3xoomaVdaqIGf2/EzEpizQ3EKATKsNs2+NkHkcLl3Ji1/zgoFB37 7Xi2sxUrtpoiB2bzkqOLPqWm2s4M9UWgYEEQ6qmnBvtUEfF822okUixhkM3sDDKsl/dZ wWvOjOT2mhAatJP28257ZyB6iZbf+aNS5iiTXd4Og3KcEzHth4hTWjgY8+O21QWWMXGX atRg== X-Gm-Message-State: AOAM530cshog1Hp7ZNkOE0giJQ37EpamU+in3HY9k2QgYQuVkBKUGi/4 2runxunvE/OJAfeTG6fp0Q4= X-Google-Smtp-Source: ABdhPJz3NqAt35y78ElU8Ho9sLUa43wwvNFRAXmXi73UQJP8Cut47BvGz8papWeTXtTYWZrwNXU55A== X-Received: by 2002:aa7:8148:0:b029:31b:10b4:f391 with SMTP id d8-20020aa781480000b029031b10b4f391mr26884815pfn.69.1625751320564; Thu, 08 Jul 2021 06:35:20 -0700 (PDT) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id y7sm3099787pfy.153.2021.07.08.06.35.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 06:35:20 -0700 (PDT) From: Bin Meng To: Anup Patel , opensbi@lists.infradead.org Cc: Bin Meng Subject: [PATCH] firmware: Minor optimization in _scratch_init() Date: Thu, 8 Jul 2021 21:35:11 +0800 Message-Id: <20210708133511.9198-1-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210708_063521_724653_03060FAC X-CRM114-Status: UNSURE ( 8.19 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Before entering _scratch_init(), register t3 already holds a copy of the firmware end address, hence there is no need to calculate it again. This reduces 3 instructions in each _scratch_init() loop. Signed-off-by: Bin Meng --- Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:42b listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [bmeng.cn[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Before entering _scratch_init(), register t3 already holds a copy of the firmware end address, hence there is no need to calculate it again. This reduces 3 instructions in each _scratch_init() loop. Signed-off-by: Bin Meng Reviewed-by: Xiang W Reviewed-by: Atish Patra --- firmware/fw_base.S | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/firmware/fw_base.S b/firmware/fw_base.S index a5ce946..e35f18e 100644 --- a/firmware/fw_base.S +++ b/firmware/fw_base.S @@ -287,10 +287,7 @@ _scratch_init: /* Initialize scratch space */ /* Store fw_start and fw_size in scratch space */ lla a4, _fw_start - lla a5, _fw_end - mul t0, s7, s8 - add a5, a5, t0 - sub a5, a5, a4 + sub a5, t3, a4 REG_S a4, SBI_SCRATCH_FW_START_OFFSET(tp) REG_S a5, SBI_SCRATCH_FW_SIZE_OFFSET(tp) /* Store next arg1 in scratch space */