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

Re: [PATCH v8 2/8] iommu/arm: Introduce iommu_add_dt_pci_sideband_ids API


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Date: Wed, 26 Feb 2025 09:58:47 +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=uDD56LKMooMs7+7yBsyUhzulBbC49slejj6BUFlkyIM=; b=S+Hee+DEKkGNe0X/MxbUJiLoYENWgSwNandAxWpFwA8BQHCHWj0VLN1ll96GnbLV7aKTpfgnvfPkVHZmp61CCffkEj+PNZCnjeSeLCeQBuSdWkfAidxf06rfVuz/wTHGI73QNsSFkAV8xx4sl/3hMdkCEeUYIIDYkxa0E8IWxKmAfZwLSgbMbe1nvUbxzXN3HNjzBLSzsFQJTsNqsElHh1DCFZjock/t6yWRj3rRYBbc6KtK7/Kry6lgylGBTFsIlJrvgbn+KzLnAZniythTrlDOF7tkdgl2FrJlZBKVcw8liX4rZxMXDJVN83iMSV2KMsmlEroexoGa285ahArMCQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dL8gzK7FINalsqHJ2Q9jJQh65brGr+Cwl2opdSbSv1BNRhUut0qZND4chf2MXx2G6D9Hsf6R1iOZQ2wYBdWOnlbGmdy4xZF/aVplN0V8toKmrVBny2sXXpCZrikI4x3WGv491pXGtrm2v0gYoNMUzbAFe2oOzzh9eCZY+uIbSZITvWLjwhsWdQqFoXI4F4L6eDtN+Wk+pwbJevoMXGIPrrzpp30PWEftQWzZt+LUjawvx/dyrZm/rBM4jxcSfTbl6ajJZBik3hAFxoG+MAhZ0MQYO4nBcNLBmObejLhi46U0dfRbXTob+oTkAC7mw2oWcJAj6xzD/7BvyKcJlDVSiQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 26 Feb 2025 09:59:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbe6bXkeUuupR7FUWii7Y2X2QPj7NAXFWAgBkWagA=
  • Thread-topic: [PATCH v8 2/8] iommu/arm: Introduce iommu_add_dt_pci_sideband_ids API

On 10.02.25 12:52, Jan Beulich wrote:
> On 10.02.2025 11:30, Mykyta Poturai wrote:
>> --- a/xen/drivers/passthrough/iommu.c
>> +++ b/xen/drivers/passthrough/iommu.c
>> @@ -20,6 +20,7 @@
>>   #include <xen/param.h>
>>   #include <xen/softirq.h>
>>   #include <xen/keyhandler.h>
>> +#include <xen/acpi.h>
>>   #include <xsm/xsm.h>
>>   
>>   #ifdef CONFIG_X86
>> @@ -744,6 +745,18 @@ int __init 
>> iommu_get_extra_reserved_device_memory(iommu_grdm_t *func,
>>       return 0;
>>   }
>>   
>> +int iommu_add_pci_sideband_ids(struct pci_dev *pdev)
>> +{
>> +    int ret = -EOPNOTSUPP;
>> +
>> +#ifdef CONFIG_HAS_PCI
>> +    if ( acpi_disabled )
>> +        ret = iommu_add_dt_pci_sideband_ids(pdev);
>> +#endif
>> +
>> +    return ret;
>> +}
> 
> This function has no caller, which violates a Misra rule iirc. Considering
> all information given here it's also unclear why it would gain a caller on
> x86 (at least as long as DT isn't used there).
> 
> Jan

Would it be ok to wrap it with CONFIG_ARM? I am not quite sure how 
relevant this mapping functionality is to X86 iommus, although Linux has 
similar implementations for ACPI.

Alternatively, we can remove this abstraction for now, to call 
iommu_add_dt_pci_sideband_ids from Arm directly and only introduce it 
back when at least some ACPI implementation is done.

Also, just want to mention the issue that forced me to move this from 
the header in the first place in case it is not known. There is a 
conflict in fixed width integers definitions between actypes.h and 
efibind.h and it was revealed when including acpi.h into iommu.h.
I initially tried to fix the source of this conflict, but I don't know 
enough about ACPI and EFI quirks to confidently do it.

In file included from ./include/acpi/acpi.h:57,
                  from ./include/xen/acpi.h:57,
                  from ./include/xen/iommu.h:28,
                  from ./include/xen/sched.h:12,
                  from ./arch/x86/include/asm/paging.h:17,
                  from ./arch/x86/include/asm/guest_access.h:11,
                  from ./include/xen/guest_access.h:10,
                  from arch/x86/efi/runtime.c:5:
./include/acpi/actypes.h:130:35: error: conflicting types for ‘UINT64’; 
have ‘long long unsigned int’
   130 | typedef COMPILER_DEPENDENT_UINT64 UINT64;
       |                                   ^~~~~~
In file included from ./arch/x86/include/asm/efibind.h:2,
                  from ./common/efi/efi.h:1,
                  from arch/x86/efi/runtime.c:1:
./arch/x86/include/asm/x86_64/efibind.h:89:20: note: previous 
declaration of ‘UINT64’ with type ‘UINT64’ {aka ‘long unsigned int’}
    89 | typedef uint64_t   UINT64;
-- 
Mykyta

 


Rackspace

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