Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.178 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796271935; b=3eTFkmbnqToiT27YLy41VeVQcsg6ggoZBE1wB++s1xUhgD4NkD3s5LzSfxRtJui3NSbL Sq/alT5VaFCXBhAzOgHyRkk7ARxCCLFP9Ydm1z5qR1lPIEnekhvdKFOpvzFFNiaiaybMF tE/9CgjDkbIvI47HXFHaNs8JhSVruz5V86nhe4R7SoC4Ybodf/Q2GhvYM/6iscRULAkf9 kRwLdxsQPEo207/AVzJ8+c+xa1quSLmgOIxfehg+1MMKgSMdHCUxUAh9Syw4C6m5xZyaD fQqWDJXpFFhUWS4emxR1jgnUGbgzyk5Gg6zBAS5Z2sMzFKzVlOd62PCmRtzQYltWdRw== 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=Mi1S47hv4ucIX9EdqAftl2SZJfR3mW80URGK6p395tA2/k6iWPBJqiGLnWfqPL+8s+Oo ej8Zf8qhnalU4a6Ky4BCwMO6oBR68qX15yj9IBwbgKbbYlXtRSfVWpaH/UmNNcnmouBtS 1AtNRS64RpkItRgPbcFT+pKpoQIFDsWY8yajtZcqFb9zHHKXjZzYBZA32CfF81iecfXUE P1ETnXBOLSuycxSRxxbDlcXo9ez45Kpb/tRprlEkmLPxIebTqeOqlMRrs+p32dUY9Mxgi npDlnBfc8S2S7H03sz7gJ3i5l2nNETIyUQBqReHC0Z7l7LB18/mjuw+sqcv0S1BQ/mQ== 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.178 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (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 7B54F606A32F for ; Thu, 3 Dec 2026 04:25:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7B54F606A32F 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-f178.google.com with SMTP id 41be03b00d2f7-cde0daf3a2aso6081332a12.3 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=Gmvf7vxPjZiJ/jkWgFJIB01kI4+P7o7fy1/SaaVgi53m1ghCJFmkNnEFh5345iovjQ Z+YFEiJ1NEzcechi0PUvC/0AeMclOCt3VMgfyHbXlt6h65evFwJr7aSc5cRRhq05JMeH Z9OqS8NSxAmojLSuGp+dZicVfJ1JnXfvHUYKBQe1iCjv7l1KBarMBtO7bd3JA/CJs+qd IM1uyJ+1OjXVWvZ6bgOmfnPv8veWT7PlO2JOuFpFtyw9ppT4oeBrewRmAaSs4tZQFhk/ 7ORr8S+xQ6VBc3H0XT4O3ONgHWa7RGU85H+Qzrfvv3NlXM0iP1tGJTxO+LSfwqJC6kQF KYTA== X-Forwarded-Encrypted: i=1; AL+hErE9qr7iNQYSnihia3rsaEXga5lRrUUn3MTqXUJ/gvwCsLo16+xaVtE+kJz73sdLmnSP9kI=@vger.kernel.org X-Gm-Message-State: APuU4Z+Q89aDZyvu8yQC3cdHTPg+suQnNKHz3I5TCSZaJUX+++6R3Oma rJ1Ibvgk3KI4FEAoccHT4++xzMLpmGs4EgxNxozeG5w9od/AFtx9gIpn X-Gm-Gg: AZFdTZckiZOjGCHlVkjU08idKqnmHvwjw1w6PAtOsUcewURWIatuZdiu5JJ4A8/L8Qm IogJlhu5qN3pk3AXNjx+I6YdEULgp0FUiCxz3Hrk41Uz8dwPdWfPCoBZJx10YlSg+UKfgTZISP6 Ym04EAU9/zX1lYF3U720qQOwF3pa6jDYEmmBuYUxWmjCOXUANLtLHOdmeLfpjCOG5KatbIQ7I0o nMTjA0Rgpz2gKOs+LgxQgQ4r6QgfcCobfaPhfHjMJFfAUmycKGQkQbTp8lthblQpzYFnJzxkdqA kUA0S3vITdb6O7MG1LeYmdwPt01ajquVVI3rYLOFy3oGL08sPARNgeKHhA4s4whYETcSAR8wOLj fOupRkKYVqiE2YnOnfhT1+DodWW53J488ju7CCsvIvkib34j0bsK1P49qbcj61abQL7NN74JwxJ zcJXEZO2m/XP7AKiJtEIEIOHbrWmBfCfc7M8j2Ol/D8x9rnSphBhkC6hxsEs8n5jwoz4/5bupNz a3l0iXm3OeDWiY6sumL1P5seYsjWLhxYrUuoH0/2ZNxlBvrJAEjI1siQSKPO/eQ1ktqVAgG6iij SZZsg0pK1LF+oCb/SFcWoUiGPb95ibFQFZ9P2t1kE7hR+co6JtcHG3k9cb+hIK8rykctLJfEOZn DU8xrzjLDnOOUgMSrsC/c8cK9eOSU4ASS2A== 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: bpf@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