From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.174 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796271935; b=iEOv3+Ov87nyxW8ZSgmJZBZSRGuwGKUB8KNvDRGzzY6IhdOzbKj/fFMlOJlAgDmtE0nv Fu5vB9J8XOrBvCOY/QRCgF/6MMr2d5HPf6pbaQbL+7fROqoo3iboGsrI1nEHcuxDXsQJY FHT+u+l+TEZcPbvWNvMmvGpPTaBYZHa3ZftnSXluydZacD+9kOYvA5xzluC22/8ylUw6S 8dgzRj6pOiVTTgIKXYtSw+AzAbtGVwPfSqu+VrPWPvfSr3Bi/KnKLU+aA4ZK3P0xysLY7 Fo72CBRKSScrSIs0bKIHsGvqQ+3Qd6WfyaEDcS2swvJwZiudAa6O6SIAuR96tlbAXZA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796271935; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Mime-Version:Content-Transfer-Encoding:Content-Type:Date:Message-Id: To:Cc:Subject:From:X-Mailer:References:In-Reply-To; bh=2tiBGhEtzYyObLM8lw5atJDcluDceXStPZEpBW1Ee78=; b=x9j98qxZkf0/eofwHx8CsdAWkwOPtEmukaf8qmeqN0WxKcvtb+4IyLaL8hodILb4Seeq qiDFvLtL1AkreRM5gcjnAyIEyqRRy+l0fpwA6H2/RUpQxYq5CkUZEe6AzSTXBx3/J0buI xj6rDEOd4kSSwkuWY5x2mWjuaCjk9D8isSc7Dnj/GCYvC3N31DcCtTRNh+ao8aldxWwzp 5Ds4E3aLxalw2Pmg0COn6boJdPBTTbUx9Jv8B8fVoHxPWgIG7J0hwwmkme6npZjlywK5q 3ka1tVxeW9j58k2P5xkPfFEa2TyPXJESaGIevoRY/yfcZeTG71oHFsIVcM3FIRNmOSQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=XVBvMsGr; arc=none smtp.remote-ip=209.85.215.174 Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85656606A332 for ; Thu, 3 Dec 2026 04:25:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 85656606A332 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=XVBvMsGr Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-cd61cef87f1so6972199a12.0 for ; Wed, 02 Dec 2026 20:25:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796271935; x=1796876735; darn=vger.kernel.org; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-type:content-transfer-encoding:mime-version:from:to:cc :subject:date:message-id:reply-to:content-type; bh=2tiBGhEtzYyObLM8lw5atJDcluDceXStPZEpBW1Ee78=; b=XVBvMsGr5CE+Cq9f1HeJ7APfqOOSgLQ2652AxZmCzjXkuQZNFVwGMVCvD7H08Iq+OM ly3rakDe6wYx6HGbBjVIER0TTbKBdmA3RYtLePNeNEPn+Sqat0chjWwx0bn7NhIL5gvY SbiLijQ0ZIPtHHMA1laJx0liu+jro9WoeUzU168edTI2zgmwHDmi2AhbI9G5E+PEcy58 Mnbevx0g91PU/g2tgh+GvYoywuKh6DS+Z2V7WHoomIQfHzV2baY3Z12rtDe0gdpvbDIK r8ZzRzQUkmjp9E8xM/Y4iooYvZZnFZcylXOjflLHs+C2XGw5JX8dkGuQa7a7mp/OPUvw JJ0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796271935; x=1796876735; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-type:content-transfer-encoding:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=2tiBGhEtzYyObLM8lw5atJDcluDceXStPZEpBW1Ee78=; b=TZm+mi/z4fbPyuNwXvMLDHQ1Xfhl/bTk4gIb7YPrhCRebLn/n34V7v2F6+cnKTQ+pM jfhYNIhtEESEJoaG2cX6LMVQ34Ly5SiJn8IS5M4UGO3LK/z6DQn+Vv+y/L7PdJ1VDl2c N6eMm2ZBa8RAKnpt1mAQdIWaEj2HnV2B8NVT3dyvepOwO5+TyhiNRe/7vm4XnxjBo7vK M9ennoJVvZ82F/6ee56HckvGEyQN0fZ6Pmyzq9t0fzPsR1s2dGpK8nSVbwYBj2wcIU9G VZQ9Jh3MULnPGTJpU4OBqPYkPc9noVagqOh2jZyyYaf5WfCfsrDmPwGhqiw14orWOo1r fDOA== X-Forwarded-Encrypted: i=1; AL+hErHguuQ3SCTpzrKZBP3YExE3HTJc7pTUaTaVOxN2qebmupaZoV8p1VCPeBInS9ow+jxZSUSZomPbIFnNMH8=@vger.kernel.org X-Gm-Message-State: APuU4Z8eNMKbk8KncA9W0vzV61VT7Cpj6ksr6fRTH45iTd/WluB224Q5 QudDAU6sKGzi+7ElOh1m8SPn5yllSI6ikZE52kymTzQiaQLDDsiIzmCU X-Gm-Gg: AZFdTZcRelBf0DRiVCfpxM5kc0uFNVAJC+uG+qIPFxF05FkYwVw6MsQsK1cwnkznZnY y/NbEKRw1PxdQGoQryDitAghXbT6sCUJ8uleR/rAaaSD388sKUbEPO6O18MlVfLWmIJS/dd50+M CTaVV2efInv1mZ/I0XV5G2ySGcR3KLp0mrXxU/NW+PRoQmKPMJcecV8j/KYv+v/pe0HvsAm3/D7 wTXCTdEay/7hOJvw8eqO5IIzyAQgS3AsGGH0kezgvgLB6sfdYFvHLZRt6PZqvqYLPj4waSErNIu 9k+nXiiXFzmc0XANkeXxuYTlfwULt9NGiHIRiGhcs2M9kzfF0NV1YSk0hNYN+1JVAnLzD6RbTeE /a9VwccPQGp9lhs3C46bSfWFvdIZ5dO2KIWAuUl24hl08XPnQo5IUuxhlRpS8TtZl2sE/4B8Jo1 HtdeM9EeZ3bKGx29xgtNij92zSAv/t59zDEo4aisOtLxHhfDGa3KzuvkrHPG1Xk78nlLxPme4Fs 5T0OgU8SlBUF9QbGklEhpd29etPWIjkEjVashMXr+weUYh3VoWxhvgMTECXHnJe81vQ8Yubm1FB 23N8V/QrndfrarODk56JWzF78k0yiwLeh0l3PKeZmo6RCqppX2UvwKYPuL9cOsliYDmowUUqKx+ dFzJ5H3/V8WLzfytjuyr3iuKwO2h5f/bcrg== X-Received: by 2002:a05:6300:8811:b0:3f9:b4c0:d3bc with SMTP id adf61e73a8af0-4014c94a9dbmr43314658637.24.1796271934572; Wed, 02 Dec 2026 20:25:34 -0800 (PST) Received: from localhost ([153.61.198.241]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c87285c219sm23052944b3a.18.2026.12.02.20.25.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2026 20:25:34 -0800 (PST) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 03 Dec 2026 04:25:33 +0000 Message-Id: To: "Andrea Righi" , "Alexei Starovoitov" , "Daniel Borkmann" , "Andrii Nakryiko" , "Eduard Zingerman" , "Kumar Kartikeya Dwivedi" Cc: "Martin KaFai Lau" , "Song Liu" , "Yonghong Song" , "Jiri Olsa" , "Emil Tsalapatis" , "Ihor Solodrai" , "John Fastabend" , "Vishal Verma" , "Dave Jiang" , "Alison Schofield" , "Matthew Wilcox" , "Jan Kara" , "Tejun Heo" , "David Vernet" , "Changwoo Min" , "Josh Don" , "Vineeth Pillai" , "Peilin Ye" , "Zhi Wang" , "Lee Trager" , "Balbir Singh" , "Shameer Kolothum" , "Himadri Chhaya-Shailesh" , "NchangRoy" , , , , , , Subject: Re: [PATCH 3/5] bpf: Let kernel code import pages into an arena From: "Alexei Starovoitov" X-Mailer: aerc 0.20.1-357-ga8fcb8d99360 References: <20261202182648.2239421-1-arighi@nvidia.com> <20261202182648.2239421-4-arighi@nvidia.com> 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 > Signed-off-by: Andrea Righi Only half of the patches reached bpf list. In this shape is unreviewable. pw-bot: cr