[PATCH v4 12/12] xen/dt: Remove DOM0LESS_BOOT's requirement on HAS_DEVICE_TREE_DISCOVERY

Alejandro Vallejo posted 12 patches 4 months, 1 week ago
There is a newer version of this series
[PATCH v4 12/12] xen/dt: Remove DOM0LESS_BOOT's requirement on HAS_DEVICE_TREE_DISCOVERY
Posted by Alejandro Vallejo 4 months, 1 week ago
This effectively means that DOM0LESS_BOOT on platforms without
HAS_DEVICE_TREE_DISCOVERY (i.e: x86) acts as a selector for a
stripped-down version of DT code.

Signed-off-by: Alejandro Vallejo <agarciav@amd.com>
---
 xen/Kconfig.debug               | 2 +-
 xen/common/Kconfig              | 3 ++-
 xen/common/Makefile             | 1 +
 xen/common/device-tree/Makefile | 8 ++++----
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
index 9192d593a7..89b0af53a2 100644
--- a/xen/Kconfig.debug
+++ b/xen/Kconfig.debug
@@ -92,7 +92,7 @@ config VERBOSE_DEBUG
 
 config DEVICE_TREE_DEBUG
 	bool "Device tree debug messages"
-	depends on HAS_DEVICE_TREE_DISCOVERY
+	depends on DOM0LESS_BOOT || HAS_DEVICE_TREE_DISCOVERY
 	help
 	  Device tree parsing and DOM0 device tree building messages are
 	  logged in the Xen ring buffer.
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 6294cd7939..1ac28a4e78 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -14,7 +14,8 @@ config CORE_PARKING
 
 config DOM0LESS_BOOT
 	bool "Dom0less boot support" if EXPERT
-	depends on HAS_DOM0LESS && HAS_DEVICE_TREE_DISCOVERY && DOMAIN_BUILD_HELPERS
+	select LIBFDT
+	depends on HAS_DOM0LESS && DOMAIN_BUILD_HELPERS
 	default y
 	help
 	  Dom0less boot support enables Xen to create and start domU guests during
diff --git a/xen/common/Makefile b/xen/common/Makefile
index d541fbcf49..19d6ff7a90 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_DEBUG_TRACE) += debugtrace.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += device.o
 obj-$(filter-out $(CONFIG_X86),$(CONFIG_ACPI)) += device.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += device-tree/
+obj-$(CONFIG_DOM0LESS_BOOT) += device-tree/
 obj-$(CONFIG_IOREQ_SERVER) += dm.o
 obj-y += domain.o
 obj-y += event_2l.o
diff --git a/xen/common/device-tree/Makefile b/xen/common/device-tree/Makefile
index 8abc069c4b..4a10b0508f 100644
--- a/xen/common/device-tree/Makefile
+++ b/xen/common/device-tree/Makefile
@@ -1,11 +1,11 @@
 obj-y += bootfdt.init.o
-obj-y += bootinfo-fdt.init.o
-obj-y += bootinfo.init.o
-obj-y += device-tree.o
+obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += bootinfo-fdt.init.o
+obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += bootinfo.init.o
+obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += device-tree.o
 obj-$(CONFIG_DOMAIN_BUILD_HELPERS) += domain-build.init.o
 obj-$(CONFIG_DOM0LESS_BOOT) += dom0less-build.init.o
 obj-$(CONFIG_OVERLAY_DTB) += dt-overlay.o
-obj-y += intc.o
+obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += intc.o
 obj-$(CONFIG_DOMAIN_BUILD_HELPERS) += kernel.o
 obj-$(CONFIG_STATIC_EVTCHN) += static-evtchn.init.o
 obj-$(CONFIG_STATIC_MEMORY) += static-memory.init.o
-- 
2.43.0
Re: [PATCH v4 12/12] xen/dt: Remove DOM0LESS_BOOT's requirement on HAS_DEVICE_TREE_DISCOVERY
Posted by Stefano Stabellini 4 months, 1 week ago
On Fri, 20 Jun 2025, Alejandro Vallejo wrote:
> This effectively means that DOM0LESS_BOOT on platforms without
> HAS_DEVICE_TREE_DISCOVERY (i.e: x86) acts as a selector for a
> stripped-down version of DT code.
> 
> Signed-off-by: Alejandro Vallejo <agarciav@amd.com>

