[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3] xen: Remove dependency between pciback and privcmd
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
- Date: Fri, 11 Oct 2024 09:33:47 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.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=jtOfM3RN79vdFK+e0pyh3Ry3z4DITZSUryAgsd+yQbM=; b=YfjkCDTim4+TeCBxdq0FgeA+qsrKg8+4kpPUuetLP18Aw/fqVtFU301OMnr+WchFYjwFDo5rYYz0aHjFUFWr+RoiuOSnisPRr0ZvOE76nfoLCWURVbHCBMUE8/4P6GfdGr6sn+L1GzC9oZ9VwHVcyF5N0oVHoRFMeogDXlGm98BGXBureST+aB7I+qvC/2Wj7q0BFuH05Uz/M222ScczR3CVnH1OLuTWPSjWquLsbiuJnVSBOUeE9tqzTPeJFyxxhcVSyYjfDcEhNlQnm3bf0Z+ALioznXPgsaaa44abL0KeUjj/ggU7DbooEjxF5ue8zKH2hCn7noaHj1x+uFtM4A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=R4z2rIq2BLVZZsObzSlcLsjZ+YDSS2z+VoDvc9pdg7HR6uVgyIacsOwYgaf4tzKVeaHJsrb8KSI4XiLI7dCcPjBSRO71pfnk0YwBzeLYtpZTUdPRuVZRJk6hPP2b1pJIwUr9fXHJnZ3B+6/Cv3MQniTxXYahny46uV7qKrAJKE632dwpuLmNAZbxkd2I6zgbBEVdFwLv/ZGJMYeC4BjGF5yNcYCedeUJl+gtRRwTnWVlKBg1WOrYhHrPvQ2aGtpyZqo3azPsaePJF52kxxyW74rmUFau6IE0OPYYa0MQglUGLZjJQV86Blhv2GYYJpX530Wn1GngLDiyvwY2ABPLjQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
- Delivery-date: Fri, 11 Oct 2024 09:34:00 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHbG4+3Lfp3cJlJ4UuqoaLQId+ES7KBP0mAgACK34CAAAW/gA==
- Thread-topic: [PATCH v3] xen: Remove dependency between pciback and privcmd
On 2024/10/11 17:20, Chen, Jiqian wrote:
> On 2024/10/11 16:54, Jan Beulich wrote:
>> On 11.10.2024 05:42, Jiqian Chen wrote:
>>> @@ -1757,11 +1756,19 @@ static int __init xen_pcibk_init(void)
>>> bus_register_notifier(&pci_bus_type, &pci_stub_nb);
>>> #endif
>>>
>>> +#ifdef CONFIG_XEN_ACPI
>>> + xen_acpi_register_get_gsi_func(pcistub_get_gsi_from_sbdf);
>>> +#endif
>>> +
>>> return err;
>>> }
>>>
>>> static void __exit xen_pcibk_cleanup(void)
>>> {
>>> +#ifdef CONFIG_XEN_ACPI
>>> + xen_acpi_register_get_gsi_func(NULL);
>>> +#endif
>>
>> Just wondering - instead of these two #ifdef-s, ...
>>
>>> --- a/include/xen/acpi.h
>>> +++ b/include/xen/acpi.h
>>> @@ -91,13 +91,9 @@ static inline int xen_acpi_get_gsi_info(struct pci_dev
>>> *dev,
>>> }
>>> #endif
>>>
>>> -#ifdef CONFIG_XEN_PCI_STUB
>>> -int pcistub_get_gsi_from_sbdf(unsigned int sbdf);
>>> -#else
>>> -static inline int pcistub_get_gsi_from_sbdf(unsigned int sbdf)
>>> -{
>>> - return -1;
>>> -}
>>> -#endif
>>> +typedef int (*get_gsi_from_sbdf_t)(u32 sbdf);
>>> +
>>> +void xen_acpi_register_get_gsi_func(get_gsi_from_sbdf_t func);
>>> +int xen_acpi_get_gsi_from_sbdf(u32 sbdf);
>>
>> ... wouldn't a static inline stub (for the !XEN_ACPI case) aid overall
>> readability?
> I'm not sure if other files do this. But for me, it feels a little strange to
> use "#ifdef CONFIG_XEN_ACPI #else" in apci.h, like self-containment.
> And "#include apci.h" in pic_stub.c is also wraped with CONFIG_XEN_ACPI.
OK, I saw other files also do this.
If you insist, I will make modifications in the next version.
Thank you!
>
>>
>> Jan
>
--
Best regards,
Jiqian Chen.
|