[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, 3 Jun 2025 13:31:22 +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=z5Suj4YHn9CkrIg05xjvAg9i480A2T2xjgAp6xK8iN0=; b=rBVzW6NzraKs4QW2YBFu7d9S4x+3naRPjXsaAeA2pTkdUo5oaCWig1StWaaY7Q9CUEYdiW6FjCDpRAKpGAPNFcWztSbQRUQ+azd0QDLwEC222Ky8PNc+wRu2mi+M5kIbQQwTzdaDNupClrBSBEP2oRbqkFRw1lU/yNk3hzGt94cXrxTKxa7wKhsPdGrS/nqpK26Yw9oMq1V8EK8tcTNR8UpxkoovATLyH+kod88uXQ+0z9LZWs0+eVGPwpAjG9Ieeg3DJQHFe9g5NLGLHDse8U6id1wh5ZKxlDhH/svLQ7A+Hcvx680UYlZ3h/sBc7LvKWz2z0WTo29e8Qg2mtjEXg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=w6Q2rjLTV+WP5iu2QiMXFVihjwzrxeevj10KBh/bo1kY1qinBZRh2gub1jhStmpZYR/q2fYN1vP8VU58HMyTaTuQ3MQx0+yOwJ2q/ufhGRZY79Ghox4/7hIlnMAhgfsP6gFVyv1fpwYuj7CxwYd2IY+iK4azJmkSzbOgyE427xa7YGrlrj46XiOppWr/W1xI+E9Ym+4FxFGhbsoK9fv5a8omD+QeTndoCzXuxrU/juClqQgxIDD8jcRuO8UPrWC0DxjqRbLTYm0y5C7SC6JJbOf2EH1gBnDWEcFFKSnYoUU2AQQPAPIKJR7we/0FOLEBMeF05g+FKZGv06GQb5TUQQ==
  • 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, 03 Jun 2025 13:31:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbz7CcYslTkZ61QEOdjKGC2c9BkrPvjG0AgAHrw4A=
  • Thread-topic: [PATCH v11 6/7] xen/arm: enable dom0 to use PCI devices with pci-passthrough=no

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].

>> --- a/xen/drivers/pci/physdev.c
>> +++ b/xen/drivers/pci/physdev.c
>> @@ -19,7 +19,7 @@ ret_t pci_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) 
>> arg)
>>           struct pci_dev_info pdev_info;
>>           nodeid_t node = NUMA_NO_NODE;
>>   
>> -        if ( !is_pci_passthrough_enabled() )
>> +        if ( !is_pci_passthrough_enabled() && !arch_pci_device_physdevop())
>>               return -EOPNOTSUPP;
>>   
>>           ret = -EFAULT;
>> @@ -57,7 +57,7 @@ ret_t pci_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) 
>> arg)
>>       case PHYSDEVOP_pci_device_remove: {
>>           struct physdev_pci_device dev;
>>   
>> -        if ( !is_pci_passthrough_enabled() )
>> +        if ( !is_pci_passthrough_enabled() && !arch_pci_device_physdevop())
>>               return -EOPNOTSUPP;
> 
> Nit (style): You're losing a relevant blank each.

I will update this, thanks.

> Jan

[1]: 
https://patchew.org/Xen/20240816110820.75672-1-Jiqian.Chen@xxxxxxx/20240816110820.75672-2-Jiqian.Chen@xxxxxxx/#1e0eee6c-0dcd-4ed4-970f-3d7e569cec09@xxxxxxxx

-- 
Mykyta

 


Rackspace

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