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

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


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Date: Mon, 10 Feb 2025 11:28:09 +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=D15s4DLiCejc2myi4G4QxxlccMQq5M4BZnMlsG/0ibE=; b=F/WJ//NSTo9bKkbUN4MJMFlXD0tikLbRTy2pztgISPigApzww6ZEjcY802q8irWWc9gDK90ZDC4hUFNo0S35Z7uEzNJTupBNvz8obTbg1F2oxXgeWfhPBZgV9A3Kn7dFkZhK0mTCtTpXEj6isUOvu6zO6tQgp+bVQ1EKAnLkG7HGN1+p397ZjqxEDNJUZReWt27Matfggb0fLNt9PTH9SgBOy81VhY/0H6ULC5z+jZT5coWGQ4pK8/aVVcnWhhobMUsvbWV4wFp4LQDarJtHgwB9ic7sjQyMa3FyhMPMPdC1FzeLqvfwxecU1b8G1n6WkQJBbtZidcsDvLeDbaiqiw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mQgWVqcxKlG6iJ5962Qs9Mffg5dId9N+2H1oZta5WC0yQxi9vFC9unmJL9zcElHeCW0k3XteyHAvCdKw4FHYDqLwMZ+PXleCeFJq/vXJtu7jYIQR4AVRbRJ5sZqv4Qt5JaLN1wCylkBTWsoPSzVp6srRuUnsxWyh4mXo9d0YJGf4TLmG4kgYqVVkIi9dLA3ng5SKFZ17BO4GOO8armV2DIhP1U66PhRVOS6s8jyAEiMkGHktsfObhDhqoDsy9vww/+AHriObk0p20mNtGOoV5RcMP4DoQcyKYs9yGcGK+RhYlNv8mtL2RW5hKCnV7KzojKOax1vIzJyTIGjfvX4UXg==
  • 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: Mon, 10 Feb 2025 11:28:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbe6bYLRtr9CeUhUS7u7CeNu5b3bNAXZuAgAAIzgA=
  • Thread-topic: [PATCH v8 7/8] xen/arm: enable dom0 to use PCI devices with pci-passthrough=no

On 10.02.25 12:56, Jan Beulich wrote:
> On 10.02.2025 11:30, Mykyta Poturai wrote:
>> From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
>>
>> Enable the use of IOMMU + PCI in dom0 without having to specify
>> "pci-passthrough=yes".
> 
> Why? It _is_ passing through, even if Dom0 is special.

Do you think it would be better to drop this completely and require
pci-passthrough=yes for PCI to work in Dom0?

> 
>> @@ -83,9 +84,9 @@ static int __init pci_init(void)
>>   {
>>       /*
>>        * Enable PCI passthrough when has been enabled explicitly
>> -     * (pci-passthrough=on).
>> +     * (pci-passthrough=on) or IOMMU is present and enabled.
>>        */
>> -    if ( !pci_passthrough_enabled )
>> +    if ( !is_pci_passthrough_enabled() && !iommu_enabled )
>>           return 0;
> 
> I can't reasonably judge on this adjustment, but ...
> 
>> --- 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() && !iommu_enabled )
>>               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() && !iommu_enabled )
>>               return -EOPNOTSUPP;
>>   
>>           ret = -EFAULT;
> 
> ... these two certainly look wrong to be made. If an Arm-specific adjustment
> is needed (and can be justified), a per-arch hook may need introducing.

This should not affect x86 in any way if I'm not missing something, as
!is_pci_passthrough_enabled() will always be false. Or are you concerned 
about something else?

> 
> Jan

-- 
Mykyta

 


Rackspace

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