[PATCH v8 00/11] Allow x86 to unflatten DTs

Alejandro Vallejo posted 11 patches 3 months, 1 week ago
Failed in applying to current master (apply log)
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/include/asm/setup.h        |   2 +-
xen/arch/arm/kernel.c                   |   8 +-
xen/arch/arm/setup.c                    |   1 +
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      |  50 ++
xen/arch/x86/include/asm/bootinfo.h     |  57 +--
xen/arch/x86/pv/dom0_build.c            |   6 +-
xen/arch/x86/setup.c                    |  45 +-
xen/common/Kconfig                      |  15 +-
xen/common/Makefile                     |   4 +-
xen/common/device-tree/Makefile         |   5 +-
xen/common/device-tree/bootfdt.c        | 617 +-----------------------
xen/common/device-tree/bootinfo-fdt.c   | 584 ++++++++++++++++++++++
xen/common/device-tree/bootinfo.c       |   4 +-
xen/common/device-tree/device-tree.c    |   3 +
xen/common/device-tree/dom0less-build.c |  20 +-
xen/common/device-tree/domain-build.c   |  22 +-
xen/common/device-tree/kernel.c         |  22 +-
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               | 318 +++++-------
xen/include/xen/bootinfo.h              | 213 ++++++++
xen/include/xen/device_tree.h           |  82 +---
xen/include/xen/fdt-domain-build.h      |   2 +-
xen/include/xen/fdt-kernel.h            |   7 +-
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 +-
51 files changed, 1148 insertions(+), 1104 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
[PATCH v8 00/11] Allow x86 to unflatten DTs
Posted by Alejandro Vallejo 3 months, 1 week ago
Hi,

Really minor changes wrt v7

  1. s/BOOTMOD_XSM/BOOTMOD_XSM_POLICY/
  2. Remove stale obj-y statements in the last patch

pipeline: https://gitlab.com/xen-project/people/agvallejo/xen/-/pipelines/1940366600

v7: https://lore.kernel.org/xen-devel/20250715161108.141126-1-alejandro.garciavallejo@amd.com>
v6: https://lore.kernel.org/xen-devel/20250708180721.2338036-1-alejandro.garciavallejo@amd.com/
v5: https://lore.kernel.org/xen-devel/20250701105706.86133-1-agarciav@amd.com/
v4: https://lore.kernel.org/xen-devel/20250620182859.23378-1-agarciav@amd.com/
v3: https://lore.kernel.org/xen-devel/20250613151612.754222-1-agarciav@amd.com/
v3: https://lore.kernel.org/xen-devel/20250613151612.754222-1-agarciav@amd.com/
v2: https://lore.kernel.org/xen-devel/20250605194810.2782031-1-agarciav@amd.com/
v1: https://lore.kernel.org/xen-devel/20250530120242.39398-1-agarciav@amd.com/


Alejandro Vallejo (11):
  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 bootinfo-independent functions to bootfdt.c
  xen/dt: Extract helper to map nodes to module kinds
  xen: Split HAS_DEVICE_TREE in two
  xen/dt: ifdef out DEV_DT-related bits from device_tree.{c,h}
  xen/dt: Allow CONFIG_DEVICE_TREE_PARSE to include device-tree/

 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/include/asm/setup.h        |   2 +-
 xen/arch/arm/kernel.c                   |   8 +-
 xen/arch/arm/setup.c                    |   1 +
 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      |  50 ++
 xen/arch/x86/include/asm/bootinfo.h     |  57 +--
 xen/arch/x86/pv/dom0_build.c            |   6 +-
 xen/arch/x86/setup.c                    |  45 +-
 xen/common/Kconfig                      |  15 +-
 xen/common/Makefile                     |   4 +-
 xen/common/device-tree/Makefile         |   5 +-
 xen/common/device-tree/bootfdt.c        | 617 +-----------------------
 xen/common/device-tree/bootinfo-fdt.c   | 584 ++++++++++++++++++++++
 xen/common/device-tree/bootinfo.c       |   4 +-
 xen/common/device-tree/device-tree.c    |   3 +
 xen/common/device-tree/dom0less-build.c |  20 +-
 xen/common/device-tree/domain-build.c   |  22 +-
 xen/common/device-tree/kernel.c         |  22 +-
 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               | 318 +++++-------
 xen/include/xen/bootinfo.h              | 213 ++++++++
 xen/include/xen/device_tree.h           |  82 +---
 xen/include/xen/fdt-domain-build.h      |   2 +-
 xen/include/xen/fdt-kernel.h            |   7 +-
 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 +-
 51 files changed, 1148 insertions(+), 1104 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: 31bf9f72a9d89221f173c94e379891380333b018
