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

Re: [PATCH v9 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, 28 Apr 2025 08:21: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=kLFjJXWNZROyJttk8awDXM7dPrlSy432qPpUh0s+Av8=; b=ZR5Ao6OoOg4RpQUnfAntFCh0ksVxB/n5HxmKvzJB8vrb7gUmRo9VKRwvuIZtXo32eG9rAT7ZqhP94Pd5dZ9g3cfNS8wb3d6kTfhw7WZhGOYGbjh0RClWCm0iI12mpf0u+LdlE0A4MYcwgGjgDqP85N6lwZUF6/oSI9OXSF6LdqV2UuBFsxIohhDj46UWc3VGIowgHDtgoHNArq9F2Gr52CBXDW7LUeKxAL4zt80VC/U/EqVGZHB6on2kdfviBmgip3vfgcnNDLhb+QHoEK1nJij6Y6fbDsfqIylYSwknKcKQ8v0jzcXhPDdDuQhVJozUPwXWxbdrZKjVrIfD2ppmuw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nnwkVUTh3CdmJqem8fCowdYhXL7OWFY+fsD/9an+K1jsvJvrjljMsjo1jO3JYTDfkFXADiXjWI6jltVxASk0qH132MN3mDQrLzlu4GfTC76gNO5+jP5RlfpVY8OpPHCN3QYq3bysTUmfK9zkwAFlmS89RUlg0dge0Kux1UIs8kU2BNQkWUgPSOcSoBVEnE0xJ/QJnjmSz1jTJb0NfYObita430GavBnbf2/zHBV5onNfLvbn2mvAWhPbrnbITmFZrILzNzk/QPH4O6x45CtYjX17g6PGHqxbEPNjO0y3gRFX8E8L3JUGG3swKAx2X31/GgqqH5OcU2b6hvDfYDK2bw==
  • 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, 28 Apr 2025 08:21:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHblOXdxbIbbkNtn0WSg/9tW2OJ47N3cuWAgEGQWoA=
  • Thread-topic: [PATCH v9 7/8] xen/arm: enable dom0 to use PCI devices with pci-passthrough=no

On 17.03.25 17:07, Jan Beulich wrote:
> On 14.03.2025 14:34, Mykyta Poturai wrote:
>> --- a/xen/arch/arm/pci/pci.c
>> +++ b/xen/arch/arm/pci/pci.c
>> @@ -16,9 +16,18 @@
>>   #include <xen/device_tree.h>
>>   #include <xen/errno.h>
>>   #include <xen/init.h>
>> +#include <xen/iommu.h>
>>   #include <xen/param.h>
>>   #include <xen/pci.h>
>>   
>> +bool is_pci_passthrough_enabled(bool dom0)
>> +{
>> +    if ( dom0 )
>> +        return pci_passthrough_enabled || iommu_enabled;
> 
> As I think I said before - the function's name now no longer expresses
> what it really checks. That (imo heavily) misleading at the use sites
> of this function.

Hi Jan,

I've spent some more time thinking about how to better deal with this. 
In the end, I think your earlier suggestion about introducing a new arch 
specific function is the best approach, but I want to agree on the 
naming before sending new patches. Would "arch_requires_pci_physdev" be 
an appropriate name in your opinion?

At the call sites it will look like this:
     case PHYSDEVOP_pci_device_remove: {
         struct physdev_pci_device dev;

         if ( !is_pci_passthrough_enabled() && !arch_requires_pci_physdev())
             return -EOPNOTSUPP;


-- 
Mykyta

 


Rackspace

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