[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v11 6/7] xen/arm: enable dom0 to use PCI devices with pci-passthrough=no


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Date: Tue, 1 Jul 2025 08:29:04 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HvjpZcPQJ0Yu0hV0QkbFDhF661JiCBxQYbHlE6AME+s=; b=QVM/QhB2vEGTjjplqpOVkaWtWcpp6kB4ARiB/pToxXozEPpmja5yXA+yQtwSbqa8nc1Z6yF6e9pZFm0xsmvyHh9UrHsEbCKOOn4Y16MasZbmoa+lN4ekUnNVWEcw5F3iC13rG5PBbXwaj0EAvcnERFPJtxY91A8nTmFV8DPOrx/X93zWl0WzuHOwqJLd9pIM2Hsb4qGwsJqVXMSrQJHlfNBth+zS7FJpkO8VKqtNfn6NYm4sZF2K8wK8pxT1E72rbwwhuvNbw+SqMgcn5MLR2a1Y496gnKfiUsMWxATKjNwsxV07hhLysItMh/hpQwWz/mJy3ZaHWO45D4jbzm8MGA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xvWpeWGhW/WRqnd32YnDV4SNjXJgqJn8fZYxY1Et7uubPVMUOzO2kbSB998NwCWP3Ayv0oUIOS1z4pIEI6+/ZKyfN2WQy5ctLb2tv5REULkED9GILB03zOOrE2yJjd2uSBxLakaC74z1pVHrc8na3su9CgZ30p3fbYFrsa9fCmSjGcGH/SS76xS7SvjPcS0EbxZSOhH3VenmC5Hb3uW9LDpRJFettmqvPRSKLsg1HgX0tuk2LBYYgIu1AF6WCo/PD7kcdhhQ9YhVlY+uI/xnG7IlT9rX5Xw93IeT0foqCdxKKB3fDWTc8Vco+INTaY3uG0x4O7kmVWmXiFzC3ZmelA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 01 Jul 2025 08:29:26 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbz7CcYslTkZ61QEOdjKGC2c9BkrPvjG0AgAHrw4CAARIwgIAqmqWA
  • Thread-topic: [PATCH v11 6/7] xen/arm: enable dom0 to use PCI devices with pci-passthrough=no

On 04.06.25 08:52, Jan Beulich wrote:
> On 03.06.2025 15:31, Mykyta Poturai wrote:
>> On 02.06.25 11:11, Jan Beulich wrote:
>>> On 28.05.2025 11:12, Mykyta Poturai wrote:
>>>> From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
>>>>
>>>> Enable the use of IOMMU + PCI in dom0 without having to specify
>>>> "pci-passthrough=yes". Due to possible platform specific dependencies
>>>> of the PCI host, we rely on dom0 to initialize it and perform
>>>> a PHYSDEVOP_pci_device_add/remove call to add each device to SMMU.
>>>> PHYSDEVOP_pci_device_reset is left untouched as it does not have the
>>>> pci_passthrough_enabled check.
>>>
>>> Just to re-raise the question here: Is this actually correct?
>>
>> I'm afraid I don't quite understand your concerns here.
>>
>> The purpose of this patch is to relax the pci_passthrough_enabled checks
>> and make PCI physdev ops work with passthrough disabled.
>> The reset op worked independently of PCI passthrough being on or off and
>> will continue to do so after this patch.
>> If your concerns are about the correctness of allowing reset to always
>> work, you specifically requested this behavior in the patches
>> implementing it here[1].
> 
> Right, yet even there I had already asked for possible differing opinions.
> Plus the case I had mentioned was specifically Dom0, which fits here.
> 
> Jan

So I've done some testing to see the actual behavior with different 
combinations of pci-passthrough and iommu switches. With passthrough=off 
and iommu=on the reset works fine. But with both of them off, it fails 
because PHYSDEVOP_pci_device_add is not adding anything and therefore 
pci_get_pdev can't find the pdev.

I am not sure which behavior would be the correct one here for 
passthrought=off and iommu=off.

1. Leave it as is, reset returns -ENODEV and pciback probe fails
2. Add the same check as in add/remove, reset will return -EOPNOTSUPP 
and pciback probe will also fail
3. Add the same check as in add/remove but return 0 so pciback can probe 
the device.

Maybe you have some thoughts on this. I can't come up with an actual 
good reason for using pciback without pci-passthrough enabled, outside 
of maybe "not breaking some abstract scripts". And EOPNOTSUPP seems more 
descriptive than ENODEV so I strive towards option 2 if everyone okay 
with that.


-- 
Mykyta

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.