Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4558552pxb; Thu, 14 Oct 2021 07:36:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8KM5o0QuUm8wNMz+8grrQBlImsg0JgLRg4QM1HEeSvCm/X/cygXa43FDLchsUeBIztIwi X-Received: by 2002:a17:90b:1c82:: with SMTP id oo2mr6713940pjb.53.1634222194125; Thu, 14 Oct 2021 07:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634222194; cv=none; d=google.com; s=arc-20160816; b=jlLimB9e3ercjepHKjW+xOtq4bGemdY9Q6rJzM1PrHRhABiR3C8aCtnBckqx1d65oi RE5VdSAjXLiHtnDGxj1iOjrp5s84JFDd8+U1UD8uowb8Y7aiBS8hFIasyv4GwQnQ5R3B MLKFe0iiXe5/VF7FWpm2UQCQDWx+HzEnofBgmmSmW1GZ+K7sZQNEoOPChu2xSZNgRJlC UCBP9MP+ov9nMlr1OXekejacxTcVC6iqKah4QIWAL3eYZ1s6+r3A2ncJomfD39Rv+WfS QlfTRldA65nPXoMKM30hJPcLQsQztSmByOxoNPKQlESJ336dFRmymq69ydQEci9A1owm ZJUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RRur22NBusGD90t4t5587ekzz3x5I1RHcVLT1FRWOPw=; b=bhTbiDUoSeIr5lA9JYiOlmcb+2w6/SFMvlvXNbZOaJNE6vUYrZpwDKFe79rhmgsM9W /VLh+AW/sZXjtLyF3le5oroywkGi9DfqWFzrtPtP6eD2qk62WpQov0DF6R5bjBoVXboT AnI2ySZfo1/Npzfgvp/29Fca4LE8NVXfTEXWSVfA4S5pRwPzL0zr+Wpaf9JP4wteRTaX EcDwtzRrTko8HgPopDgGBZfQIAYhOHUi1PlSRBa8EqYm/jxrqrc9skQuBymRiYFIPhXo fAGh3tTbUZtPyqvXWFDGUbLe3rbg6C1kLDd/Ge6W8uz6mhmtTTt4UBITXApolAzV6HmG VUGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=RmhVf07o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j64si3536838pgd.310.2021.10.14.07.36.18; Thu, 14 Oct 2021 07:36:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=RmhVf07o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231875AbhJNO2O (ORCPT + 99 others); Thu, 14 Oct 2021 10:28:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231605AbhJNO2M (ORCPT ); Thu, 14 Oct 2021 10:28:12 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57E8EC061753 for ; Thu, 14 Oct 2021 07:26:07 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id o20so20150215wro.3 for ; Thu, 14 Oct 2021 07:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RRur22NBusGD90t4t5587ekzz3x5I1RHcVLT1FRWOPw=; b=RmhVf07oF6025wnab8G9e3JeuNPyTuS8nYqhI375yVQIL0U9eUmLhzjtuwOVtNWage l9C1jkYM8uhpYDHf9otaq/XTvm2rgfq0akCikV7qkC4iTfaB4nKogtvA+vhRnruVnbD+ cOkkxtYNiiEdWIWE4OgPf56KWAs6Yw/rBVpRQ= 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=RRur22NBusGD90t4t5587ekzz3x5I1RHcVLT1FRWOPw=; b=1wkjgJtjViTyI4JzuRYPrBuZ+y2OoCncfHWKjAEW6hjUxN+7hI7TCrbpOXBVylzv3V Gdm+uNWNWepISQ8SGHhZX892Oepb3tzUovw28ms/omJJhREZvdgVwgpAjnPZzuFU9zHy SgCG/GqFYPukNkktQQ+5lmi6we8/NymAImdMp2cCaIj827zR7aJKXhyymnqqPnXYIPUx kzmEuHd6Tinuh4yC6DI5Ugcr6AkTic4nfiBSG54pSDaVY+jNpXkvMPNUEA6OQ4AGhYfp hCFVUmVxk6dfZsKbBBHQhf/hUv84DKD17b4DvDfzJRHIhi0m2nsB/H225twY3rz2vsUd oxqA== X-Gm-Message-State: AOAM5304VMtCAb3PngOC0Tt0a92JBXl/71prmXeIwstvYDkXSZObO+59 hYLkJeDXMWBvv4FqXoOssR8J8w== X-Received: by 2002:a05:6000:1aca:: with SMTP id i10mr7234743wry.207.1634221565929; Thu, 14 Oct 2021 07:26:05 -0700 (PDT) Received: from antares.. (4.4.a.7.5.8.b.d.d.b.6.7.4.d.a.6.f.f.6.2.a.5.a.7.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:7a5a:26ff:6ad4:76bd:db85:7a44]) by smtp.gmail.com with ESMTPSA id e8sm3731111wrg.48.2021.10.14.07.26.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 07:26:05 -0700 (PDT) From: Lorenz Bauer To: nicolas.dichtel@6wind.com, luke.r.nels@gmail.com, Daniel Borkmann , Alexei Starovoitov , Zi Shen Lim , Catalin Marinas , Will Deacon , Andrii Nakryiko Cc: kernel-team@cloudflare.com, Lorenz Bauer , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/3] bpf: define bpf_jit_alloc_exec_limit for arm64 JIT Date: Thu, 14 Oct 2021 15:25:52 +0100 Message-Id: <20211014142554.53120-3-lmb@cloudflare.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211014142554.53120-1-lmb@cloudflare.com> References: <20211014142554.53120-1-lmb@cloudflare.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Expose the maximum amount of useable memory from the arm64 JIT. Signed-off-by: Lorenz Bauer --- 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 41c23f474ea6..803e7773fa86 100644 --- a/arch/arm64/net/bpf_jit_comp.c +++ b/arch/arm64/net/bpf_jit_comp.c @@ -1136,6 +1136,11 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) 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.30.2