This is so much better than before. Thank you and all the reviewers for
making the integration so much smoother. This patch is so much simpler
and readable compared to before.

I think we need to plan for renaming DOM0LESS_BOOT into something
better, such as PREDEFINED_DOMS, but I would keep it as a separate
patch in any case. So I think this is OK for now.

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  xen/Kconfig.debug               | 2 +-
>  xen/common/Kconfig              | 3 ++-
>  xen/common/Makefile             | 1 +
>  xen/common/device-tree/Makefile | 8 ++++----
>  4 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
> index 9192d593a7..89b0af53a2 100644
> --- a/xen/Kconfig.debug
> +++ b/xen/Kconfig.debug
> @@ -92,7 +92,7 @@ config VERBOSE_DEBUG
>  
>  config DEVICE_TREE_DEBUG
>  	bool "Device tree debug messages"
> -	depends on HAS_DEVICE_TREE_DISCOVERY
> +	depends on DOM0LESS_BOOT || HAS_DEVICE_TREE_DISCOVERY
>  	help
>  	  Device tree parsing and DOM0 device tree building messages are
>  	  logged in the Xen ring buffer.
> diff --git a/xen/common/Kconfig b/xen/common/Kconfig
> index 6294cd7939..1ac28a4e78 100644
> --- a/xen/common/Kconfig
> +++ b/xen/common/Kconfig
> @@ -14,7 +14,8 @@ config CORE_PARKING
>  
>  config DOM0LESS_BOOT
>  	bool "Dom0less boot support" if EXPERT
> -	depends on HAS_DOM0LESS && HAS_DEVICE_TREE_DISCOVERY && DOMAIN_BUILD_HELPERS
> +	select LIBFDT
> +	depends on HAS_DOM0LESS && DOMAIN_BUILD_HELPERS
>  	default y
>  	help
>  	  Dom0less boot support enables Xen to create and start domU guests during
> diff --git a/xen/common/Makefile b/xen/common/Makefile
> index d541fbcf49..19d6ff7a90 100644
> --- a/xen/common/Makefile
> +++ b/xen/common/Makefile
> @@ -9,6 +9,7 @@ obj-$(CONFIG_DEBUG_TRACE) += debugtrace.o
>  obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += device.o
>  obj-$(filter-out $(CONFIG_X86),$(CONFIG_ACPI)) += device.o
>  obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += device-tree/
> +obj-$(CONFIG_DOM0LESS_BOOT) += device-tree/

nice trick


>  obj-$(CONFIG_IOREQ_SERVER) += dm.o
>  obj-y += domain.o
>  obj-y += event_2l.o
> diff --git a/xen/common/device-tree/Makefile b/xen/common/device-tree/Makefile
> index 8abc069c4b..4a10b0508f 100644
> --- a/xen/common/device-tree/Makefile
> +++ b/xen/common/device-tree/Makefile
> @@ -1,11 +1,11 @@
>  obj-y += bootfdt.init.o
> -obj-y += bootinfo-fdt.init.o
> -obj-y += bootinfo.init.o
> -obj-y += device-tree.o
> +obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += bootinfo-fdt.init.o
> +obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += bootinfo.init.o
> +obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += device-tree.o
>  obj-$(CONFIG_DOMAIN_BUILD_HELPERS) += domain-build.init.o
>  obj-$(CONFIG_DOM0LESS_BOOT) += dom0less-build.init.o
>  obj-$(CONFIG_OVERLAY_DTB) += dt-overlay.o
> -obj-y += intc.o
> +obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += intc.o
>  obj-$(CONFIG_DOMAIN_BUILD_HELPERS) += kernel.o
>  obj-$(CONFIG_STATIC_EVTCHN) += static-evtchn.init.o
>  obj-$(CONFIG_STATIC_MEMORY) += static-memory.init.o
> -- 
> 2.43.0
>