From nobody Mon Feb 9 08:33:44 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1638307136407110.70940055829772; Tue, 30 Nov 2021 13:18:56 -0800 (PST) Received: from localhost ([::1]:40894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1msAWd-0005W8-Cv for importer@patchew.org; Tue, 30 Nov 2021 16:18:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1msAVN-0003q2-DQ for qemu-devel@nongnu.org; Tue, 30 Nov 2021 16:17:37 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:41101) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1msAVL-0003lC-FX for qemu-devel@nongnu.org; Tue, 30 Nov 2021 16:17:37 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B2DF55C00F4; Tue, 30 Nov 2021 16:17:33 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 30 Nov 2021 16:17:33 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 30 Nov 2021 16:17:32 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= from:to:cc:subject:date:message-id:in-reply-to:references; s= fm3; bh=fmtfmTe7flwZ7Dsu10dFozw3xNvOHB49G1+Edt1rdm8=; b=jK9QzWzI Nx6iuCSQfrhYq60P0PF9BOco9mDFqK4AIc23YIjocRTsqehLDKHph/fwAhUXUXB/ A7S7wp/6amY7Xg19HXxjWIAxA8//ZsLRXX7pEQJ6gtebviamEIzVNOkR6CzK4V3q 6q2CJpIXy4L+BwtA8LjJGn+FvI5HlZVzUUejAYAosABxFQ8IKQmVzveyyfBXlX/O lP+3xKFhxDYZjuAB4YJU2M59EUfLqf4ih74cxC3EDJDpUBOs0MtOXmgcJ6EHSr07 Qoijhr9wuxJDVqUqMYBvWiFOyLCAKXtXrKekWGYBnGdPoo9ENMddR6WMVQbCWmLM 3vZSoTvCv4AGDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=fmtfmTe7flwZ7Dsu10dFozw3xNvOH B49G1+Edt1rdm8=; b=Jwkh0f9wdWqcgaXsqKaXXik8okXnVFsz6amYdeqjhXykj oB6MFx7O33uyZvrmJm1yf7wfTFvKvgBBBy3WSO4io+5KDaq1APda3pynXRlFZ+p2 GY4BlapOmhYYYnCe45cWaISzXS1uX9yYGUwUyBttGxPUVvIUSayY+WGAoCFMCBxa pfhICg4vtLVtSHcOuprsbCw76dYsT0uEUUzb9kPyh535rYrlqKk1lAcRPzMOAmwh NOnqMFqgBWmvK8oqGFQFApMpK0xI8QStFtldouQu4D0b+07TTZ23HYN0GdosO/eB YwaO62A7dh+ouAVhWZire9C6o9oHIvdmGf1yYGzXQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddriedugddugeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhestddtredtre dttdenucfhrhhomheplfhirgiguhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehf lhihghhorghtrdgtohhmqeenucggtffrrghtthgvrhhnpeefvdehkeeugeffhfejteduhf duudeltdegtdfgheekudelhedtudfhudfgleevveenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehflhihghhorg htrdgtohhm X-ME-Proxy: From: Jiaxun Yang To: qemu-devel@nongnu.org Subject: [PATCH 1/2] hw/mips: bootloader: Fix write_ulong Date: Tue, 30 Nov 2021 21:17:28 +0000 Message-Id: <20211130211729.7116-2-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20211130211729.7116-1-jiaxun.yang@flygoat.com> References: <20211130211729.7116-1-jiaxun.yang@flygoat.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=66.111.4.27; envelope-from=jiaxun.yang@flygoat.com; helo=out3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: f4bug@amsat.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1638307138201100003 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" bl_gen_write_ulong uses sd for both 32 and 64 bit CPU, while sd is illegal on 32 bit CPUs. Replace sd with sw on 32bit CPUs. Fixes: 3ebbf86 ("hw/mips: Add a bootloader helper") Signed-off-by: Jiaxun Yang Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- Should be backported to 6.0 onwards. --- hw/mips/bootloader.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/mips/bootloader.c b/hw/mips/bootloader.c index 6ec8314490..99991f8b2b 100644 --- a/hw/mips/bootloader.c +++ b/hw/mips/bootloader.c @@ -182,7 +182,11 @@ void bl_gen_write_ulong(uint32_t **p, target_ulong add= r, target_ulong val) { bl_gen_load_ulong(p, BL_REG_K0, val); bl_gen_load_ulong(p, BL_REG_K1, addr); - bl_gen_sd(p, BL_REG_K0, BL_REG_K1, 0x0); + if (bootcpu_supports_isa(ISA_MIPS3)) { + bl_gen_sd(p, BL_REG_K0, BL_REG_K1, 0x0); + } else { + bl_gen_sw(p, BL_REG_K0, BL_REG_K1, 0x0); + } } =20 void bl_gen_write_u32(uint32_t **p, target_ulong addr, uint32_t val) --=20 2.11.0