Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 56C84E99053 for ; Fri, 10 Apr 2026 08:16:55 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1278451.1563275 (Exim 4.92) (envelope-from ) id 1wB72Q-0002mu-LI; Fri, 10 Apr 2026 08:16:26 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1278451.1563275; Fri, 10 Apr 2026 08:16:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wB72Q-0002mn-IJ; Fri, 10 Apr 2026 08:16:26 +0000 Received: by outflank-mailman (input) for mailman id 1278451; Fri, 10 Apr 2026 08:16:25 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wB72P-0002mR-8q for xen-devel@lists.xenproject.org; Fri, 10 Apr 2026 08:16:25 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wB72O-00EoTW-Ky for xen-devel@lists.xenproject.org; Fri, 10 Apr 2026 10:16:24 +0200 Received: from [10.42.69.2] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69d8b1cc-e002-0a2a0a5209dd-0a2a4502d3be-44 for ; Fri, 10 Apr 2026 10:16:24 +0200 Received: from [198.2.187.14] (helo=mail187-14.suw11.mandrillapp.com) by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.0) (envelope-from ) id 69d8b1d7-42fa-0a2a45020019-c602bb0e96fa-3 for ; Fri, 10 Apr 2026 10:16:24 +0200 Received: from pmta09.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1]) by mail187-14.suw11.mandrillapp.com (Mailchimp) with ESMTP id 4fsV4l0BDGz8XS3yB for ; Fri, 10 Apr 2026 08:16:23 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id 5a7d847fa67b46e4afbeb5fbdefc1df7; Fri, 10 Apr 2026 08:16:22 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mte1 header.d=mandrillapp.com header.i="@mandrillapp.com" header.h="From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:Date:MIME-Version:Content-Type:Content-Transfer-Encoding"; dkim=pass header.s=mte1 header.d=vates.tech header.i="thierry.escande@vates.tech" header.h="From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:Date:MIME-Version:Content-Type:Content-Transfer-Encoding" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1775808983; x=1776078983; bh=ONfxNDiXYC98hlXu/atW+mLoY8BTnDa/ULY8H6DvHW0=; h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=VOv7EPHi8MaWZkoFyDFlMhlUABQGxvolujowi0c2XmN+BcZjr+kdj83+vyYhW2J8/ A0jg8JceNyvTDrhtuOlz/LG4scLt/uk6eJO/MjoKWIeeyyp86tSbAaCzUsI2K2lzNw XEiu7Gf/4HUGRlj+w6pFK1ImapK5n3w6N2kRN//0Kz/1DmlKfK0dRPbSbJkiUyRwXG 4gAXb4p+HUKz8Ih8a+IrWoIpXZ2OYsS4DW/prnas6+VgmAnyOdV4XCypefGxArwff1 7SdYUI+pNrC87FYV5Iufkbuhmx3ZXXJ9TuZ5K3h1pLJ3t8Rrd3d0KISBSwsPXG6Ihl k1dQLshfpM56g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1775808983; x=1776069483; i=thierry.escande@vates.tech; bh=ONfxNDiXYC98hlXu/atW+mLoY8BTnDa/ULY8H6DvHW0=; h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=OTErO7Cv8b/R/QK1XJPs3PPPX4Rnl6L+1ngLhVZWNuVDFm7nBsnEjSYrqtT57A84W mPvQBcYVcEh1EvGHRmussML2YQCTdbmsVA5hlW2y8EvTdhvbIJSzToXJdUNFJcH7Ak a/ZYjwXGeJhJR+FNcQkGlzTgpdJwahP92IDjHssCFmjOomzXrREmotz3Es5HAtK5Y6 vvxyv9KGmsZChRIDRd5TpA7irxIqSApengCu3fQLQqPpzyQDKtcVSdCXWsejOO7d4I /MV1ONsBkR8oy/k9tmpI+y4D5HWRHYSFM2FIWza3/Tu482VMjIKREBnuCUmP4wPwQx bKDn9plJEzWKg== From: "Thierry Escande" Subject: =?utf-8?Q?Re:=20[RFC=20PATCH=20v2=200/3]=20xl:=20Allow=20PCI=20devices=20to=20be=20passthrough'd=20via=20Qemu=20command=20line?= X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1775808981974 Message-Id: To: "=?utf-8?Q?Marek=20Marczykowski-G=C3=B3recki?=" Cc: xen-devel@lists.xenproject.org, "Anthony PERARD" , "Juergen Gross" , "=?utf-8?Q?Daniel=20P.=20Berrang=C3=A9?=" References: <20260409162000.1102680-1-thierry.escande@vates.tech> In-Reply-To: X-Native-Encoded: 1 X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.5a7d847fa67b46e4afbeb5fbdefc1df7?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20260410:md Date: Fri, 10 Apr 2026 08:16:22 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-720697/1775808984-AE33BCD1-C5EB6E18/0/0 X-purgate-type: clean X-purgate-size: 2310 On 4/10/26 02:55, Marek Marczykowski-G=C3=B3recki wrote: > On Thu, Apr 09, 2026 at 04:20:57PM +0000, Thierry Escande wrote: >> This series adds support for a new 'hotplug' option for PCI devices to b= e >> passthrough'd to guests. >> >> The current mechanism for device passthrough uses QMP device_add command >> to hot-plug PCI devices to the guest Qemu instance. This is an issue for >> guests running on Q35 chipset (preliminary support posted at [1]) since = the >> Q35 PCI root bus does not support hotplug. Devices could be hotplugged t= o >> a secondary PCI bus but Xen only support 1 PCI bus for now. >> >> The 'hotplug' option allows to control how devices are attached to the >> guest, either by using the legacy QMP mechanism (this is the default) or= by >> passing it directly to the Qemu command line using xen-pci-passthrough >> device. >> >> Example usage in cfg file: >> pci =3D [ "00:03.0,seize=3D1,hotplug=3D0" ] >> >> Since Qemu -device option accepts parameters in json format, this >> patchset adds a new internal function libxl__device_pci_get_qmp_json() t= hat >> generates the device json object used for both QMP hotplug and command l= ine >> passing. >> Also, the function libxl_pci_assignable() is made available from libxl.h >> for access in libxl_dm.c. I don't know if it's ok to make it public or i= f >> it should stay private. Maybe it should be renamed as >> libxl_device_pci_assignable() to match the other PCI device APIs. >> >> This has been successfully tested on Xen 4.22-dev and Qemu 10.0 running >> Debian VMs in both Bios and UEFI mode with a passthrough'd nvme disk. >> Disabling the hotplug mechanism might be made mandatory for Q35 machines >> later, once Q35 support is merged upstream. >> >> [1] https://lore.kernel.org/xen-devel/20260313163455.790692-1-thierry.es= cande@vates.tech/ > > I don't see relevant device option added to the QEMU cmdline: > https://gitlab.com/xen-project/people/marmarek/xen/-/jobs/13860278916 > My bad. The code that adds the -device option is not in the correct code block. (bad copy/paste at some point I guess...). v3 on its way. Regards, Thierry -- Thierry Escande | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech