[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v4 00/12] Allow x86 to unflatten DTs
pipeline: https://gitlab.com/xen-project/people/agvallejo/xen/-/pipelines/1880819044 Hi, There are minor adjustments throughout based on feedback, and I've also dropped the patch that allowed x86 to just pick DOM0LESS_BOOT right now until the rest of the changes to boot a single-dom0 DTB go in. Biggest changes are regarding some confusion with Kconfig. The idea is to segregate DT processing in two. A basic one, and a full-fledged one. The former would be currently used exclusively by x86, based on the fact that it does not need to discover devices in the DT, while the later would remain largely the same for every other Xen port, because they need all of it anyway for their own boot procedures. v3 used CONFIG_HAS_DEVICE_TREE as such a discriminator of a full-fledged DT parsing logic. The idea behind v4 is: * HAS_DEVICE_TREE is renamed to HAS_DEVICE_TREE_DISCOVERY, to clearly show the new interpretation that this Kconfig option exists for platforms that discover devices via DTs. * DOM0LESS_BOOT stops requiring HAS_DEVICE_TREE, so x86 can pick it * DOM0LESS_BOOT starts allowing compiling a subset of common/device-tree/ Looked at in a different light: Full DT support: HAS_DEVICE_TREE_DISCOVERY Basic DT support: DOM0LESS_BOOT || HAS_DEVICE_TREE_DISCOVERY No DT support: !DOM0LESS_BOOT && !HAS_DEVICE_TREE_DISCOVERY And in table form FTAOD: | HAS_DEVICE_TREE_DISCOVERY | DOM0LESS_BOOT | Description | ------+---------------------------+---------------+------------------+ | | y | Basic DT support | x86 + n +---------------+------------------+ | | n | No DT support | ------+---------------------------+---------------+------------------+ arm | | | | ------+ | | | riscv | y | y/n | Full DT support | ------+ | | | ppc | | | | ------+---------------------------+---------------+------------------+ Note that HAS_DOM0LESS stays around to hide DOM0LESS_BOOT from ports that don't support dom0less yet (all but arm, atm). Previous versions ================= v3: https://lore.kernel.org/xen-devel/20250613151612.754222-1-agarciav@xxxxxxx/ v2: https://lore.kernel.org/xen-devel/20250605194810.2782031-1-agarciav@xxxxxxx/ v1: https://lore.kernel.org/xen-devel/20250530120242.39398-1-agarciav@xxxxxxx/ Original cover letter ===================== This is the aftermath of this discussion: https://lore.kernel.org/xen-devel/DA1WWRUQLCAG.ZTVR1HXJ85V0@xxxxxxx/https://lore.kernel.org/xen-devel/DA1WWRUQLCAG.ZTVR1HXJ85V0@xxxxxxx/ It's a first round of cleanup and preparation to have a much easier time later when integrating dom0less boot into hyperlaunch. The refactor on device-tree/ is _fine_ by I'm open to other suggestions to achieve the same thing. In particular, after this series x86 can unflatten the DT host device tree when it has CONFIG_DOM0LESS_BOOT set, which enables the builder to use factored-out functions from dom0less-build.c (not done here). The diffstat is deceptive because I renamed a large file and then created a new file with the same name. There aren't that many LoC changes. Alejandro Vallejo (12): CODING_STYLE: Custom type names must be snake-cased by word. xen: Rename bootmodule{,s} to boot_module{,s} x86: Replace arch-specific boot_module with common one xen: Refactor kernel_info to have a header like boot_domain x86: Replace arch-specific boot_domain with the common one xen/dt: Move bootfdt functions to xen/bootfdt.h xen/dt: Move bootinfo functions to a new bootinfo.h xen/dt: Rename bootfdt.c -> bootinfo-fdt.c xen/dt: Extract helper to map nodes to module kinds xen: Rename CONFIG_HAS_DEVICE_TREE to CONFIG_HAS_DEVICE_TREE_DISCOVERY xen/dt: ifdef out DEV_DT-related bits from device_tree.{c,h} xen/dt: Remove DOM0LESS_BOOT's requirement on HAS_DEVICE_TREE_DISCOVERY CODING_STYLE | 6 + xen/Kconfig.debug | 2 +- xen/arch/arm/Kconfig | 2 +- xen/arch/arm/dom0less-build.c | 8 +- xen/arch/arm/domain_build.c | 21 +- xen/arch/arm/efi/efi-boot.h | 6 +- xen/arch/arm/include/asm/setup.h | 2 +- xen/arch/arm/kernel.c | 10 +- xen/arch/arm/llc-coloring.c | 8 +- xen/arch/arm/mmu/setup.c | 10 +- xen/arch/arm/setup.c | 11 +- xen/arch/ppc/Kconfig | 2 +- xen/arch/riscv/Kconfig | 2 +- xen/arch/riscv/cpufeature.c | 1 + xen/arch/riscv/mm.c | 2 +- xen/arch/riscv/setup.c | 2 +- xen/arch/riscv/smpboot.c | 1 + xen/arch/x86/cpu/microcode/core.c | 7 +- xen/arch/x86/hvm/dom0_build.c | 8 +- xen/arch/x86/include/asm/boot-domain.h | 33 -- xen/arch/x86/include/asm/bootfdt.h | 56 ++ xen/arch/x86/include/asm/bootinfo.h | 57 +-- xen/arch/x86/pv/dom0_build.c | 6 +- xen/arch/x86/setup.c | 55 +- xen/common/Kconfig | 7 +- xen/common/Makefile | 5 +- xen/common/device-tree/Makefile | 7 +- xen/common/device-tree/bootfdt.c | 654 ++---------------------- xen/common/device-tree/bootinfo-fdt.c | 583 +++++++++++++++++++++ xen/common/device-tree/bootinfo.c | 54 +- xen/common/device-tree/device-tree.c | 3 + xen/common/device-tree/dom0less-build.c | 45 +- xen/common/device-tree/domain-build.c | 22 +- xen/common/device-tree/kernel.c | 30 +- xen/common/device-tree/static-evtchn.c | 1 + xen/common/device.c | 4 +- xen/common/efi/boot.c | 2 +- xen/common/sched/Kconfig | 2 +- xen/common/sched/boot-cpupool.c | 1 + xen/drivers/char/ns16550.c | 6 +- xen/drivers/passthrough/Makefile | 2 +- xen/drivers/passthrough/iommu.c | 2 +- xen/include/asm-generic/device.h | 10 +- xen/include/xen/bootfdt.h | 306 ++++------- xen/include/xen/bootinfo.h | 213 ++++++++ xen/include/xen/device_tree.h | 70 +-- xen/include/xen/fdt-domain-build.h | 2 +- xen/include/xen/fdt-kernel.h | 12 +- xen/include/xen/iommu.h | 8 +- xen/include/xsm/dummy.h | 4 +- xen/include/xsm/xsm.h | 12 +- xen/xsm/dummy.c | 2 +- xen/xsm/flask/hooks.c | 6 +- xen/xsm/xsm_core.c | 4 +- xen/xsm/xsm_policy.c | 8 +- 55 files changed, 1228 insertions(+), 1177 deletions(-) delete mode 100644 xen/arch/x86/include/asm/boot-domain.h create mode 100644 xen/arch/x86/include/asm/bootfdt.h create mode 100644 xen/common/device-tree/bootinfo-fdt.c create mode 100644 xen/include/xen/bootinfo.h base-commit: 12d72d032e169082308efb9d44b9964ef9fa4340 -- 2.43.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |