From patchwork Thu Oct 28 13:20:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 12590137 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20C59C433F5 for ; Thu, 28 Oct 2021 13:21:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E38BB60F56 for ; Thu, 28 Oct 2021 13:20:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E38BB60F56 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:References:In-Reply-To: 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: List-Owner; bh=n7FBofelty/qq32cKF6CssX/tKN6DC1VMVL1Xr1PWcE=; b=gP9lHIJBwhzCGs P7k3rU89Kb8ZPITz9kcOsVaRDu9YLVpPxwUlZemyFjhbmxjhLjKQSe6qPYe/3Jzx6qHPobRGL87CJ fxsO2fFtPT4eUbnwKVVCV+4xQzd3s9e50oaopm5EiHaPgqgjW3Lqj+L1eAEaTSU7KyUrLR55vdAiI XwfByKMggNOsuc/8HdE41xaRTkZF7FKIIo/OUJRN6cu/erwKAp8Y8xtnXKMpjvdzBcLEC9fFDQgzL 2Y+IQQ5yuHxXei2ZaRFFxfOyZpdmmxAoO8Ep8m5+zkpckHdu9hujWqKrrtPmDmMWWaTZywXYXHl1u 8Te5Kfv5RoaIhEjKSp8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mg5Ku-007uXE-AB; Thu, 28 Oct 2021 13:20:52 +0000 Received: from mail-lf1-f43.google.com ([209.85.167.43]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mg5Kq-007uV3-HM for linux-riscv@lists.infradead.org; Thu, 28 Oct 2021 13:20:49 +0000 Received: by mail-lf1-f43.google.com with SMTP id b32so10350990lfv.0 for ; Thu, 28 Oct 2021 06:20:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O/AJBEW3vyVrTUMTRP/ONhgseLgot5lKkfZZ3GS+nfA=; b=XMOIEQwCbrIonabB3v7HWXWlplAxsyvhOU73wPOcsJvbEI/Zo+gx9//U8d3teNMe/d C7MXn2yyBEvOrSWgGq21u7PsTpYAF7bD7/GLx3eLHJTQ90JeMSer6/sreuxpxBkjjdwC j6EbRfsP0eUenUG51eeYqAIDwLvf4FYdU8jP1Zffa3XbLVbkORI2fS05DurpgPryu/71 HTMajsj/jGdE3yd4Dolg6XKcAC3WE8K9MQT8XgkMQiADxyCQv6oF2DYgFWifzFBQIHk+ 7nwhR/P21C98yQ+cybe88WOGD1KtcaEYOVrUskTgyYksh3yxQl72zjJShB/r9Dms2Xeg Mfng== X-Gm-Message-State: AOAM532pqV4KS9bu4TiugAPzi3Fmcwm6RTYUcAIu8/fHLpvM2ednInhE difjcuLgERYFqy0QCP6Ee+o= X-Google-Smtp-Source: ABdhPJxZcJ13N8X0a3vFeqXrp6hDAqd5+pSCoHgE77DOaEKKyBW0zArRRHgSPWuy87B3rp/8uizNtw== X-Received: by 2002:a05:6512:2184:: with SMTP id b4mr4206060lft.663.1635427246654; Thu, 28 Oct 2021 06:20:46 -0700 (PDT) Received: from kladdkakan.. ([185.213.154.234]) by smtp.gmail.com with ESMTPSA id o9sm309616lfk.292.2021.10.28.06.20.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 06:20:45 -0700 (PDT) From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org, bpf@vger.kernel.org Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , linux-riscv@lists.infradead.org Subject: [PATCH bpf-next 1/4] riscv, bpf: Increase the maximum number of iterations Date: Thu, 28 Oct 2021 15:20:38 +0200 Message-Id: <20211028132041.516820-2-bjorn@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211028132041.516820-1-bjorn@kernel.org> References: <20211028132041.516820-1-bjorn@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211028_062048_598385_E40A9B7D X-CRM114-Status: GOOD ( 10.39 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Now that BPF programs can be up to 1M instructions, it is not uncommon that a program requires more than the current 16 iterations to converge. Bump it to 32, which is enough for selftests/bpf, and test_bpf.ko. Signed-off-by: Björn Töpel --- arch/riscv/net/bpf_jit_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/net/bpf_jit_core.c b/arch/riscv/net/bpf_jit_core.c index 7ccc809f2c19..ef9fcf6ea749 100644 --- a/arch/riscv/net/bpf_jit_core.c +++ b/arch/riscv/net/bpf_jit_core.c @@ -11,7 +11,7 @@ #include "bpf_jit.h" /* Number of iterations to try until offsets converge. */ -#define NR_JIT_ITERATIONS 16 +#define NR_JIT_ITERATIONS 32 static int build_body(struct rv_jit_context *ctx, bool extra_pass, int *offset) { From patchwork Thu Oct 28 13:20:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 12590139 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40815C433EF for ; Thu, 28 Oct 2021 13:21:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0EC2360F92 for ; Thu, 28 Oct 2021 13:21:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0EC2360F92 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:References:In-Reply-To: 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: List-Owner; bh=80KGFsgh0s8j2Pm9mYh2qpxVtotPS0wQCqmpMwWVXo8=; b=b27zFxhttUcx/L PwqlOyVGP7nHjYpN9Pkez2bmdXcgBoWHxcR2cujsKA9RQWYQKwHCGZzYOHK7s8/n8MsFG12Ouhtuf rvXYZJ1DYmHY2tWAjWYIYqC/Ni+8aU5Qtrl5XannHkKDlZjS/d0xQI0nhWKPX+4psUFONg0Cz6tP0 d+NC++PjFkci7zKUeCBpVskKvsHd+swTR3NlfdSdI80Ql8+R+PiyBSzI5eVhPp+Tezh5Ma7JF3kAT SSzDRx41GM6Ybbevm+VSdz3vApWG5o3U1KjBiWH51kyBuznZOnEMIuIIqBgzhvh4iNmWab7W+vlKY YiL04rNROtFKroxQxxfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mg5Kw-007uXw-1K; Thu, 28 Oct 2021 13:20:54 +0000 Received: from mail-lf1-f54.google.com ([209.85.167.54]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mg5Kr-007uVe-Ki for linux-riscv@lists.infradead.org; Thu, 28 Oct 2021 13:20:50 +0000 Received: by mail-lf1-f54.google.com with SMTP id bq11so13512791lfb.10 for ; Thu, 28 Oct 2021 06:20:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FpcAIXzIJRZanZR1xOZ449nR9Z4CpuYm3hzQzUAM83c=; b=rN1mU9b04kHL1q0rR9BDVgndzvOvFwGcdNI3xXJUjRlHOXy8UUAseYWd8+NrDWuKry PWIUUEDMxT42BX2HwPeLgi8Yba0VD45HHMHaWN1Qu8afrNR24muR2qdPWtseAFYwjAAo nIHnfjcTauDjyR0pr5cPb+l1sL280Xpy/H52/v3CmcNCYQX4XdbQEhYnn2Me0MprdIp6 U45jyfEEt4VaJRZYDTU+0/PzwIiT9eXwEhzs+fLQ0mVNoOHCW/aTJoyBYbwfACImPpVn iwfFOfW6EMKPJpe61UU8UQCD1CPKdmneLoQZnPP1oBalUuE/xbWEf5YAhBIjYLHNUMSE 8ErQ== X-Gm-Message-State: AOAM532guWazu53HN/iXrHBGg3Vt5jd2xgcHx4cD2Ocr02chjlZdl7pd 0EHoz7+nSOq4hHOt5sFeU/0= X-Google-Smtp-Source: ABdhPJzpoIYhfju6k4/Qfnivw7wHlSlK52r59+vqI6IlaJ3X5/OYjMzzZhfjKSvZC4Rv3XnX0kOmUQ== X-Received: by 2002:a05:6512:3b20:: with SMTP id f32mr4083761lfv.423.1635427248082; Thu, 28 Oct 2021 06:20:48 -0700 (PDT) Received: from kladdkakan.. ([185.213.154.234]) by smtp.gmail.com with ESMTPSA id o9sm309616lfk.292.2021.10.28.06.20.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 06:20:47 -0700 (PDT) From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org, bpf@vger.kernel.org Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , linux-riscv@lists.infradead.org Subject: [PATCH bpf-next 2/4] tools build: Add RISC-V to HOSTARCH parsing Date: Thu, 28 Oct 2021 15:20:39 +0200 Message-Id: <20211028132041.516820-3-bjorn@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211028132041.516820-1-bjorn@kernel.org> References: <20211028132041.516820-1-bjorn@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211028_062049_702521_6DDB3866 X-CRM114-Status: UNSURE ( 8.62 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add RISC-V to the HOSTARCH parsing, so that ARCH is "riscv", and not "riscv32" or "riscv64". This affects the perf and libbpf builds, so that arch specific includes are correctly picked up for RISC-V. Signed-off-by: Björn Töpel --- tools/scripts/Makefile.arch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/scripts/Makefile.arch b/tools/scripts/Makefile.arch index b10b7a27c33f..0c6c7f456887 100644 --- a/tools/scripts/Makefile.arch +++ b/tools/scripts/Makefile.arch @@ -4,7 +4,8 @@ HOSTARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ -e /arm64/!s/arm.*/arm/ -e s/sa110/arm/ \ -e s/s390x/s390/ -e s/parisc64/parisc/ \ -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ - -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ ) + -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \ + -e s/riscv.*/riscv/) ifndef ARCH ARCH := $(HOSTARCH) From patchwork Thu Oct 28 13:20:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 12590141 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 190CDC433FE for ; Thu, 28 Oct 2021 13:21:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CA92C60F92 for ; Thu, 28 Oct 2021 13:21:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CA92C60F92 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:References:In-Reply-To: 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: List-Owner; bh=+CSIH4WpKNfjCwol9IuIC5zNaMvvNmeBafiMnrlfZM8=; b=jRFbdlGPEteTaK 2f/zZO1nSnGyT2YcdOgzfwROZngCaHZQVVOtc5YSyYOBkMLhxI9BIzrm4kJqD+83lYMQNJzKNt32o NL4vjDlBHduvmiaDZqkETZ/E+xTz6QjL8bKQuFKR2pW3u3Kg4oly/bs5+wG5goPUn42vOTMkx3E43 ysUY/9kQQ147kXV3tM/bVcJ2HhCj8hD1jjdI/bnbGV8HSO3lWsOB91L8Tyv4Kk9Q9tVH/7PIwKbG8 ESONhO1j7mPD1o/LymvKTvrcMreXePwt3UTr5TK+OcOpvCmLnW8C6CWz9UdxGkZmZmIbCsNYd01AH AeOtzS7dfFRG2N5kBzww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mg5Kx-007uYg-Nf; Thu, 28 Oct 2021 13:20:55 +0000 Received: from mail-lj1-f180.google.com ([209.85.208.180]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mg5Ks-007uWa-Pw for linux-riscv@lists.infradead.org; Thu, 28 Oct 2021 13:20:52 +0000 Received: by mail-lj1-f180.google.com with SMTP id n7so10677817ljp.5 for ; Thu, 28 Oct 2021 06:20:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DH8yGhC3Nvprfn3hCny0Vjdm/oIXFS546cCDILMHRkQ=; b=C5HqJDtUWaTz3AWcgOGU2lfySJ8y2bIm78dK8rBym3LMQxwfnc78pShfjO0SiXMzcb w1thZw5+yGoOOx9gQTIZvYkZwd/gvJ2rNcfI2qd6X8Bpb0EkRmIMNeMKKfP9lz6OB3j5 pxT67dkl+C7k0zWeQW/amly8EHVLoHRoqIxkXUDwSD3/BKU4+ePxWGyC48QD+JxCMILe U2P8XS3SiKV8TpWz463i2IYhtEk1eJYx5nHTzP/Jhn6cA3DrWcG4DCidm8kd01CfyncZ 0wqvwJ3YJWl8CUPAafv6FehUQ7RbtV862HUZJpvih33ClXOLN9NPxVPPax25QkSEQNLJ DB/g== X-Gm-Message-State: AOAM532Fe1Q0eSM09l4V76A/2ek+kpKSqdppbSl89qGpAn01tZ+95F3B BIVHCbwEdE+tab5WyeM+27R0y45cOFQ= X-Google-Smtp-Source: ABdhPJy1ng4PVVuyy9CHwlwagSpRIkQogBPHHc5fdz69bIf8M2HrNFhfPRPqwRcP/TZvWBF6sxMeyw== X-Received: by 2002:a05:651c:88d:: with SMTP id d13mr4607828ljq.399.1635427249412; Thu, 28 Oct 2021 06:20:49 -0700 (PDT) Received: from kladdkakan.. ([185.213.154.234]) by smtp.gmail.com with ESMTPSA id o9sm309616lfk.292.2021.10.28.06.20.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 06:20:48 -0700 (PDT) From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org, bpf@vger.kernel.org Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , linux-riscv@lists.infradead.org Subject: [PATCH bpf-next 3/4] riscv, libbpf: Add RISC-V (RV64) support to bpf_tracing.h Date: Thu, 28 Oct 2021 15:20:40 +0200 Message-Id: <20211028132041.516820-4-bjorn@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211028132041.516820-1-bjorn@kernel.org> References: <20211028132041.516820-1-bjorn@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211028_062050_863151_112FF54C X-CRM114-Status: UNSURE ( 8.50 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add macros for 64-bit RISC-V PT_REGS to bpf_tracing.h. Signed-off-by: Björn Töpel --- tools/lib/bpf/bpf_tracing.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h index d6bfbe009296..db05a5937105 100644 --- a/tools/lib/bpf/bpf_tracing.h +++ b/tools/lib/bpf/bpf_tracing.h @@ -24,6 +24,9 @@ #elif defined(__TARGET_ARCH_sparc) #define bpf_target_sparc #define bpf_target_defined +#elif defined(__TARGET_ARCH_riscv) + #define bpf_target_riscv + #define bpf_target_defined #else /* Fall back to what the compiler says */ @@ -48,6 +51,9 @@ #elif defined(__sparc__) #define bpf_target_sparc #define bpf_target_defined +#elif defined(__riscv) && __riscv_xlen == 64 + #define bpf_target_riscv + #define bpf_target_defined #endif /* no compiler target */ #endif @@ -288,6 +294,32 @@ struct pt_regs; #define PT_REGS_IP_CORE(x) BPF_CORE_READ((x), pc) #endif +#elif defined(bpf_target_riscv) + +struct pt_regs; +#define PT_REGS_RV const volatile struct user_regs_struct +#define PT_REGS_PARM1(x) (((PT_REGS_RV *)(x))->a0) +#define PT_REGS_PARM2(x) (((PT_REGS_RV *)(x))->a1) +#define PT_REGS_PARM3(x) (((PT_REGS_RV *)(x))->a2) +#define PT_REGS_PARM4(x) (((PT_REGS_RV *)(x))->a3) +#define PT_REGS_PARM5(x) (((PT_REGS_RV *)(x))->a4) +#define PT_REGS_RET(x) (((PT_REGS_RV *)(x))->ra) +#define PT_REGS_FP(x) (((PT_REGS_RV *)(x))->s5) +#define PT_REGS_RC(x) (((PT_REGS_RV *)(x))->a5) +#define PT_REGS_SP(x) (((PT_REGS_RV *)(x))->sp) +#define PT_REGS_IP(x) (((PT_REGS_RV *)(x))->epc) + +#define PT_REGS_PARM1_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), a0) +#define PT_REGS_PARM2_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), a1) +#define PT_REGS_PARM3_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), a2) +#define PT_REGS_PARM4_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), a3) +#define PT_REGS_PARM5_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), a4) +#define PT_REGS_RET_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), ra) +#define PT_REGS_FP_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), fp) +#define PT_REGS_RC_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), a5) +#define PT_REGS_SP_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), sp) +#define PT_REGS_IP_CORE(x) BPF_CORE_READ((PT_REGS_RV *)(x), epc) + #endif #if defined(bpf_target_powerpc) From patchwork Thu Oct 28 13:20:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 12590143 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15C18C433EF for ; Thu, 28 Oct 2021 13:21:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DAB9260F92 for ; Thu, 28 Oct 2021 13:21:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DAB9260F92 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:References:In-Reply-To: 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: List-Owner; bh=hqGXWqhkJykXLbcn0h8eZ1ll7WpfdhUjCB/QE8wfVds=; b=L7gHytzJ/mhe0w oryfc9gooK3g04dcBf8in9GHb99KCtl33ILhusa3Ol0m0MgHcqO34fQKbR+byUWXpGBDYv9H5kC60 pI/YdVY7E/MxS367I9a8HIatwxNrxHUpQgLmzcN3iUibaiWePrbIeOkWVbTO0LnAalduzCFlxeIfX Zcf5t0qEPcI8Xld5lrLhgeYjS4rf9Imi/WVjRcx9gkndwjS+Hn8lm0wscdFoRJTzafpDHht2m2pXw eXB9KkJmAPTNzfWiG7lXrwjJiC/vDJmjPekeqEXZVwIl2EaC2ctJxxslL1QgnDseRXvnTEjwflmqp VtCV3DC28xcfLtltgwkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mg5Kz-007uaB-PG; Thu, 28 Oct 2021 13:20:57 +0000 Received: from mail-lf1-f53.google.com ([209.85.167.53]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mg5Ku-007uX9-T7 for linux-riscv@lists.infradead.org; Thu, 28 Oct 2021 13:20:54 +0000 Received: by mail-lf1-f53.google.com with SMTP id x27so13549486lfu.5 for ; Thu, 28 Oct 2021 06:20:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3PZBfQ2VLBVQ+FScckJP/YM1qLVydE5D6300dI/9Uj0=; b=r3k0zKq2KwH91vmwpg+HI+AjE+MnMsjLrLXi+9pWeOhUtKp7NwMtMJ/caUzvO5M6d+ nt1dHHRKbZ/7n1thzD62NnRsFl4xo5cJanUshkpvfz4WBaW2MOIp2P7mNtRvWcgoZ7dU j4meCb6+793d5K3PIdu1J0Mg34HobjRUPxF8VzQpM14+2olN4NBgYXYiKPC2xsJ08+M+ KfogXJNyTRSajShCly6RZGtpy3G4KbnaROa/XnFJgEaT+By+J2rKSMVxwte+jsHB1FPU 5oicPHUd6j51kIkJ9HDoF5IKcMmjJtb2+eO8KTICeOY0EWcWx/AxXBWA34BBPQ3haYWP KjaA== X-Gm-Message-State: AOAM533lgriMrRZQAruXbVaXth+R/SdGFwI9lIJVD7YuUzQSXYK7MrfT zMGi5ktxHKucZTjhffealDpyjXEMyrg= X-Google-Smtp-Source: ABdhPJxfNRrAhW5xushlBQeEd0Em0sopu17I+MiQ1/8I8I+S67KskkgZ+epYCfCrm5NfnUNj6YVqHA== X-Received: by 2002:a05:6512:2309:: with SMTP id o9mr4155941lfu.124.1635427251319; Thu, 28 Oct 2021 06:20:51 -0700 (PDT) Received: from kladdkakan.. ([185.213.154.234]) by smtp.gmail.com with ESMTPSA id o9sm309616lfk.292.2021.10.28.06.20.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 06:20:50 -0700 (PDT) From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org, bpf@vger.kernel.org Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , linux-riscv@lists.infradead.org Subject: [PATCH bpf-next 4/4] selftests/bpf: Fix broken riscv build Date: Thu, 28 Oct 2021 15:20:41 +0200 Message-Id: <20211028132041.516820-5-bjorn@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211028132041.516820-1-bjorn@kernel.org> References: <20211028132041.516820-1-bjorn@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211028_062052_965175_0BB4A7BC X-CRM114-Status: UNSURE ( 8.56 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This patch is closely related to commit 6016df8fe874 ("selftests/bpf: Fix broken riscv build"). When clang includes the system include directories, but targeting BPF program, __BITS_PER_LONG defaults to 32, unless explicitly set. Workaround this problem, by explicitly setting __BITS_PER_LONG to __riscv_xlen. Signed-off-by: Björn Töpel --- tools/testing/selftests/bpf/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index ac47cf9760fc..d739e62d0f90 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -277,7 +277,8 @@ $(RESOLVE_BTFIDS): $(HOST_BPFOBJ) | $(HOST_BUILD_DIR)/resolve_btfids \ define get_sys_includes $(shell $(1) -v -E - &1 \ | sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }') \ -$(shell $(1) -dM -E -