From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Andrea Righi" <arighi@nvidia.com>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Kumar Kartikeya Dwivedi" <memxor@gmail.com>
Cc: "Martin KaFai Lau" <martin.lau@linux.dev>,
"Song Liu" <song@kernel.org>,
"Yonghong Song" <yonghong.song@linux.dev>,
"Jiri Olsa" <jolsa@kernel.org>,
"Emil Tsalapatis" <emil@etsalapatis.com>,
"Ihor Solodrai" <ihor.solodrai@linux.dev>,
"John Fastabend" <john.fastabend@gmail.com>,
"Vishal Verma" <vishal.l.verma@intel.com>,
"Dave Jiang" <dave.jiang@intel.com>,
"Alison Schofield" <alison.schofield@intel.com>,
"Matthew Wilcox" <willy@infradead.org>, "Jan Kara" <jack@suse.cz>,
"Tejun Heo" <tj@kernel.org>, "David Vernet" <void@manifault.com>,
"Changwoo Min" <changwoo@igalia.com>,
"Josh Don" <joshdon@google.com>,
"Vineeth Pillai" <vineethrp@google.com>,
"Peilin Ye" <yepeilin@google.com>, "Zhi Wang" <zhiw@nvidia.com>,
"Lee Trager" <ltrager@nvidia.com>,
"Balbir Singh" <balbirs@nvidia.com>,
"Shameer Kolothum" <skolothumtho@nvidia.com>,
"Himadri Chhaya-Shailesh" <himadrics@protonmail.com>,
"NchangRoy" <royfru44@gmail.com>, <bpf@vger.kernel.org>,
<sched-ext@lists.linux.dev>, <nvdimm@lists.linux.dev>,
<linux-cxl@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/5] bpf: Let kernel code import pages into an arena
Date: Thu, 03 Dec 2026 04:25:33 +0000 [thread overview]
Message-ID: <DNAT9A6S0YM9.1SRZDRBWBSIAZ@gmail.com> (raw)
In-Reply-To: <20261202182648.2239421-4-arighi@nvidia.com>
On Wed Dec 2, 2026 at 6:23 PM UTC, Andrea Righi wrote:
> A paravirt transport, such as pvsched, can share guest memory with the
> host without a file: the guest registers ordinary pages with a device,
> and the host driver pins them. Such a driver needs to map the pages into
> an arena, and to revoke them synchronously when the guest detaches or
> the VM goes away, without waiting for BPF programs to free them.
>
> Add a kernel API around the imports of the arena:
>
> int bpf_arena_map_ext_pages(struct bpf_map *map, u64 addr,
> struct page **pages, u32 page_cnt,
> void (*release)(struct page **pages,
> u32 page_cnt, void *priv),
> void *priv);
> int bpf_arena_unmap_ext_pages(struct bpf_map *map, u64 addr,
> void *priv);
>
> The pages are mapped like the ones of a memfd and stay the caller's:
> the arena calls release once it no longer maps them, whether
> bpf_arena_unmap_ext_pages() revoked them, a BPF program freed them or
> the arena was destroyed. bpf_arena_unmap_ext_pages() returns after the
> release, so the caller can free the pages then. BPF accesses to revoked
> pages fault like the ones to free arena pages.
>
> Suggested-by: Vineeth Pillai <vineethrp@google.com>
> Signed-off-by: Andrea Righi <arighi@nvidia.com>
Only half of the patches reached bpf list.
In this shape is unreviewable.
pw-bot: cr
next prev parent reply other threads:[~2026-12-03 4:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 18:23 [PATCH v3 bpf-next 0/5] bpf: Import external " Andrea Righi
2026-12-02 18:23 ` [PATCH 1/5] dax: Declare inode_dax() in linux/dax.h Andrea Righi
2026-12-02 18:23 ` [PATCH 2/5] bpf: Allow importing memfd pages into an arena Andrea Righi
2026-12-02 18:23 ` [PATCH 3/5] bpf: Let kernel code import " Andrea Righi
2026-12-03 4:25 ` Alexei Starovoitov [this message]
2026-12-03 6:55 ` Andrea Righi
2026-12-03 7:51 ` Konstantin Ryabitsev
2026-12-02 18:23 ` [PATCH 4/5] bpf: Allow importing device-dax " Andrea Righi
2026-12-02 18:23 ` [PATCH 5/5] selftests/bpf: Test importing " Andrea Righi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DNAT9A6S0YM9.1SRZDRBWBSIAZ@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=alison.schofield@intel.com \
--cc=andrii@kernel.org \
--cc=arighi@nvidia.com \
--cc=ast@kernel.org \
--cc=balbirs@nvidia.com \
--cc=bpf@vger.kernel.org \
--cc=changwoo@igalia.com \
--cc=daniel@iogearbox.net \
--cc=dave.jiang@intel.com \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=himadrics@protonmail.com \
--cc=ihor.solodrai@linux.dev \
--cc=jack@suse.cz \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=joshdon@google.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ltrager@nvidia.com \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=nvdimm@lists.linux.dev \
--cc=royfru44@gmail.com \
--cc=sched-ext@lists.linux.dev \
--cc=skolothumtho@nvidia.com \
--cc=song@kernel.org \
--cc=tj@kernel.org \
--cc=vineethrp@google.com \
--cc=vishal.l.verma@intel.com \
--cc=void@manifault.com \
--cc=willy@infradead.org \
--cc=yepeilin@google.com \
--cc=yonghong.song@linux.dev \
--cc=zhiw@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®