From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 45B765111B2; Wed, 30 Sep 2026 16:07:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790784444; cv=none; b=kd1UTgzdORBQtUraKex0+UYXYaXe7ivRuZWJvNorJUtn0G3FahXR1emdaofc7vZQsnObepS464f0Uwj48mfySUwU5KngHhJwHyAACx6km1Rziw4mJw5w13NuO/7gZOiR/DIdfXQIyhzneuo3Rs8LcPvuKlzv1fcn5kvVGGIFym0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790784444; c=relaxed/simple; bh=DOTUFKNvc8w9DvDr/xZvqMJt3clr5P1Gm+Tz8HzinAg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ytw3xehn94fePtz08VwKAkId+Hf7ISj9ZsJhpKuRFHgCXx5T8/gpr0hVs+/jyX3k94tv42h5+SAll5F3xxiqDPN+nBVsDKFf51qx8A+iLWkLQsvI7Md4oIfAfUzVytnPYyqgT/6M/ICUNfgy082f/3JrzliI3jAqoWJgalE3NtA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZwtBw0CL; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ZwtBw0CL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 549911F0089A; Wed, 30 Sep 2026 16:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790784439; bh=bu44NLJPHhlvc0n7dPfIMYij52WRZU0/OnIx5Ai4ziE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZwtBw0CLBTgDGQ+g1s4FvCgxfQm3WAYFJJ7tDU560XoIb7Lg5IVeElhJYk2FeCUy8 NS2m7PEeOn6+UfgpHXJuNQdTq3lRfeaW+49StkQkpHVoKI56LuxnBeKw/fX7ZG3aQx NHz8cG6RbfeZ3eVGJc5vJ/Fo7zJ+4g0VZ2JxUB24= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tiezhu Yang , Andrii Nakryiko , Sasha Levin Subject: [PATCH 6.1 119/982] libbpf: Add __NR_bpf definition for LoongArch Date: Wed, 30 Sep 2026 17:14:15 +0200 Message-ID: <20260930152419.374279738@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152416.775402466@linuxfoundation.org> References: <20260930152416.775402466@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tiezhu Yang [ Upstream commit a4a5d4ee061240a1d39053db0a87f841d43277c0 ] LoongArch uses the generic syscall table, where __NR_bpf is defined as 280 in include/uapi/asm-generic/unistd.h. To align with other architectures, add the __NR_bpf definition for LoongArch to avoid a potential compilation failure: "error __NR_bpf not defined. libbpf does not support your arch." This is a follow up patch of: commit b0c47807d31d ("bpf: Add sparc support to tools and samples.") commit bad1926dd2f6 ("bpf, s390: fix build for libbpf and selftest suite") commit ca31ca8247e2 ("tools/bpf: fix perf build error with uClibc (seen on ARC)") commit e32cb12ff52a ("bpf, mips: Fix build errors about __NR_bpf undeclared") Signed-off-by: Tiezhu Yang Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20260526063936.16769-1-yangtiezhu@loongson.cn Signed-off-by: Sasha Levin --- tools/build/feature/test-bpf.c | 2 ++ tools/lib/bpf/bpf.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tools/build/feature/test-bpf.c b/tools/build/feature/test-bpf.c index 727d22e34a6e5..febc3a93c29fc 100644 --- a/tools/build/feature/test-bpf.c +++ b/tools/build/feature/test-bpf.c @@ -20,6 +20,8 @@ # define __NR_bpf 6319 # elif defined(__mips__) && defined(_ABI64) # define __NR_bpf 5315 +# elif defined(__loongarch__) +# define __NR_bpf 280 # else # error __NR_bpf not defined. libbpf does not support your arch. # endif diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c index 1d49a03528365..484d30691a600 100644 --- a/tools/lib/bpf/bpf.c +++ b/tools/lib/bpf/bpf.c @@ -59,6 +59,8 @@ # define __NR_bpf 6319 # elif defined(__mips__) && defined(_ABI64) # define __NR_bpf 5315 +# elif defined(__loongarch__) +# define __NR_bpf 280 # else # error __NR_bpf not defined. libbpf does not support your arch. # endif -- 2.53.0