-- 
2.43.0
Re: [PATCH v8 00/11] Allow x86 to unflatten DTs
Posted by Jan Beulich 3 months, 1 week ago
On 22.07.2025 02:05, Alejandro Vallejo wrote:
> Hi,
> 
> Really minor changes wrt v7
> 
>   1. s/BOOTMOD_XSM/BOOTMOD_XSM_POLICY/
>   2. Remove stale obj-y statements in the last patch
> 
> pipeline: https://gitlab.com/xen-project/people/agvallejo/xen/-/pipelines/1940366600
> 
> v7: https://lore.kernel.org/xen-devel/20250715161108.141126-1-alejandro.garciavallejo@amd.com>
> v6: https://lore.kernel.org/xen-devel/20250708180721.2338036-1-alejandro.garciavallejo@amd.com/
> v5: https://lore.kernel.org/xen-devel/20250701105706.86133-1-agarciav@amd.com/
> v4: https://lore.kernel.org/xen-devel/20250620182859.23378-1-agarciav@amd.com/
> v3: https://lore.kernel.org/xen-devel/20250613151612.754222-1-agarciav@amd.com/
> v3: https://lore.kernel.org/xen-devel/20250613151612.754222-1-agarciav@amd.com/
> v2: https://lore.kernel.org/xen-devel/20250605194810.2782031-1-agarciav@amd.com/
> v1: https://lore.kernel.org/xen-devel/20250530120242.39398-1-agarciav@amd.com/
> 
> 
> Alejandro Vallejo (11):
>   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 bootinfo-independent functions to bootfdt.c
>   xen/dt: Extract helper to map nodes to module kinds
>   xen: Split HAS_DEVICE_TREE in two
>   xen/dt: ifdef out DEV_DT-related bits from device_tree.{c,h}
>   xen/dt: Allow CONFIG_DEVICE_TREE_PARSE to include device-tree/

Pretty clearly, as per the build-each-commit job in CI, there must have been an
issue in the middle of the series:

In file included from ./arch/x86/include/asm/bootinfo.h:15,
                 from arch/x86/cpu/microcode/core.c:37:
./arch/x86/include/asm/boot-domain.h:13:8: error: redefinition of 'struct boot_domain'
   13 | struct boot_domain {
      |        ^~~~~~~~~~~
In file included from ./arch/x86/include/asm/bootinfo.h:11:
./include/xen/bootfdt.h:103:8: note: originally defined here
  103 | struct boot_domain {
      |        ^~~~~~~~~~~

and similarly

In file included from ./arch/x86/include/asm/bootinfo.h:15,
                 from arch/x86/pv/dom0_build.c:17:
./arch/x86/include/asm/boot-domain.h:13:8: error: redefinition of 'struct boot_domain'
   13 | struct boot_domain {
      |        ^~~~~~~~~~~
In file included from ./arch/x86/include/asm/bootinfo.h:11:
./include/xen/bootfdt.h:103:8: note: originally defined here
  103 | struct boot_domain {
      |        ^~~~~~~~~~~

Jan
Re: [PATCH v8 00/11] Allow x86 to unflatten DTs
Posted by Alejandro Vallejo 3 months, 1 week ago
On Tue Jul 22, 2025 at 9:00 AM CEST, Jan Beulich wrote:
> On 22.07.2025 02:05, Alejandro Vallejo wrote:
>> Hi,
>> 
>> Really minor changes wrt v7
>> 
>>   1. s/BOOTMOD_XSM/BOOTMOD_XSM_POLICY/
>>   2. Remove stale obj-y statements in the last patch
>> 

This pipeline turned green on the build each commit job, so...

>> pipeline: https://gitlab.com/xen-project/people/agvallejo/xen/-/pipelines/1940366600
>> 
>> v7: https://lore.kernel.org/xen-devel/20250715161108.141126-1-alejandro.garciavallejo@amd.com>
>> v6: https://lore.kernel.org/xen-devel/20250708180721.2338036-1-alejandro.garciavallejo@amd.com/
>> v5: https://lore.kernel.org/xen-devel/20250701105706.86133-1-agarciav@amd.com/
>> v4: https://lore.kernel.org/xen-devel/20250620182859.23378-1-agarciav@amd.com/
>> v3: https://lore.kernel.org/xen-devel/20250613151612.754222-1-agarciav@amd.com/
>> v3: https://lore.kernel.org/xen-devel/20250613151612.754222-1-agarciav@amd.com/
>> v2: https://lore.kernel.org/xen-devel/20250605194810.2782031-1-agarciav@amd.com/
>> v1: https://lore.kernel.org/xen-devel/20250530120242.39398-1-agarciav@amd.com/
>> 
>> 
>> Alejandro Vallejo (11):
>>   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 bootinfo-independent functions to bootfdt.c
>>   xen/dt: Extract helper to map nodes to module kinds
>>   xen: Split HAS_DEVICE_TREE in two
>>   xen/dt: ifdef out DEV_DT-related bits from device_tree.{c,h}
>>   xen/dt: Allow CONFIG_DEVICE_TREE_PARSE to include device-tree/
>
> Pretty clearly, as per the build-each-commit job in CI, there must have been an
> issue in the middle of the series:

... I'm not sure what happened. Let me try to repro locally.

>
> In file included from ./arch/x86/include/asm/bootinfo.h:15,
>                  from arch/x86/cpu/microcode/core.c:37:
> ./arch/x86/include/asm/boot-domain.h:13:8: error: redefinition of 'struct boot_domain'
>    13 | struct boot_domain {
>       |        ^~~~~~~~~~~
> In file included from ./arch/x86/include/asm/bootinfo.h:11:
> ./include/xen/bootfdt.h:103:8: note: originally defined here
>   103 | struct boot_domain {
>       |        ^~~~~~~~~~~
>
> and similarly
>
> In file included from ./arch/x86/include/asm/bootinfo.h:15,
>                  from arch/x86/pv/dom0_build.c:17:
> ./arch/x86/include/asm/boot-domain.h:13:8: error: redefinition of 'struct boot_domain'
>    13 | struct boot_domain {
>       |        ^~~~~~~~~~~
> In file included from ./arch/x86/include/asm/bootinfo.h:11:
> ./include/xen/bootfdt.h:103:8: note: originally defined here
>   103 | struct boot_domain {
>       |        ^~~~~~~~~~~
>
> Jan

Cheers,
Alejandro