From nobody Wed Oct 8 23:46:28 2025 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5DB721B9C9; Mon, 23 Jun 2025 21:25:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750713946; cv=none; b=NaNuBIv4TZ/xziOyiOuQAXxQakbb/3z/U2Et74JriOzx8betGZXccEdCC9nEL/sLXo0E7irb5FvBMrwIc5A3cxzmWXlgHywSqHJBiNplKDQNqXGGvlBbPl8Ww1Ro2pfdQLOMFwagrZ23iUyLyYLBiFuK0fVHrWVm0MxoD8VX/WA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750713946; c=relaxed/simple; bh=98CrYfiF4BtrJsy4mcJlUCMY0HAKCKJDc4QFtC0CKUs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TzabqLZx1JfR/OGe6mWeFPrrQKT3c+NCaMC7CcVhxc3mlRoA34VlFLbpHQAB7bGQPhvg+YNQkvRpYqeXogu4nC5IolX90MxooC5fNbQJ5qeXYFjPNPA5g6iYKovI8yutkBzPkLFc5cUy+qDS/jN0REBYuiEiol8LPfgV5yLD41s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=I1TjsbgX; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="I1TjsbgX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1750713942; bh=98CrYfiF4BtrJsy4mcJlUCMY0HAKCKJDc4QFtC0CKUs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=I1TjsbgXXK9fHk4KfpiRfGOnRNwphCmIif/IIkTvOi0Unj2PsnjzKLzmekjHo2RFJ XXKpuKFTNVtM7rnK8aQh/uUK6BjwDqOlaXq6RngkA+P5T5hto/Me3HNK+NwJzsLyqc 8S4frozUVkRza2GKCo9y64doo7NQMkShtPg/NA3I= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 23 Jun 2025 23:25:36 +0200 Subject: [PATCH v3 1/4] tools/nolibc: MIPS: drop $gp setup 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250623-nolibc-mips-n32-v3-1-6ae2d89f4259@weissschuh.net> References: <20250623-nolibc-mips-n32-v3-0-6ae2d89f4259@weissschuh.net> In-Reply-To: <20250623-nolibc-mips-n32-v3-0-6ae2d89f4259@weissschuh.net> To: Willy Tarreau , Shuah Khan , Thomas Bogendoerfer , "Maciej W. Rozycki" Cc: Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mips@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1750713941; l=1658; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=98CrYfiF4BtrJsy4mcJlUCMY0HAKCKJDc4QFtC0CKUs=; b=DK0FRPqX+11S7qlrhNy8SVQa/50ciVSsZU6ZHmlvqk4wFbgs9FFjgmrYGgQeaAkQZhWRb1W7F XFFiin8uqUyD6oPsbVcUOyCHUvpx6I/Wa6q5uaEfXCK32qHUEOeQAiI X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The setup of the global pointer "$gp" register was necessary when the C entrypoint was called through "jal ". However since commit 0daf8c86a451 ("tools/nolibc: mips: load current functi= on to $t9") "jalr" is used instead which does not require "$gp". Remove the unnecessary $gp setup, simplifying the code and opening the road for some other cleanups. Suggested-by: Maciej W. Rozycki Link: https://lore.kernel.org/lkml/alpine.DEB.2.21.2502172208570.65342@angi= e.orcam.me.uk/ Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Sebastian Andrzej Siewior --- tools/include/nolibc/arch-mips.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tools/include/nolibc/arch-mips.h b/tools/include/nolibc/arch-m= ips.h index 753a8ed2cf695f0b5eac4b5e4d317fdb383ebf93..6d023d9f120301b2d6837c923c1= 42ab2cf87ae5a 100644 --- a/tools/include/nolibc/arch-mips.h +++ b/tools/include/nolibc/arch-mips.h @@ -185,13 +185,7 @@ void __attribute__((weak, noreturn)) __nolibc_entrypoi= nt __no_stack_protector __ __asm__ volatile ( ".set push\n" ".set noreorder\n" - "bal 1f\n" /* prime $ra for .cpload = */ - "nop\n" - "1:\n" - ".cpload $ra\n" "move $a0, $sp\n" /* save stack pointer to $a0, as arg1 of _start= _c */ - "addiu $sp, $sp, -4\n" /* space for .cprestore to store $gp = */ - ".cprestore 0\n" "li $t0, -8\n" "and $sp, $sp, $t0\n" /* $sp must be 8-byte aligned = */ "addiu $sp, $sp, -16\n" /* the callee expects to save a0..a3 there = */ --=20 2.50.0