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

Re: [PATCH v3 3/6] iommu/arm: Introduce iommu_add_dt_pci_sideband_ids API


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Fri, 19 May 2023 10:26:51 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=DHZSfXl2P/H9/KuFs7UN6kolQMT57tk4g/AQSqax9O4=; b=lxGN+Cutf4KSGOpPHwRzR6nu+hPPuRn07AUUBHKLYchYuNPjT/hwUigBZZzSm0Yft62iVl1HfRxmDioVx7ozW6aEYShUEs96wvwunmvCU6+ww2rQOCalgpAHq16vcQhiSYq0PxsWabZhZb1wkIt+9Uny+N4T3bXmUM39aCvsQhCA4fPx9MfecU8aYqZrgSvEwIV2IbQIdqh3L9uNBSaB4ncozzfGjZl4kp1lDEjvF+pmLYc0xx4rglgekG0+/bAJMJty7oMxZORMHE2Kb67E8cn6qV1lMydAsy1/RDnCk5SIAHeDCShCNAdumHhdEfN9IKvbzYh4i61kGNbVX3IDjA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WRmMyxi3ACUrhjEbgYPTec10eBpkss9ICxf8QIfPYAvzFFmEOOtKdbuAbP2GJ0fHGfV3+j9Jx/qvzmoNlxkrNRQG3yzdWuzApdss05QmBrXOYtK8lAZ+xUdHrpmP0CzS7XYTcrNP4CijqfAAamJ8OrNOfYRKWWQPIi4a3d9FNP1ntimvcnpJeBmgBuBmU7YmK+wllYFRBI0jLjwDwLDKsD4blLznKHsJj3KiplDGUXcaV7coGsjOhpVSsoQIr8qdktcbhhB6kiS+eMEijZqfyiVfntJ03uHmyrNumduYGjr1s85bAmxj8ooEZpFcqbYVw4nnesxdllI9gyqsMnzqEw==
  • Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 19 May 2023 14:27:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 5/19/23 04:45, Jan Beulich wrote:
> On 18.05.2023 23:06, Stewart Hildebrand wrote:
>> --- a/xen/include/xen/iommu.h
>> +++ b/xen/include/xen/iommu.h
>> @@ -26,6 +26,7 @@
>>  #include <xen/spinlock.h>
>>  #include <public/domctl.h>
>>  #include <public/hvm/ioreq.h>
>> +#include <asm/acpi.h>
>>  #include <asm/device.h>
> 
> I view this as problematic: It'll require all architectures with an
> IOMMU implementation to have an asm/acpi.h. I think this wants to go
> inside an "#ifdef CONFIG_ACPI" and then ...

Will do

>> @@ -228,12 +230,25 @@ int iommu_release_dt_devices(struct domain *d);
>>   *      (IOMMU is not enabled/present or device is not connected to it).
>>   */
>>  int iommu_add_dt_device(struct dt_device_node *np);
>> +int iommu_add_dt_pci_sideband_ids(struct pci_dev *pdev);
>>
>>  int iommu_do_dt_domctl(struct xen_domctl *, struct domain *,
>>                         XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
>>
>> +#else /* !HAS_DEVICE_TREE */
>> +static inline int iommu_add_dt_pci_sideband_ids(struct pci_dev *pdev)
>> +{
>> +    return 0;
>> +}
>>  #endif /* HAS_DEVICE_TREE */
>>
>> +static inline int iommu_add_pci_sideband_ids(struct pci_dev *pdev)
>> +{
>> +    if ( acpi_disabled )
> 
> ... the same #ifdef would be added around this if().

Okay. I will take care to avoid an unreachable return 0; by introducing a local 
variable:

static inline int iommu_add_pci_sideband_ids(struct pci_dev *pdev)
{
    int ret = 0;
#ifdef CONFIG_ACPI
    if ( acpi_disabled )
#endif
        ret = iommu_add_dt_pci_sideband_ids(pdev);
    return ret;
}

> All of this of course only if this is deemed enough to allow co-existance
> of DT and ACPI (which I'm not convinced it is, but I don't know enough
> about DT and e.g. possible mixed configurations).
> 
> Jan

On ARM, we dynamically check for the existence of a valid device tree and set 
acpi_disabled accordingly. I did some basic testing on ARM with both 
CONFIG_ACPI=y and # CONFIG_ACPI is not set. My understanding is that it will 
work, and it should allow ACPI on ARM to be implemented in future.

>> +        return iommu_add_dt_pci_sideband_ids(pdev);
>> +    return 0;
>> +}
>> +
>>  struct page_info;
>>
>>  /*
> 



 


Rackspace

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