From nobody Sun Apr 19 04:03:43 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38F1ACCA47F for ; Wed, 6 Jul 2022 14:03:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233745AbiGFODy (ORCPT ); Wed, 6 Jul 2022 10:03:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233865AbiGFODs (ORCPT ); Wed, 6 Jul 2022 10:03:48 -0400 Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E732824BC3; Wed, 6 Jul 2022 07:03:35 -0700 (PDT) From: Yixun Lan To: linux-riscv@lists.infradead.org, =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , bpf@vger.kernel.org Cc: Palmer Dabbelt , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Paul Walmsley , Albert Ou , Hengqi Chen , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yixun Lan Subject: [PATCH] riscv, libbpf: use a0 for RC register Date: Wed, 6 Jul 2022 22:02:04 +0800 Message-Id: <20220706140204.47926-1-dlan@gentoo.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" According to the RISC-V calling convention register usage here[1], a0 is used as return value register, so rename it to make it consistent with the spec. [1] section 18.2, table 18.2 https://riscv.org/wp-content/uploads/2015/01/riscv-calling.pdf Fixes: 589fed479ba1 ("riscv, libbpf: Add RISC-V (RV64) support to bpf_traci= ng.h") Signed-off-by: Yixun Lan Acked-by: Amjad OULED-AMEUR Acked-by: Bj=C3=B6rn T=C3=B6pel --- I'm adding a Fixes tag here, although the original version may just work fi= ne, and shouldn't be considered as a real error. But, the benefit is that we co= uld make it consistent with RISC-V spec, and all other tools will follow the sa= me usage. thanks, and let's me if there is any issue that I may not noticed.. --- tools/lib/bpf/bpf_tracing.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h index 01ce121c302df..11f9096407fc4 100644 --- a/tools/lib/bpf/bpf_tracing.h +++ b/tools/lib/bpf/bpf_tracing.h @@ -233,7 +233,7 @@ struct pt_regs___arm64 { #define __PT_PARM5_REG a4 #define __PT_RET_REG ra #define __PT_FP_REG s0 -#define __PT_RC_REG a5 +#define __PT_RC_REG a0 #define __PT_SP_REG sp #define __PT_IP_REG pc /* riscv does not select ARCH_HAS_SYSCALL_WRAPPER. */ --=20 2.35.1