From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.181 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796271935; b=K7BZEh5L8XTiLB+FrBshn9U3YuWdsM2ommNfCeJm8hDQq/QXuBitlHYajSCoZIgw9iwM JsOc+9KZIrjPIuXFI6vVE7Pd0sMJcmwUOpCVk1ntWMZaOB+E0Z4ypU/QcfX+bxL3sLb9s +ZQzCXv3HVBt4cUQ1PtNYWZYaDgLU4oivrAH7K6P8nF2TQfkjwTWDczoEqb4gO6o3lacq udBLCHTqkLkb6BP+DLmx/vpORHBK+eGdr6d+LSAZ8WFtKTxoPYlh+wD8bNyfKW/suQ4G5 jiYqKNU4qEv71a3MXGjKHuc9lddiq6r+mMxJkVkz/ZskbjQtqFiGHMvm/VXEsTmnXYg== 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=sxm9pllfX71tRjwssbrOq48UWMCMVgUeQhXiDB5xJo4aGkjwQyEjQGbKa68qx3ujwG+1 K0C0Ksl95ZsBPC1Sch1cXyIiCs+Nr7LfIG86aCMy+7bD+HE3ZT0jmWbNSiLkUDd6TlFdU 2Cg8pyFUuFGbD8mLNjogY6l7KjQ3kEjL7lco95EBYq/EvfQEygGb0S/iO6YqgqqrO0517 u6yjqyoNPbyeqThOZPhNF9gdCJMYLofid1e40Q24o/xEmkb5556mNQbV+FJYK+D7mzyzi BhykhgTNDOJiFCyxVocfjaHT+6MbG70jNv+Ahu9T5bLv67VX9KdF2rK40zqid3hwFSg== 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=AQKM0pKn; arc=none smtp.remote-ip=209.85.215.181 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (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 7B98C606A330 for ; Thu, 3 Dec 2026 04:25:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7B98C606A330 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=AQKM0pKn Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-cdebab6fdb3so3647855a12.2 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=lists.linux.dev; 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=AQKM0pKnlH0fhhCbvFdcT0olFdJSJB1EPxMBL3ojJ3NagiLcPdwXuvBf0rQVYV9BCJ V9+NhzWIb5eKGcTffLc5p3nrZoWW90YDrf6auvz6iOa6FgM8O+NmIu0QTXfbChkbk7cw M+ozMVPikZ5ng7Y8YzUQAVh66zn7E2KkmjqLdX0KoTvumCJQZ4EtQsSg1g/+P0RP7oLM lSlnFrz5aM+gwszgedFuIcWbDvZukYCPhxLQaV3haRIMJlBgT450cuybohpfsTRLQjoB uNJRyK3P0NlPMuRkqOocy1d54yMkNvVytqqba4WL5zjmgeQEKmIbZqfH0OC2I5gtxADE AIOA== 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=Tw3SugBJBc4I3DE02aSXpPNCNhlO/LfTsvSoSXP0FgjAaXD/7CHSVjo2mi9AfXfnjr +tJwqcFLi1GksA21r9bUgkFzRRhhJcwatrBrCmoBRBifLjarDeV4RFoHZZmNFSKJ2W17 fjzhHnxWlpfx4bRRgcQlqfSO75kcgC5WbWKtROEfb6PyhlZxzOMPL2+Iis3dxdbu+DbC 4MIX4fN+bebkE/Jw99C9n2qZ/kSKxdyE3+hkcJrfyyPxi0rjprYVEwpGWZJeYUQLeVc3 dwMWejIdQOfty0nmZHtaJZ/WW33gyjejkG/H1t70Wn4CIaEVMV6noRMrxztUqn3ZLiYh 4+BQ== X-Forwarded-Encrypted: i=1; AL+hErG7rW87I+xL/TYQDdv9Tb0QTLFs8UZRIQ/LnQMYvOBaR0ppLkE69ACyBhkughDeplLTV7YKxPtS/Xk=@lists.linux.dev X-Gm-Message-State: APuU4Z/0vE3WI3wYaAofF+/ovVd7nLYC8+Q6wyumBtGOYHcwQ6iTIZaM mjSuO24MEMlIFCnSNFEbcgwBuIVzjluWblOe75qEUUwi7ar0X7d9Tz+d X-Gm-Gg: AZFdTZcxTKvLkQ/Z7jvNEJ8X/bUM4XwyOepT485nMm2v2YPld4Jj4gX/oDDrvW1696R bhZ3ti4doInT71pLY5QlN/l6OPEVo5QOK3uBmiPJd25hjgwg2K9xobLc0yf2lephNnlbxisiA8e N6PJttcWpoLvrGFWA/bQFCh/eYA4lg5oZr4YHohLnczk8WjBKRx3hAuCukbCsNGHvuCDEofMBjY jaREQiECS31nt7hYCXUFzjRk6lCycx+COUGdN2s7PeA6U3CAu/OGK60/FtG4p0KH68JevXL7zKe gTxm4r8jTpksvTLTTGE+7EkdMRfC6TrKQcsoHQ9E60uXyPS3TLRgK6UQUl44nCaNdOhMbAL3bCN Tp0rwTMlS+rjTTiit+xrcvvfeA3ouIQy7WEl9auPGPN+ZnxfI/zKmzOrLXHQV2rJAVRVGS2t2XP Bkhmw0LaLd4eVuyEc7HhoBEFfKX1zybcIJyOWkSqhHZoKxCipQZH1E8xeHBTJ0byQVcfv/JhxuC aXOvdvJmvql3VjZHQdCjHaEATz1kls7VclxP9m2mKGw9IQf9mUC9n9LWwBDcCuhlwcfUMnkAFEK 3EL/VOR+zPpOR/Z9l4V5Cww+WFQOROs/1KSb7v5HOqOZUSi8mf8xWpLo73+YXisVFwYA5mRJnvH 6tWSZ7W9KwIOGWzHrpg8MiUcat6eVmt/4NA== 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: sched-ext@lists.linux.dev 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