[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 11:26:36 +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=oWTZUHTUNSksE3Mi3uAag9yO7rRK5QRgVVSak58N4lE=; b=IWF7aRJCokG60oroNN5g9HrBQGxQ/bRFzW43OZs95tXQZubnB/BZbutXSEoGN1fyt4MKH/mnOdGAHImmFs3ms1vFeWWh2qzYGIpOnCMO4gQH+GIwA8hygOtXR24UWbTSDKEqfkFlkKRWMAh8jCV0woplgiy5o578XvpgDeAUaG1XsAPgHASFc76I9vF9s9hf821RIib/o2VcMqsUyYk0GfV2zC3gIgqVSyjeXOx9y/dd1SemIBM5LJm2RXmrBCQGXzBjOjRBPeqraUj3y/xCUiu7D0wFIDX8U+Db4g+eNlO3MM6tfbPDWHzk+iNfOpKOjlGy7YDeKH8ikZz/taxERA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GTzdWJg+X4OmxfAyAhHyLFmjZqwNP8Y2QDdLMHgteQuua+vNEttX8WBYvfrO5YcZWRCpSZRSh1D4/M1ZJg2F2SUBxVmEcDS0Su+S+woLrgR2vWj6VHDAR04rE3vi+YwmRlkjalvt856fEG3uiL1vzOjeq8W9rLkTzATxudiJj/SInyNMUFEPfItD2NWJ5m6SHd9qVXMGV5NN7eFslH4ETHx28Oe8lrcP/tLmtqzxzDeokx3IEPM9KvJmKLZQyABMjH9lyGOCK1zl9NWwcDb9bvd6tIAHHDz3lvdW5Qwd4t+A4nCO4d5v+SpA+VT9hppVfDAQRB6PId/Bl/ZIqbjrRw==
  • 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 11:26:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHblOXdxbIbbkNtn0WSg/9tW2OJ47N3cuWAgEGQWoCAAAswgIAAKJGA
  • Thread-topic: [PATCH v9 7/8] xen/arm: enable dom0 to use PCI devices with pci-passthrough=no

On 28.04.25 12:01, Jan Beulich wrote:
> On 28.04.2025 10:21, Mykyta Poturai wrote:
>> 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.
>>
>> 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;
> 
> There are several questions that affect naming: Is it really "requires"? Is
> it really all PCI-related physdevops? Is the ordering of naming elements in
> line with what we use elsewhere (arch_ first is, but perhaps either pci or
> physdevop wants to move earlier)?
> 
> Jan

I understand the issue with the ordering, will 
"arch_pci_requires_physdev_ops" or "arch_physdev_pci_update_required" be 
better? Regarding the specific ops, only add/remove are needed, but I am 
not sure how to elegantly encode this in the name. Maybe you can suggest 
something better if you have something specific in mind?

-- 
Mykyta

 


Rackspace

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