From: Alejandro Vallejo <agarciav@amd.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Alistair Francis" <alistair.francis@wdc.com>,
"Bob Eshleman" <bobbyeshleman@gmail.com>,
"Connor Davis" <connojdavis@gmail.com>,
"Oleksii Kurochko" <oleksii.kurochko@gmail.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Michal Orzel" <michal.orzel@amd.com>,
"Julien Grall" <julien@xen.org>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Daniel P. Smith" <dpsmith@apertussolutions.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 01/15] xen: Clean up asm-generic/device.h
Date: Fri, 6 Jun 2025 11:55:30 +0200 [thread overview]
Message-ID: <DAFCZ0J2JEVF.3TIHRWPDJA1PL@amd.com> (raw)
In-Reply-To: <38104467-fb7e-4aa3-9c78-0f9bf23183eb@suse.com>
On Fri Jun 6, 2025 at 8:51 AM CEST, Jan Beulich wrote:
> On 05.06.2025 21:47, Alejandro Vallejo wrote:
>> --- a/xen/include/asm-generic/device.h
>> +++ b/xen/include/asm-generic/device.h
>> @@ -1,14 +1,20 @@
>> /* SPDX-License-Identifier: GPL-2.0-only */
>> +/*
>> + * This header helps DTB-based architectures abstract away where a particular
>> + * device came from, be it the DTB itself or enumerated on a PCI bus.
>> + */
>> #ifndef __ASM_GENERIC_DEVICE_H__
>> #define __ASM_GENERIC_DEVICE_H__
>>
>> +#ifndef CONFIG_HAS_DEVICE_TREE
>> +#error "Header for exclusive use of DTB-based architectures"
>> +#endif
>> +
>> #include <xen/stdbool.h>
>>
>> enum device_type
>> {
>> -#ifdef CONFIG_HAS_DEVICE_TREE
>> DEV_DT,
>> -#endif
>> DEV_PCI
>> };
>
> My objection to these changes remains; as a generic header it ought to be what
> that attribute says - generic.
>
> Jan
It is generic for any architecture where platform DTs exist (that is, anything
but x86).
As the commit message states, these guards are useless, provide no functionality
and create the fiction that somehow this header is still relevant on an
architecture where only PCI is available. And that's just not true. x86 being
the sole architecture without DTs actively overrides it, and relies on device_t
(defined as struct device here) to be a "struct pci_dev" instead in
x86/include/asm/device.h, with dev_to_pci() and pci_to_dev() being irrelevant
because device_t* and struct pci_dev* are identical types in x86. Removing that
override header is not just a matter of performance. All the IOMMU ops are
referencing device_t, while the drivers are assuming pci_dev, so all IOMMU
code breaks immediately when x86 tries to use this.
To be perfectly clear, this patch isn't strictly required to do DT unflattening
on x86. But it's a piece of arm tech debt that Xen is better off without.
Cheers,
Alejandro
next prev parent reply other threads:[~2025-06-06 9:56 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-05 19:47 [PATCH v2 00/15] Allow x86 to unflatten DTs Alejandro Vallejo
2025-06-05 19:47 ` [PATCH v2 01/15] xen: Clean up asm-generic/device.h Alejandro Vallejo
2025-06-06 6:51 ` Jan Beulich
2025-06-06 9:55 ` Alejandro Vallejo [this message]
2025-06-06 10:03 ` Jan Beulich
2025-06-06 10:21 ` Alejandro Vallejo
2025-06-05 19:47 ` [PATCH v2 02/15] arm/gnttab: Break links between asm/grant_table.h and xen/grant_table.h Alejandro Vallejo
2025-06-06 6:52 ` Jan Beulich
2025-06-06 10:02 ` Alejandro Vallejo
2025-06-06 10:07 ` Jan Beulich
2025-06-06 10:30 ` Alejandro Vallejo
2025-06-06 12:23 ` Jan Beulich
2025-06-05 19:47 ` [PATCH v2 03/15] xen/dt: Add BOOTMOD_MICROCODE Alejandro Vallejo
2025-06-06 8:47 ` Orzel, Michal
2025-06-05 19:47 ` [PATCH v2 04/15] x86: Preinitialise all modules to be of kind BOOTMOD_UNKNOWN Alejandro Vallejo
2025-06-05 19:47 ` [PATCH v2 05/15] x86: Replace boot_module with bootmodule Alejandro Vallejo
2025-06-05 19:47 ` [PATCH v2 06/15] xen: Refactor kernel_info to have a header like boot_domain Alejandro Vallejo
2025-06-05 19:47 ` [PATCH v2 07/15] x86: Replace boot_domain with bootdomain Alejandro Vallejo
2025-06-06 23:28 ` Stefano Stabellini
2025-06-09 8:57 ` Alejandro Vallejo
2025-06-09 16:56 ` Stefano Stabellini
2025-06-05 19:48 ` [PATCH v2 08/15] xen/dt: Move bootfdt functions to xen/bootfdt.h Alejandro Vallejo
2025-06-06 8:59 ` Orzel, Michal
2025-06-06 10:08 ` Alejandro Vallejo
2025-06-06 19:59 ` Stefano Stabellini
2025-06-09 8:59 ` Alejandro Vallejo
2025-06-09 16:55 ` Stefano Stabellini
2025-06-05 19:48 ` [PATCH v2 09/15] xen/dt: Move bootinfo functions to a new bootinfo.h Alejandro Vallejo
2025-06-06 23:39 ` Stefano Stabellini
2025-06-05 19:48 ` [PATCH v2 10/15] xen/dt: Rename bootfdt.c -> bootinfo-fdt.c Alejandro Vallejo
2025-06-05 19:48 ` [PATCH v2 11/15] xen/dt: Move bootinfo-independent helpers out of bootinfo-fdt.c Alejandro Vallejo
2025-06-06 23:43 ` Stefano Stabellini
2025-06-05 19:48 ` [PATCH v2 12/15] xen/dt: Extract helper to map nodes to module kinds Alejandro Vallejo
2025-06-05 19:48 ` [PATCH v2 13/15] xen/dt: ifdef out DEV_DT-related bits from device_tree.{c,h} Alejandro Vallejo
2025-06-06 23:54 ` Stefano Stabellini
2025-06-05 19:48 ` [PATCH v2 14/15] xen/dt: Allow CONFIG_DOM0LESS_BOOT to include device-tree/ Alejandro Vallejo
2025-06-06 23:55 ` Stefano Stabellini
2025-06-05 19:48 ` [PATCH v2 15/15] kconfig: Allow x86 to pick CONFIG_DOM0LESS_BOOT Alejandro Vallejo
2025-06-06 23:57 ` Stefano Stabellini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DAFCZ0J2JEVF.3TIHRWPDJA1PL@amd.com \
--to=agarciav@amd.com \
--cc=alistair.francis@wdc.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=bobbyeshleman@gmail.com \
--cc=connojdavis@gmail.com \
--cc=dpsmith@apertussolutions.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=oleksii.kurochko@gmail.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.