Message ID | 20240209040608.98927-16-alexei.starovoitov@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2F87C4828F for <linux-mm@archiver.kernel.org>; Fri, 9 Feb 2024 04:07:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 39C528D000C; Thu, 8 Feb 2024 23:07:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 327578D0001; Thu, 8 Feb 2024 23:07:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19CB98D000C; Thu, 8 Feb 2024 23:07:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 04BF98D0001 for <linux-mm@kvack.org>; Thu, 8 Feb 2024 23:07:19 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id DAA2E803B9 for <linux-mm@kvack.org>; Fri, 9 Feb 2024 04:07:18 +0000 (UTC) X-FDA: 81770930556.01.6C3637A Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by imf25.hostedemail.com (Postfix) with ESMTP id 0B6F2A0013 for <linux-mm@kvack.org>; Fri, 9 Feb 2024 04:07:16 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=amwYJBQe; spf=pass (imf25.hostedemail.com: domain of alexei.starovoitov@gmail.com designates 209.85.215.175 as permitted sender) smtp.mailfrom=alexei.starovoitov@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707451637; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=mCIDfn6Q/Sj02IoZMnsUeC+cwQq+R0K4Vy6avN3EcgA=; b=nXNm7UHki+33ORcCQjny1cWYHWE/CuH6RLGVE8UaXzfocQyJ3IpVL3TMPyS1J0IvxHWOO0 3lqRcg7JkurPjFakZBgZtBbIqnTSwA2Zq9LETI2m3dzGKNWBjYiKa5zvdI96u62ovD74SK rmzYyCDBJX34dPz3o6YUyOSjwInbvzs= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=amwYJBQe; spf=pass (imf25.hostedemail.com: domain of alexei.starovoitov@gmail.com designates 209.85.215.175 as permitted sender) smtp.mailfrom=alexei.starovoitov@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707451637; a=rsa-sha256; cv=none; b=OatCgVEo/xRsaIt01UEukqw14jM9tpd/nw9cu1Ocwo3hhPzS89pXHNu7xrzdP/ovekUHCa HJ1PmvbLabCgrrPK6f9ObmOSdpRczeE4WZhYGbv1LqthZIcCF5FRtugNJRCTymH3zVJSAp AYmnzWMCG2wkg2yOgJtyY6Ns5vx40DQ= Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-5d4d15ec7c5so369916a12.1 for <linux-mm@kvack.org>; Thu, 08 Feb 2024 20:07:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707451636; x=1708056436; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mCIDfn6Q/Sj02IoZMnsUeC+cwQq+R0K4Vy6avN3EcgA=; b=amwYJBQeVYT9dKsPjxn5xV3us4ScqqVadDYqlbmJBirlfJuwOTiejKypE8p7hb5UzN Ispn+NyG3Owj/hu6azyxULxaQtOaTjFuHnebj1lqcSepgAbjBcKGArE/iigeIB2c3Nuo +zqCkr8Ulvq9KFGcnXg5qriBW8yReFjcxkbK4VOA+vYjA/8ems6P44Vjb/KFkSew7Zjd ptpeYyx6Vvxi4p/9ZWUBQnPbZT+v+RTRT9IhsIhaR76ezGPa0DzmYBTTzSr44PYbZgBM sIDhAz895aS5ZmqhrwyF9r0LnGHqlM8fHOwtXc+BpTPu196cNo7sEjs01YbJ0nV1BOYQ lmvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707451636; x=1708056436; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mCIDfn6Q/Sj02IoZMnsUeC+cwQq+R0K4Vy6avN3EcgA=; b=wtt6c1k6QgZsxnixPt5ntIr0AxEdSG8Pkj7DDH9Nt+AVGRdFx+SXWHsDTaO37kbqFr uzdsQSSD+e7UFn/Coo4Z+UlI66eLRDE9AeyTi7aTbZs0PNOHqRzQp7fncCtbopHjbqOW l0V+oMl2GLVgP6HbB2dw3pHtWkOFia0ViwkJm/6/1uJhddpGYU2X4dLBuwcXGEZrPm44 0nfsJu4Ud8nu/rNBdJlOlBVgyO0Tl7h/ivncka10+WzqN04C0TwiYpvyh7Znd14KeeA5 pbTmb7Lp6fSGYb1K2eLh+NNtHhCri5sIPXKeJYnlnPkBephVqf2dkv889UmewGLkiX8B Wrhg== X-Forwarded-Encrypted: i=1; AJvYcCUW40XbxPxiCC4ZksYcGi/N/W53bfO7K48ub6b5eUJ9TWsW20Nmp+aVh31BoDbu6TNdxdZ9lo7LYyJaX3OgreL6LRA= X-Gm-Message-State: AOJu0YyGsn/ZzgeuiYTj7M5susRRB3/PlxU22xaE01RozDHV5ZoCGb9x 6kmYNd1+g1YR5itDm56zbmci3c6tJtbWdyr3YpYG5TmLSr7OEXS+ X-Google-Smtp-Source: AGHT+IEi6h+ceTfRMJ5dI0p3X7XJYh4ZzKQVqNqt1uF5ux0MvuhWLqAFaBeMLSjm/CCs2wr1Y3GeYQ== X-Received: by 2002:a05:6a21:6711:b0:19c:9c2e:7860 with SMTP id wh17-20020a056a21671100b0019c9c2e7860mr691997pzb.13.1707451635981; Thu, 08 Feb 2024 20:07:15 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXL44286flKbPuiC5jJpQL4r9tnFLyhpDpeoUK86uHyxm1KmiZjhC6iWst+l0Yj3ohxbkOTv9OMTtkRZouflvj/p0qsmCfCCNN+RU3re5UYu0eZbWx8Sm3Trzrg2OIR5wSWop8s/7FQFUH7FL46mVTYTOUwdUDu4w4XDY8IA5NbPjR3F59YeYpxDdlZ6qaYXgatcmUWxkbTYM+4Q6SW/7jYYzybmfjOPjllVmPAAYXvZ0YIqXV+dVZ+aEPOeAxlLZHGJST60otvvVynWglcMCjg34Qy05PuwmX05Am2ndC0Gyx9LCDF3GGY+BLLY5ra/6Typc56SRoEhQjNtaZfxlsYSSewLkgZjqAGJ0j4Ju5PQ7l/N2P/Sg== Received: from macbook-pro-49.dhcp.thefacebook.com ([2620:10d:c090:400::4:a894]) by smtp.gmail.com with ESMTPSA id t8-20020a170902bc4800b001d9a40e204bsm551470plz.21.2024.02.08.20.07.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Feb 2024 20:07:15 -0800 (PST) From: Alexei Starovoitov <alexei.starovoitov@gmail.com> To: bpf@vger.kernel.org Cc: daniel@iogearbox.net, andrii@kernel.org, memxor@gmail.com, eddyz87@gmail.com, tj@kernel.org, brho@google.com, hannes@cmpxchg.org, lstoakes@gmail.com, akpm@linux-foundation.org, urezki@gmail.com, hch@infradead.org, linux-mm@kvack.org, kernel-team@fb.com Subject: [PATCH v2 bpf-next 15/20] bpf: Tell bpf programs kernel's PAGE_SIZE Date: Thu, 8 Feb 2024 20:06:03 -0800 Message-Id: <20240209040608.98927-16-alexei.starovoitov@gmail.com> X-Mailer: git-send-email 2.39.3 (Apple Git-145) In-Reply-To: <20240209040608.98927-1-alexei.starovoitov@gmail.com> References: <20240209040608.98927-1-alexei.starovoitov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B6F2A0013 X-Rspam-User: X-Stat-Signature: wfstsinmnafd91eem9a68g3x4njygqo8 X-Rspamd-Server: rspam01 X-HE-Tag: 1707451636-239406 X-HE-Meta: U2FsdGVkX1/tpbpljVzbMaKz91sxCnkaL/ttDX+m6us66zKtlnWsQkhs9W76QFK2YH2c8Dvy0Cp7uDWECfaBlx5d6FK/iUFqyYdkK9hDpYN9fgsjexVG3rO4QeDzbTSKkz4HfoBtL1NqVbToiUwMU4BKagDfBC+J/UUVy6K43H8J+ujqzU7rI2JAAwmuUzevO+oqsAWuxDos1aiZBpPd1Jv7PCN+U027nt4yfVTFv01cp8Y6W4NEhil1eQvOdQUoKTqzu7y+2hG7pL4M2Row2b+ujz13cDxEeaJCj23TEbk9vkNjVLiG1THTJuRgL7shGig6fu7KxnAVWScwHMaPaNcRpXTZcehraNsKV9vAdw3xs+w2nC6MmLGA2iDJ6vPkAbCwb6iB3RQSmGl8PRccZvEO2GsTTuBwB4ZpTWtRI6ulIHL5bwFv4vdbIikRr+Od83zWTHhxsEHmpjs54dhCpN3VyLTisJ/0uw8TYoiUoxVmF4m/4+vgEFCQTIP7RVrRHBSvEGvVxf7mlcNpE7YHS0HHsR7lctORvEGdD9J5JU/sgYx/sgOd3mkwU+4iIQq4Qnb5lpo6GArGS+z1JLsariFYI0qlk91g2PDMJOQDISFB/jUprMsrzOAFRsmI0iYf3UWy/bKMnnd090DO8i+VhxKJeWxki36J48ueASksLcNzDIO/vdqvAvXxhk9gS/8vkj6WMBUM9bBMDyj1l+8afekcGPmcM6NUa4nXRep6yB/63+iLCHmeasbQR3apcpmi7xxyUEVfwhdg5anevwNPt9ykBEBdtIA3tSohMb96vxqAGjQQ0T3/WMaHsZBrki8KrzGzzRWPNtNapbLSxJSpOCRlxZZ59yiZFXxMA28bBFBKZJ/f+r5FxxWwYub48zhZ9Ec4OlbvRkFSBb/7ZVC3VQH31ah1VNNS1jpPlmtaWj4CiSe2rzlFORuPCgrYFar1WnaLsUEdzjgWMC/WTE4 QikPkoMj fQ7XXlI/E4d/6OGkyaQKPBmN1CGbFXVQXjAAlFnR1a+AyvHhUH4digb9ecQL4h2+52yY5Id74W1fTsCcDGC8ceDzwOFCHd14BKXok4CEcTJqNuZgVexUUuZ5LMn7mvI1wKZ1UEVDldbWKxRm9dpwBUJ/zs5u8V7Z/wOyBZt5z8lv0atsjbP7pDtY54nLFw0YLxYPhfwx1G7tzyvG532RFJiumvWtUf/+bzlxAeQ/5sSJdaw/WIV2VyNDFxwfZ0bT6zVQX3PwM8iimjjFIDl+XvX0IkTpRezfpA83ga9eRpPrmCb5h1JJy/Mdc/uxQlRwr/ahaSAUhmafk4EhDD0KtK7wSZFWTwZUWlhrxEYvKzCs1X6fTV/pl4BCXH02wserSsudHt4LoiQrZ2pM+6zEkEc61WSexwV/cvRlwzSvTfHs2uQiEYBrVExLtP/MXmP5BXk6I4KFV+dcPA6Sue63fVhO1hjlS+ycFL9F95ovonhYcI5ksScfjy0+rXKH+bLliGljQpHMyXsqOubJ44UPCvK6LKOT5Xgsgjhrpfa9SfSiASq/RbS+oq3fIga0IFpg4N51SXaEf0Tn2PfP+o7bRQAuqtz40jx2gbrESwuf8QlvmJ8OnN5lK6HHscA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000690, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
bpf: Introduce BPF arena.
|
expand
|
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 2829077f0461..3aa3f56a4310 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -88,13 +88,18 @@ void *bpf_internal_load_pointer_neg_helper(const struct sk_buff *skb, int k, uns return NULL; } +/* tell bpf programs that include vmlinux.h kernel's PAGE_SIZE */ +enum page_size_enum { + __PAGE_SIZE = PAGE_SIZE +}; + struct bpf_prog *bpf_prog_alloc_no_stats(unsigned int size, gfp_t gfp_extra_flags) { gfp_t gfp_flags = bpf_memcg_flags(GFP_KERNEL | __GFP_ZERO | gfp_extra_flags); struct bpf_prog_aux *aux; struct bpf_prog *fp; - size = round_up(size, PAGE_SIZE); + size = round_up(size, __PAGE_SIZE); fp = __vmalloc(size, gfp_flags); if (fp == NULL) return NULL;