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 2149DC433FE for ; Mon, 15 Nov 2021 17:17:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 065DA63259 for ; Mon, 15 Nov 2021 17:17:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237161AbhKORTz (ORCPT ); Mon, 15 Nov 2021 12:19:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:46816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236783AbhKORMm (ORCPT ); Mon, 15 Nov 2021 12:12:42 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id DA1BC61BD2; Mon, 15 Nov 2021 17:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1636996186; bh=nT29tOonLZyIVBUT79fB2ueAINJ036I800GYLiZPX/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VokZoH0RhDQgRPrvPjpXLao7kTyZY0WvZ7HxjIME1VFT6kbJRDyXmYLlzoERzgCtp 47YUTNBfqMYObMr1kOJZFK6T4zPndSjwkN2SkWySzL1P/J6IqLKaAddtNiWqUoTZ2J BuZW8C2W/wB9CHVCNNukk4hpafn8IE2CsZWkbAyg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lorenz Bauer , Alexei Starovoitov , Sasha Levin Subject: [PATCH 5.4 047/355] bpf: Define bpf_jit_alloc_exec_limit for arm64 JIT Date: Mon, 15 Nov 2021 17:59:31 +0100 Message-Id: <20211115165315.072260694@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211115165313.549179499@linuxfoundation.org> References: <20211115165313.549179499@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lorenz Bauer [ Upstream commit 5d63ae908242f028bd10860cba98450d11c079b8 ] Expose the maximum amount of useable memory from the arm64 JIT. Signed-off-by: Lorenz Bauer Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211014142554.53120-3-lmb@cloudflare.com Signed-off-by: Sasha Levin --- arch/arm64/net/bpf_jit_comp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index afc7d41347f73..a343677837c77 100644 --- a/arch/arm64/net/bpf_jit_comp.c +++ b/arch/arm64/net/bpf_jit_comp.c @@ -996,6 +996,11 @@ out: return prog; } +u64 bpf_jit_alloc_exec_limit(void) +{ + return BPF_JIT_REGION_SIZE; +} + void *bpf_jit_alloc_exec(unsigned long size) { return __vmalloc_node_range(size, PAGE_SIZE, BPF_JIT_REGION_START, -- 2.33.0