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

[PATCH 00/19] Allow x86 to unflatten DTs


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alejandro Vallejo <agarciav@xxxxxxx>
  • Date: Fri, 30 May 2025 14:02:08 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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 (0)
  • 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=RDnxDduMjMbUnEln534OSW3kiycNznllTRrJRof/5zY=; b=ZuJhhB1W4oDpbmA0KDn7EXfnfB20RwbLBk+MjAYyc0VXhgJqLgNVEBnlAsV85AJsyaloBW5rCwdkqNaOyHUBAzSPA0PLHOD/cHY8hiFfL5qv3n9lVDLhwef6NrDiZuqoJtofx6lLjuy65YfheGlKDC9ByMdCllRwTqZN7MRYZn+/7Vlc6Og2KF/E2QOHYRlwP6xvfT3IJgHnEZ8H6potnei1c6hbKbOpUR8a97rYLaX1ZNM1Zm4+9/y8Z/V9caGS/bkkiEqjq5Z1zbpx8c3eyxEtkibzQJNgYGcgXXyHjt1g/bFz8ACCQqheteu4iL6fDODLkCNZEuw8VdZeB6K3jw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XKSUDbankdwbxbUtxMYy/N1d7WFaAWeNc8UD8nPeQ5ET7cyVX4QmTraNQgc02KeAK5J9rJHXjBNKER5jtDpqAGKb2kI4pyE2jwTxxrktzOycKuFV2gMLceXgh5HWkG9ddRTKgiXLRzrtaJZ3EY4fkRYr74aaLasyna6BaLyvF8y2wbAP/sgbGrJ0kyoq+p4B8eM97Vgh6rMqtE8KAVwzqXLQ9twGR29yknxhgRATwuD1Qx5G9ctCBdxXLMhlyyQRIfH/oQinUUtcps5W8uUMiIw9mP4ArciLEDMmFqQm+fIVis9de/wgDsoQJdAx0q53VqILDyLRK4nivNCwUUL5uA==
  • Cc: Alejandro Vallejo <agarciav@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, "Connor Davis" <connojdavis@xxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 30 May 2025 12:03:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

I wrote it as a series to keep things focused, but there's a number of
independent chunks.

  * Patches 1 to 7 are strict (hopefully) uncontroversial cleanups.

  * Patches 8 and 9 add minor missing bits to bootmodule needed by x86.

  * Patches 10 and 11 are BIG, but trivial. They are strict renames of
    boot_module to bootmodule, and equally trivial adjustments to the 
    fields (e.g: s/kernel/kernel_bootmodule or s/relocated/arch.relocated/)

  * Patches 12 to 16 try to put some order inside device-tree/. Despite
    their diffstat it's all code motion without functional changes.

  * Patch 17 is the cornerstone of allowing x86 to unflatten DTs,
    otherwise there's the world's entire supply of compile time errors
    due to x86 assuming device_t to be pci_dev.

  * Patches 18 and 19 are inconsequential here, but enables future
    patches in this direction to be gated by a selectable option in
    Kconfig. i.e: it would replace the current CONFIG_DOMAIN_BUILDER in
    the hyperlaunch series. In time, we'll want to rename it to
    CONFIG_MULTIDOMAIN_BUILDER, or CONFIG_PREDOMAINS, or something along
    those lines. For the time being CONFIG_BOOT_DOM0LESS can mean
    CONFIG_BOOT_HYPERLAUNCH on x86 without much of value being lost.

I'd like to re-touch the dom0less help message, as it's written very
confusingly, but I'll leave that for later series.

Alejandro Vallejo (19):
  licence: Add missing SPDX line to bootfdt.h
  x86: Add missing pci_dev forward declaration in asm/pci.h
  riscv: Add missing forward declaration to intc.h
  xen: Add missing forward declaration to  btcpupools_get_domain_pool_id
  arm: Remove dependencies with membank(s) definitions from setup.h
  xen: Clean up asm-generic/device.h
  arm/gnttab: Break cycle between asm/grant_table.h and
    xen/grant_table.h
  xen/dt: Add BOOTMOD_MICROCODE
  x86: Preinitialise all modules to be of kind BOOTMOD_UNKNOWN
  x86: Replace boot_module with bootmodule
  x86: Replace boot_domain with kernel_info
  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: Move bootinfo-independent helpers out of bootinfo-fdt.c
  xen/dt: Extract helper to map nodes to module kinds
  xen/dt: ifdef out DEV_DT-related bits from device_tree.{c,h}
  xen/dt: Allow CONFIG_DOM0LESS_BOOT to include device-tree/
  kconfig: Allow x86 to pick CONFIG_DOM0LESS_BOOT

 xen/arch/arm/domain_build.c             |   2 +-
 xen/arch/arm/include/asm/grant_table.h  |   1 -
 xen/arch/arm/include/asm/setup.h        |  16 +-
 xen/arch/arm/mmu/mm.c                   |   1 +
 xen/arch/riscv/aplic.c                  |   3 +-
 xen/arch/riscv/include/asm/intc.h       |   2 +
 xen/arch/riscv/mm.c                     |   2 +-
 xen/arch/riscv/setup.c                  |   2 +-
 xen/arch/x86/Kconfig                    |   1 +
 xen/arch/x86/cpu/microcode/core.c       |   9 +-
 xen/arch/x86/dom0_build.c               |   2 +-
 xen/arch/x86/hvm/dom0_build.c           |  16 +-
 xen/arch/x86/include/asm/boot-domain.h  |  33 --
 xen/arch/x86/include/asm/bootfdt.h      |  52 ++
 xen/arch/x86/include/asm/bootinfo.h     |  63 +--
 xen/arch/x86/include/asm/dom0_build.h   |   6 +-
 xen/arch/x86/include/asm/kernel.h       |  20 +
 xen/arch/x86/include/asm/pci.h          |   2 +
 xen/arch/x86/include/asm/setup.h        |  10 +-
 xen/arch/x86/pv/dom0_build.c            |  12 +-
 xen/arch/x86/setup.c                    |  69 +--
 xen/common/Kconfig                      |   9 +-
 xen/common/Makefile                     |   2 +-
 xen/common/device-tree/Makefile         |   9 +-
 xen/common/device-tree/bootfdt.c        | 624 ++----------------------
 xen/common/device-tree/bootinfo-fdt.c   | 554 +++++++++++++++++++++
 xen/common/device-tree/bootinfo.c       |   3 +-
 xen/common/device-tree/device-tree.c    |   2 +
 xen/common/device-tree/dom0less-build.c |   2 +-
 xen/common/device-tree/domain-build.c   |   2 +-
 xen/common/device-tree/kernel.c         |   2 +-
 xen/include/asm-generic/device.h        |  18 +-
 xen/include/xen/bootfdt.h               | 272 +++--------
 xen/include/xen/bootinfo.h              | 212 ++++++++
 xen/include/xen/device_tree.h           |  38 +-
 xen/include/xen/fdt-domain-build.h      |   2 +-
 xen/include/xen/fdt-kernel.h            |   4 +-
 xen/include/xen/grant_table.h           |   2 +-
 xen/include/xen/sched.h                 |   8 +-
 xen/xsm/xsm_policy.c                    |   4 +-
 40 files changed, 1071 insertions(+), 1022 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/arch/x86/include/asm/kernel.h
 create mode 100644 xen/common/device-tree/bootinfo-fdt.c
 create mode 100644 xen/include/xen/bootinfo.h

-- 
2.43.0




 


Rackspace

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