Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp839593rwe; Wed, 31 Aug 2022 12:00:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR4KtGTYPc//fj0SINHLwAKMZbTPPOEXtudHZIsWoHLNb/suFEFQcblurEda9dxagaXFfi8O X-Received: by 2002:a63:8243:0:b0:42b:1d94:3c66 with SMTP id w64-20020a638243000000b0042b1d943c66mr23438963pgd.278.1661972408797; Wed, 31 Aug 2022 12:00:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661972408; cv=none; d=google.com; s=arc-20160816; b=uoB+9RJ8jpHiYI9KRvILTPc7ipgKujxUa0hpiIFffAOGvQAtJXXTKUJx+iyfJJkW/k pRxJ+Tx9K3v+VuVN5uYm2eSwgDaj9uMjVGPogmiSJqSzedwOJkWaiijkZ5CwoUwmlTLT osZKA4bjYP4fU1p6chqv3M4FVac9aoZQHTuCoMOgwqrZ5qPplcLbTydqRnfqTYh5ms6M emqMVQvTlokMeXBrc0SqZPLp9RR8Uo3XEybc6hoYUFv4XGADBFdKEcVFpnmEYguL86dR fxNhs6mFAwkKSZPa6D9HSKDDFgPnU6h8cvwncZio2M2mtDhY+gKbbuGK43N3nANOQgnZ /JyA== 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=7iHoFsSv3aHYztd2WA+ZzfQm0+Iq33zKPcAl1JSfygs=; b=eZ0ads4sPbqQst0ApL9tN3YxjuQKQHmCSgZBUMfjKV+DPyWcftXRw4KpWAYt6jwvur tawSFPDF0KMMhqaN/W5eKu5N8Mr9SBjz94WNQERQFyIDupqwjj4qdm3DFP7AzU4tLUri HYhX162XB2YlXys3CtLR9e8ssNzmAF4q29yzFI8yXPKwJNNqTiMbgHjowKdhsVW1llGo sblq1MuQlrT3lE/RECr4xkQclOYzOZuMm36WuwdRSEb2cB4zJV9N/i5P+36KW56wKbI8 rw2ywSv5gWOp5FIn+7HoNuToOHfJ/PhvOfoplsS1020GI/Lq0uTAYlXANUnwRTHHhgnE qI3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FU5A3CG2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u15-20020a63790f000000b0042b4089cfecsi5603627pgc.651.2022.08.31.11.59.57; Wed, 31 Aug 2022 12:00:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FU5A3CG2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232895AbiHaS0D (ORCPT + 99 others); Wed, 31 Aug 2022 14:26:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232500AbiHaSZf (ORCPT ); Wed, 31 Aug 2022 14:25:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A81BF327A for ; Wed, 31 Aug 2022 11:21:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B5D8861CCE for ; Wed, 31 Aug 2022 18:21:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C3A7C433D6; Wed, 31 Aug 2022 18:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661970110; bh=6XP22WTmc8yL/Ak3Vl83+H3N1Eq7ZOAnCRPlATglroc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FU5A3CG2XmPZTVGIDeITHow4YBhkVZku8EyLz8IYtjfCTd1yEakYzRlDQU4nUhml6 9v5RUwRNGH0AAx3m3CIfq2x7EgyxoUtSKdEFM+tH/E7HQRUICmAp9FKL9yZpfoPm5i GMKp7pGL9deirpDTNBmVpV/fWGgZtaP6svuS67bqvpAbaIL2jhy2EeGLAlMWbpFNsw P2xUWLvmlC7kq7dbmbjY/OLX5+oAiWuZ+t7zlqTQBD98BqFUbRnzYtRuPQUVO8J4H+ K/lnTlQcACZvKzMw5EXX1psV++0UUfm96fmHzJ0gUjRXOUVsphGHJYGke7+Iy6y3DC KvW8OIx+qFL7g== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id CF0BC5C015D; Wed, 31 Aug 2022 11:21:49 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: gwml@vger.gnuweeb.org, kernel-team@fb.com, w@lwt.eu, Willy Tarreau , Pranith Kumar , "Paul E . McKenney" Subject: [PATCH nolibc 01/18] tools/nolibc: make argc 32-bit in riscv startup code Date: Wed, 31 Aug 2022 11:21:29 -0700 Message-Id: <20220831182148.2698489-1-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220831182113.GA2697286@paulmck-ThinkPad-P17-Gen-1> References: <20220831182113.GA2697286@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Willy Tarreau The "ld a0, 0(sp)" instruction doesn't build on RISCV32 because that would load a 64-bit value into a 32-bit register. But argc 32-bit, not 64, so we ought to use "lw" here. Tested on both RISCV32 and RISCV64. Cc: Pranith Kumar Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney --- tools/include/nolibc/arch-riscv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/include/nolibc/arch-riscv.h b/tools/include/nolibc/arch-riscv.h index 95e2b79249257..ba04771cb3a34 100644 --- a/tools/include/nolibc/arch-riscv.h +++ b/tools/include/nolibc/arch-riscv.h @@ -190,7 +190,7 @@ __asm__ (".section .text\n" ".option norelax\n" "lla gp, __global_pointer$\n" ".option pop\n" - "ld a0, 0(sp)\n" // argc (a0) was in the stack + "lw a0, 0(sp)\n" // argc (a0) was in the stack "add a1, sp, "SZREG"\n" // argv (a1) = sp "slli a2, a0, "PTRLOG"\n" // envp (a2) = SZREG*argc ... "add a2, a2, "SZREG"\n" // + SZREG (skip null) -- 2.31.1.189.g2e36527f23