Fine granular configuration
cover Fine granular configuration
This serie aims to add more modularity to some feature that can be excluded without issues from the build.
The first patch is already reviewed.
Luca Fancellu (5):
arm/gicv2: make GICv2 driver and vGICv2 optional xen/arm: Add asm/domain.h include to kernel.h arm/dom0less: put dom0less feature code in a separate module xen/arm: Move static memory build code in separate modules arm/dom0less: introduce Kconfig for dom0less feature
xen/arch/arm/Kconfig | 28 + xen/arch/arm/Makefile | 7 +- xen/arch/arm/bootfdt.c | 161 +- xen/arch/arm/dom0less-build.c | 1086 ++++++ xen/arch/arm/domain_build.c | 4096 ++++++--------------- xen/arch/arm/efi/efi-boot.h | 4 + xen/arch/arm/gic-v3.c | 4 + xen/arch/arm/include/asm/dom0less-build.h | 35 + xen/arch/arm/include/asm/domain_build.h | 33 + xen/arch/arm/include/asm/kernel.h | 1 + xen/arch/arm/include/asm/setup.h | 1 - xen/arch/arm/include/asm/static-memory.h | 50 + xen/arch/arm/include/asm/static-shmem.h | 72 + xen/arch/arm/setup.c | 58 +- xen/arch/arm/static-memory.c | 294 ++ xen/arch/arm/static-shmem.c | 515 +++ xen/arch/arm/vgic.c | 2 + xen/arch/arm/vgic/Makefile | 4 +- 18 files changed, 3357 insertions(+), 3094 deletions(-) create mode 100644 xen/arch/arm/dom0less-build.c create mode 100644 xen/arch/arm/include/asm/dom0less-build.h create mode 100644 xen/arch/arm/include/asm/static-memory.h create mode 100644 xen/arch/arm/include/asm/static-shmem.h create mode 100644 xen/arch/arm/static-memory.c create mode 100644 xen/arch/arm/static-shmem.c
Signature · 1 line
2.34.1
PATCH 1/5 arm/gicv2: make GICv2 driver and vGICv2 optional
Introduce Kconfig GICV2 to be able to compile the GICv2 driver only when needed, the option is active by default.
Introduce Kconfig VGICV2 that compiles the Generic Interrupt Controller v2 emulation for domains, it is required only when using GICv2 driver, otherwise using the GICv3 driver it is optional and can be deselected if the user doesn't want to offer the v2 emulation to domains or maybe its GICv3 hardware can't offer the GICv2 compatible mode.
--- xen/arch/arm/Kconfig | 19 +++++++++++++++++++ xen/arch/arm/Makefile | 4 ++-- xen/arch/arm/domain_build.c | 4 ++++ xen/arch/arm/gic-v3.c | 4 ++++ xen/arch/arm/vgic.c | 2 ++ xen/arch/arm/vgic/Makefile | 4 ++-- 6 files changed, 33 insertions(+), 4 deletions(-)
xen/arch/arm/Kconfig +19 -0
@@ -78,6 +78,14 @@ config ARM_EFI UEFI firmware. A UEFI stub is provided to allow Xen to be booted as an EFI application. +config GICV2 + bool "GICv2 driver" + default y + select VGICV2 + help + Driver for the ARM Generic Interrupt Controller v2. + If unsure, say Y + config GICV3 bool "GICv3 driver" depends on !NEW_VGIC
@@ -92,11 +100,22 @@ config HAS_ITS bool "GICv3 ITS MSI controller support (UNSUPPORTED)" if UNSUPPORTED depends on GICV3 && !NEW_VGIC && !ARM_32 +config VGICV2 + bool "vGICv2 interface for domains" + default y + help + Allow Xen to expose a Generic Interrupt Controller version 2 like to Xen + domains. This can be configured at the domain creation. + This option is mandatory when using GICv2. + For GICv3, this allows domain to use GICv2 when the hardware supports it. + If unsure say Y. + config HVM def_bool y config NEW_VGIC bool "Use new VGIC implementation" + select GICV2 ---help--- This is an alternative implementation of the ARM GIC interrupt
xen/arch/arm/Makefile +2 -2
@@ -22,7 +22,7 @@ obj-y += domctl.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o obj-y += efi/ obj-y += gic.o -obj-y += gic-v2.o +obj-$(CONFIG_GICV2) += gic-v2.o obj-$(CONFIG_GICV3) += gic-v3.o obj-$(CONFIG_HAS_ITS) += gic-v3-its.o obj-$(CONFIG_HAS_ITS) += gic-v3-lpi.o
@@ -57,7 +57,7 @@ obj-$(CONFIG_NEW_VGIC) += vgic/ ifneq ($(CONFIG_NEW_VGIC),y) obj-y += gic-vgic.o obj-y += vgic.o -obj-y += vgic-v2.o +obj-$(CONFIG_VGICV2) += vgic-v2.o obj-$(CONFIG_GICV3) += vgic-v3.o obj-$(CONFIG_HAS_ITS) += vgic-v3-its.o endif
xen/arch/arm/domain_build.c +4 -0
@@ -2775,6 +2775,7 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo,return res; } +#ifdef CONFIG_VGICV2 static int __init make_gicv2_domU_node (struct kernel_info *kinfo) {void *fdt = kinfo->fdt;
@@ -2826,6 +2827,7 @@ static int __init make_gicv2_domU_node(struct kernel_info *kinfo) return res; } +#endif #ifdef CONFIG_GICV3 static int __init make_gicv3_domU_node (struct kernel_info *kinfo)
@@ -2901,8 +2903,10 @@ static int __init make_gic_domU_node(struct kernel_info *kinfo)case GIC_V3 :return make_gicv3_domU_node (kinfo);#endif +#ifdef CONFIG_VGICV2 case GIC_V2 :return make_gicv2_domU_node (kinfo); +#endif default :panic ("Unsupported GIC version\n" ); }
xen/arch/arm/gic-v3.c +4 -0
@@ -1334,6 +1334,7 @@ static paddr_t __initdata dbase = INVALID_PADDR;static paddr_t __initdata vbase =INVALID_PADDR , vsize =0 ;static paddr_t __initdata cbase =INVALID_PADDR , csize =0 ; +#ifdef CONFIG_VGICV2 /* If the GICv3 supports GICv2, initialize it */ static void __init gicv3_init_v2 (void ) {
@@ -1359,6 +1360,9 @@ static void __init gicv3_init_v2(void) vgic_v2_setup_hw(dbase, cbase, csize, vbase, 0); } +#else +static inline void gicv3_init_v2 (void ) { } +#endif static void __init gicv3_ioremap_distributor (paddr_t dist_paddr) {
xen/arch/arm/vgic.c +2 -0
@@ -95,10 +95,12 @@ int domain_vgic_register(struct domain *d, int *mmio_count)return -ENODEV ;break ;#endif +#ifdef CONFIG_VGICV2 case GIC_V2 :if (vgic_v2_init (d, mmio_count) )return -ENODEV ;break ; +#endif default :printk (XENLOG_G_ERR "d%d: Unknown vGIC version %u\n" , d->domain_id, d->arch.vgic.version);
xen/arch/arm/vgic/Makefile +2 -2
@@ -1,5 +1,5 @@ obj-y += vgic.o -obj-y += vgic-v2.o +obj-$(CONFIG_VGICV2) += vgic-v2.o obj-y += vgic-mmio.o -obj-y += vgic-mmio-v2.o +obj-$(CONFIG_VGICV2) += vgic-mmio-v2.o obj-y += vgic-init.o
Signature · 1 line
2.34.1
PATCH 2/5 xen/arm: Add asm/domain.h include to kernel.h
In reply to Luca FancelluAdd asm/domain.h that is defining the type 'enum domain_type', it is needed on arm64 build where this type is used for a member of the structure kernel_info.
--- xen/arch/arm/include/asm/kernel.h | 1 + 1 file changed, 1 insertion(+)
xen/arch/arm/include/asm/kernel.h +1 -0
@@ -7,6 +7,7 @@#define __ARCH_ARM_KERNEL_H__#include <xen/device_tree.h> +#include <asm/domain.h> #include <asm/setup.h> /*
Signature · 1 line
2.34.1
Re: [PATCH 2/5] xen/arm: Add asm/domain.h include to kernel.h
Hi Luca,
Quoted 3 lines · Luca Fancellu
Add
asm/domain.hthat is defining the type 'enumdomain_type', it is needed on arm64 build where this type is used for a member of the structurekernel_info.
I read "needed" as in it Xen build is broken. But AFAIK, this is more a latent issue if someone else want to include the header. Is that correct?
If so, how about:
The 'enum domain_type' is defined by 'asm/domain.h' which is not included (directly or indirectly) by 'asm/kernel.h'.
This currently doesn't break the compilation because asm/domain.h will included by the user of 'kernel.h'. But it would be better to avoid relying on it. So add the include in 'asm/domain.h'.
Quoted 1 line
Fixes 66e994a5e74f ("xen: arm64: add guest type to domain field.")
While we aim to have header self-contained, this has never been a guarantee in Xen. So I would argue this is not a fix in the sense it someone would want to ingest it in there tree.
Cheers,
Quoted 17 lines
Signed-off-by Luca Fancellu <[email protected]>--- xen/arch/arm/include/asm/kernel.h | 1 + 1 file changed, 1 insertion(+)xen/arch/arm/include/asm/kernel.h +1
-0@@ -7,6 +7,7 @@#define __ARCH_ARM_KERNEL_H__#include <xen/device_tree.h> +#include <asm/domain.h> #include <asm/setup.h> /*
Signature · 1 line
Julien Grall
Re: [PATCH 2/5] xen/arm: Add asm/domain.h include to kernel.h
Quoted 12 lines · Julien Grall
Hi Luca,
Quoted 3 lines · Luca Fancellu
Add
asm/domain.hthat is defining the type 'enumdomain_type', it is needed on arm64 build where this type is used for a member of the structurekernel_info.I read "needed" as in it Xen build is broken. But AFAIK, this is more a latent issue if someone else want to include the header. Is that correct?
Yes correct
Quoted 6 lines
If so, how about:
The 'enum
domain_type' is defined by 'asm/domain.h' which is not included (directly or indirectly) by 'asm/kernel.h'.This currently doesn't break the compilation because
asm/domain.hwill included by the user of 'kernel.h'. But it would be better to avoid relying on it. So add the include in 'asm/domain.h'.
Yeah much better, should I push a v2?
Quoted 4 lines
Quoted 2 lines
Fixes 66e994a5e74f ("xen: arm64: add guest type to domain field.")While we aim to have header self-contained, this has never been a guarantee in Xen. So I would argue this is not a fix in the sense it someone would want to ingest it in there tree.
Ok I see, I thought it could be linked to the issue about sorting headers that led to build breakage, but I’ve not investigated further so I would be ok to drop the Fixes:
Quoted 20 lines
Cheers,
Quoted 14 lines
Signed-off-by Luca Fancellu <[email protected]>--- xen/arch/arm/include/asm/kernel.h | 1 + 1 file changed, 1 insertion(+)xen/arch/arm/include/asm/kernel.h +1
-0@@ -7,6 +7,7 @@#define __ARCH_ARM_KERNEL_H__#include <xen/device_tree.h> +#include <asm/domain.h> #include <asm/setup.h> /* Signature · 1 line
Julien Grall
Re: [PATCH 2/5] xen/arm: Add asm/domain.h include to kernel.h
Hi Luca,
Quoted 16 lines · Luca Fancellu
Quoted 12 lines · Julien Grall
Hi Luca,
Quoted 3 lines · Luca Fancellu
Add
asm/domain.hthat is defining the type 'enumdomain_type', it is needed on arm64 build where this type is used for a member of the structurekernel_info.I read "needed" as in it Xen build is broken. But AFAIK, this is more a latent issue if someone else want to include the header. Is that correct?
Yes correct
Quoted 1 line
Quoted 7 lines
Quoted 5 lines
If so, how about:
The 'enum
domain_type' is defined by 'asm/domain.h' which is not included (directly or indirectly) by 'asm/kernel.h'.This currently doesn't break the compilation because
asm/domain.hwill included by the user of 'kernel.h'. But it would be better to avoid relying on it. So add the include in 'asm/domain.h'.Yeah much better, should I push a v2?
No. I can deal with it on commit.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Fixes 66e994a5e74f ("xen: arm64: add guest type to domain field.")While we aim to have header self-contained, this has never been a guarantee in Xen. So I would argue this is not a fix in the sense it someone would want to ingest it in there tree.
Ok I see, I thought it could be linked to the issue about sorting headers that led to build breakage, but I’ve
I am probably missing something here. Which issue are you referring to? Is it a follow-up patch that will sort headers?
Quoted 1 line
not investigated further so I would be ok to drop the Fixes:
Cheers,
Signature · 1 line
Julien Grall
Re: [PATCH 2/5] xen/arm: Add asm/domain.h include to kernel.h
Quoted 19 lines · Julien Grall
Hi Luca,
Quoted 12 lines · Luca Fancellu
Quoted 10 lines · Julien Grall
Hi Luca,
Quoted 3 lines · Luca Fancellu
Add
asm/domain.hthat is defining the type 'enumdomain_type', it is needed on arm64 build where this type is used for a member of the structurekernel_info.I read "needed" as in it Xen build is broken. But AFAIK, this is more a latent issue if someone else want to include the header. Is that correct?
Yes correct
Quoted 1 line
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
If so, how about:
The 'enum
domain_type' is defined by 'asm/domain.h' which is not included (directly or indirectly) by 'asm/kernel.h'.This currently doesn't break the compilation because
asm/domain.hwill included by the user of 'kernel.h'. But it would be better to avoid relying on it. So add the include in 'asm/domain.h'.Yeah much better, should I push a v2?
No. I can deal with it on commit.
Ok thank you for doing that
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
Fixes 66e994a5e74f ("xen: arm64: add guest type to domain field.")While we aim to have header self-contained, this has never been a guarantee in Xen. So I would argue this is not a fix in the sense it someone would want to ingest it in there tree.
Ok I see, I thought it could be linked to the issue about sorting headers that led to build breakage, but I’ve
I am probably missing something here. Which issue are you referring to? Is it a follow-up patch that will sort headers?
It’s an issue I’ve faced when trying to sort automatically the include using clang-format, I’ve seen issues building domain_build.c after sorting the headers in the way we expect from coding style, I thought was related to some headers not being self-contained.
Quoted 7 lines
Quoted 2 lines
not investigated further so I would be ok to drop the Fixes:
Cheers,
Signature · 1 line
Julien Grall
Re: [PATCH 2/5] xen/arm: Add asm/domain.h include to kernel.h
Hi,
Quoted 27 lines · Luca Fancellu
Quoted 14 lines · Julien Grall
Quoted 12 lines · Luca Fancellu
Quoted 10 lines · Julien Grall
Hi Luca,
Quoted 3 lines · Luca Fancellu
Add
asm/domain.hthat is defining the type 'enumdomain_type', it is needed on arm64 build where this type is used for a member of the structurekernel_info.I read "needed" as in it Xen build is broken. But AFAIK, this is more a latent issue if someone else want to include the header. Is that correct?
Yes correct
Quoted 1 line
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
If so, how about:
The 'enum
domain_type' is defined by 'asm/domain.h' which is not included (directly or indirectly) by 'asm/kernel.h'.This currently doesn't break the compilation because
asm/domain.hwill included by the user of 'kernel.h'. But it would be better to avoid relying on it. So add the include in 'asm/domain.h'.Yeah much better, should I push a v2?
No. I can deal with it on commit.
Ok thank you for doing that
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
Quoted 1 line
Fixes 66e994a5e74f ("xen: arm64: add guest type to domain field.")While we aim to have header self-contained, this has never been a guarantee in Xen. So I would argue this is not a fix in the sense it someone would want to ingest it in there tree.
Ok I see, I thought it could be linked to the issue about sorting headers that led to build breakage, but I’ve
I am probably missing something here. Which issue are you referring to? Is it a follow-up patch that will sort headers?
It’s an issue I’ve faced when trying to sort automatically the include using clang-format, I’ve seen issues building
domain_build.cafter sorting the headers in the way we expect from coding style, I thought was related to some headers not being self-contained.
Ah I understand now. Usually, we would batch the re-ordering and the additional include in the same patch because they are tightly coupled together and it is easier to confirm it is necessary.
Anyway, this one is easy, so I am happy to commit this one in advance.
Cheers,
Signature · 1 line
Julien Grall
PATCH 3/5 arm/dom0less: put dom0less feature code in a separate module
In reply to Luca FancelluCurrently the dom0less feature code is mostly inside domain_build.c and setup.c, it is a feature that may not be useful to everyone so put the code in a different compilation module in order to make it easier to disable the feature in the future.
Move gic_interrupt_t in domain_build.h to use it with the function declaration, move its comment above the declaration.
The following functions are now visible externally from domain_build because they are used also from the dom0less-build module:
- get_allocation_size
- set_interrupt
- domain_fdt_begin_node
- make_memory_node
- make_resv_memory_node
- make_hypervisor_node
- make_psci_node
- make_cpus_node
- make_timer_node
- handle_device_interrupts
- construct_domain
The following function were static in domain_build but they are now externally visible and moved to dom0less-build module because they are used from both modules:
- process_shm
- make_shm_memory_node
Move init_staticmem_pages and is_dom0less_mode from setup.c to dom0less-build.c and make them externally visible so that they can be used from outside.
No functional change is intended.
--- xen/arch/arm/Makefile | 1 + xen/arch/arm/dom0less-build.c | 1728 +++++++++ xen/arch/arm/domain_build.c | 4096 ++++++--------------- xen/arch/arm/include/asm/dom0less-build.h | 30 + xen/arch/arm/include/asm/domain_build.h | 33 + xen/arch/arm/include/asm/setup.h | 1 - xen/arch/arm/setup.c | 57 +- 7 files changed, 3016 insertions(+), 2930 deletions(-) create mode 100644 xen/arch/arm/dom0less-build.c create mode 100644 xen/arch/arm/include/asm/dom0less-build.h
xen/arch/arm/Makefile +1 -0
@@ -15,6 +15,7 @@ obj-y += cpufeature.o obj-y += decode.o obj-y += device.o obj-$(CONFIG_IOREQ_SERVER) += dm.o +obj-y += dom0less-build.init.o obj-y += domain.o obj-y += domain_build.init.o obj-$(CONFIG_ARCH_MAP_DOMAIN_PAGE) += domain_page.o
xen/arch/arm/dom0less-build.c new file +1728 -0
1,728 lines not on this page · raw message
xen/arch/arm/domain_build.c +1223 -2873
1,265 lines not on this page · raw message
xen/arch/arm/include/asm/dom0less-build.h new file +30 -0
Lines of this file are not shown. View the raw message.
xen/arch/arm/include/asm/domain_build.h +33 -0
Lines of this file are not shown. View the raw message.
xen/arch/arm/setup.c +1 -56
57 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.34.1
Part of the diff is not shown here. View the raw message.
PATCH 4/5 xen/arm: Move static memory build code in separate modules
In reply to Luca FancelluMove static memory and static shared memory code in separate modules so that they are included only when the corresponding feature is enabled, doing that we modularise the features and we remove some ifdefs from the code to improve readability.
Move process_shm_node function from bootfdt module and make it externally visible.
The visibility of the functions allocate_static_memory and assign_static_memory_11 is changed during the move from the dom0less-build module to the static-memory module, now they are externally visible.
A static inline helper called process_shm_chosen is introduced, it will call the process_shm function for the '/chosen' node, and will be used by the funciton construct_dom0 instead of using directly process_shm, allowing some #ifdef to be removed.
No functional changes are intended.
--- xen/arch/arm/Makefile | 2 + xen/arch/arm/bootfdt.c | 161 +----- xen/arch/arm/dom0less-build.c | 646 +--------------------- xen/arch/arm/domain_build.c | 8 +- xen/arch/arm/include/asm/dom0less-build.h | 7 - xen/arch/arm/include/asm/static-memory.h | 50 ++ xen/arch/arm/include/asm/static-shmem.h | 72 +++ xen/arch/arm/setup.c | 1 + xen/arch/arm/static-memory.c | 294 ++++++++++ xen/arch/arm/static-shmem.c | 515 +++++++++++++++++ 10 files changed, 939 insertions(+), 817 deletions(-) create mode 100644 xen/arch/arm/include/asm/static-memory.h create mode 100644 xen/arch/arm/include/asm/static-shmem.h create mode 100644 xen/arch/arm/static-memory.c create mode 100644 xen/arch/arm/static-shmem.c
xen/arch/arm/Makefile +2 -0
@@ -50,6 +50,8 @@ obj-y += setup.o obj-y += shutdown.o obj-y += smp.o obj-y += smpboot.o +obj-$(CONFIG_STATIC_MEMORY) += static-memory.init.o +obj-$(CONFIG_STATIC_SHM) += static-shmem.init.o obj-y += sysctl.o obj-y += time.o obj-y += traps.o
xen/arch/arm/bootfdt.c +1 -160
173 lines not on this page · raw message
xen/arch/arm/dom0less-build.c +2 -644
667 lines not on this page · raw message
xen/arch/arm/domain_build.c +2 -6
@@ -30,6 +30,7 @@#include <asm/cpufeature.h> #include <asm/dom0less-build.h> #include <asm/domain_build.h> +#include <asm/static-shmem.h> #include <xen/event.h> #include <xen/irq.h>
@@ -2444,9 +2445,6 @@ static int __init construct_dom0(struct domain *d) {struct kernel_info kinfo = {};int rc; -#ifdef CONFIG_STATIC_SHM -const struct dt_device_node *chosen =dt_find_node_by_path ("/chosen" ); -#endif /* Sanity! */ BUG_ON (d->domain_id !=0 );
@@ -2481,11 +2479,9 @@ static int __init construct_dom0(struct domain *d)allocate_memory_11 (d, &kinfo);find_gnttab_region (d, &kinfo); -#ifdef CONFIG_STATIC_SHM - rc =process_shm (d, &kinfo, chosen); + rc =process_shm_chosen (d, &kinfo);if ( rc <0 )return rc; -#endif /* Map extra GIC MMIO, irqs and other hw stuffs to dom0. */ rc =gic_map_hwdom_extra_mappings (d);
xen/arch/arm/include/asm/dom0less-build.h +0 -7
@@ -8,15 +8,8 @@#ifndef __ARM_DOM0LESS_BUILD_H_#define __ARM_DOM0LESS_BUILD_H_ -#include <asm/kernel.h> -void create_domUs (void ); -void init_staticmem_pages (void );bool is_dom0less_mode (void ); -int make_shm_memory_node (const struct domain *d,void *fdt,int addrcells, -int sizecells,const struct meminfo *mem); -int process_shm (struct domain *d,struct kernel_info *kinfo, -const struct dt_device_node *node);#endif /* __ARM_DOM0LESS_BUILD_H_ */
xen/arch/arm/include/asm/static-memory.h new file +50 -0
50 lines not on this page · raw message
xen/arch/arm/include/asm/static-shmem.h new file +72 -0
72 lines not on this page · raw message
xen/arch/arm/setup.c +1 -0
@@ -43,6 +43,7 @@#include <asm/platform.h> #include <asm/procinfo.h> #include <asm/setup.h> +#include <asm/static-memory.h> #include <xsm/xsm.h> #include <asm/acpi.h>
xen/arch/arm/static-memory.c new file +294 -0
294 lines not on this page · raw message
xen/arch/arm/static-shmem.c new file +515 -0
515 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH 4/5] xen/arm: Move static memory build code in separate modules
Hi Luca,
On IRC, you suggest to skip the review for the patches moving out some code. However, I still have one remark.
Quoted 18 lines · Luca Fancellu
Move static memory and static shared memory code in separate modules so that they are included only when the corresponding feature is enabled, doing that we modularise the features and we remove some ifdefs from the code to improve readability.
Move
process_shm_nodefunction from bootfdt module and make it externally visible.The visibility of the functions
allocate_static_memoryandassign_static_memory_11is changed during the move from the dom0less-build module to the static-memory module, now they are externally visible.A static inline helper called
process_shm_chosenis introduced, it will call theprocess_shmfunction for the '/chosen' node, and will be used by the funcitonconstruct_dom0instead of using directlyprocess_shm, allowing some #ifdef to be removed.
Quoted 7 lines
No functional changes are intended.
Signed-off-by Luca Fancellu <[email protected]>--- xen/arch/arm/Makefile | 2 + xen/arch/arm/bootfdt.c | 161 +----- xen/arch/arm/dom0less-build.c | 646 +---------------------
This file was created in the previous patch but now you are moving out the code again. Please try to move the code only once within the series to ease the review.
Cheers,
Signature · 1 line
Julien Grall
Re: [PATCH 4/5] xen/arm: Move static memory build code in separate modules
Hi Julien,
Quoted 28 lines · Julien Grall
Hi Luca,
On IRC, you suggest to skip the review for the patches moving out some code. However, I still have one remark.
Quoted 15 lines · Luca Fancellu
Move static memory and static shared memory code in separate modules so that they are included only when the corresponding feature is enabled, doing that we modularise the features and we remove some ifdefs from the code to improve readability.
Moveprocess_shm_nodefunction from bootfdt module and make it externally visible.
The visibility of the functionsallocate_static_memoryandassign_static_memory_11is changed during the move from the dom0less-build module to the static-memory module, now they are externally visible.
A static inline helper calledprocess_shm_chosenis introduced, it will call theprocess_shmfunction for the '/chosen' node, and will be used by the funcitonconstruct_dom0instead of using directlyprocess_shm, allowing some #ifdef to be removed.
No functional changes are intended.Quoted 5 lines
Signed-off-by Luca Fancellu <[email protected]>--- xen/arch/arm/Makefile | 2 + xen/arch/arm/bootfdt.c | 161 +----- xen/arch/arm/dom0less-build.c | 646 +---------------------
Quoted 1 line
This file was created in the previous patch but now you are moving out the code again. Please try to move the code only once within the series to ease the review.
Sure, in the next push I will do the moving to different modules in one patch.
Quoted 5 lines
Cheers,
Signature · 1 line
Julien Grall
PATCH 5/5 arm/dom0less: introduce Kconfig for dom0less feature
In reply to Luca FancelluIntroduce a Kconfig for the dom0less feature, enabled by default, to be able to choose if the feature should be compiled or not.
Provide static inline stubs when the option is disabled for the functions externally visible.
Use the new Kconfig to remove dom0less DT binding from the efi-boot.h code when the Kconfig is not enabled.
--- xen/arch/arm/Kconfig | 9 +++++++++ xen/arch/arm/Makefile | 2 +- xen/arch/arm/efi/efi-boot.h | 4 ++++ xen/arch/arm/include/asm/dom0less-build.h | 12 ++++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-)
xen/arch/arm/Kconfig +9 -0
@@ -86,6 +86,15 @@ config GICV2 Driver for the ARM Generic Interrupt Controller v2. If unsure, say Y +config DOM0LESS_BOOT + bool "Dom0less boot support" if EXPERT + depends on ARM + default y + help + Dom0less boot support enables Xen to create and start domU guests during + Xen boot without the need of a control domain (Dom0), which could be + present anyway. + config GICV3 bool "GICv3 driver" depends on !NEW_VGIC
xen/arch/arm/Makefile +1 -1
@@ -15,7 +15,7 @@ obj-y += cpufeature.o obj-y += decode.o obj-y += device.o obj-$(CONFIG_IOREQ_SERVER) += dm.o -obj-y += dom0less-build.init.o +obj-$(CONFIG_DOM0LESS_BOOT) += dom0less-build.init.o obj-y += domain.o obj-y += domain_build.init.o obj-$(CONFIG_ARCH_MAP_DOMAIN_PAGE) += domain_page.o
xen/arch/arm/efi/efi-boot.h +4 -0
@@ -802,6 +802,7 @@ static int __init handle_module_node(const EFI_LOADED_IMAGE *loaded_image,return 1 ; } +#ifdef CONFIG_DOM0LESS_BOOT /* * This function checks for boot modules under the domU guest domain node * in the DT.
@@ -849,6 +850,7 @@ static int __init handle_dom0less_domain_node(const EFI_LOADED_IMAGE *loaded_ima return mb_modules_found; } +#endif /* * This function checks for xen domain nodes under the /chosen node for possible
@@ -876,6 +878,7 @@ static int __init efi_check_dt_boot(const EFI_LOADED_IMAGE *loaded_image) {int ret; +#ifdef CONFIG_DOM0LESS_BOOT if ( !fdt_node_check_compatible (fdt_efi, node,"xen,domain" ) ) {/* Found a node with compatible xen,domain; handle this node. */
@@ -884,6 +887,7 @@ static int __init efi_check_dt_boot(const EFI_LOADED_IMAGE *loaded_image) return ERROR_DT_MODULE_DOMU; } else +#endif { ret =handle_module_node (loaded_image, &dir_handle, node, addr_len, size_len, false);
xen/arch/arm/include/asm/dom0less-build.h +12 -0
@@ -8,9 +8,21 @@#ifndef __ARM_DOM0LESS_BUILD_H_#define __ARM_DOM0LESS_BUILD_H_ +#ifdef CONFIG_DOM0LESS_BOOT +void create_domUs (void );bool is_dom0less_mode (void ); +#else /* !CONFIG_DOM0LESS_BOOT */ + +static inline void create_domUs (void ) {} +static inline bool is_dom0less_mode (void ) +{ +return false; +} + +#endif /* CONFIG_DOM0LESS_BOOT */ +#endif /* __ARM_DOM0LESS_BUILD_H_ */ /*
Signature · 1 line
2.34.1
Moving Dom0less to common, Was: [PATCH 0/5] Fine granular configuration
In reply to Luca FancelluAdding hyperlaunch and x86 maintainers.
Hi Luca,
This patch series is very timely. You might not have realized but we were just discussing with the hyperlaunch guys to move dom0less code to common.
Your series is a great step in the right direction. However, we don't want to move the dom0less code twice because it would make 'git blame' very hard to use.
I wonder if I could ask you to move the code to xen/common/ instead. I am not asking you to make it buildable on x86, as that would take more work and also something along the lines of this patch series from Christopher:
https://patchew.org/Xen/[email protected]/
The new code could be protected by CONFIG_DOM0LESS, and CONFIG_DOM0LESS could only be selectable on ARM, not on x86.
Would you be OK with doing some extra work to move it to xen/common instead?
Would the x86 maintainers be OK with it too? Of course further changes will be needed to make it useable on x86, but looking at the series from Christopher, the two sets of internal interfaces (dom0less/ARM and hyperlaunch/x86) are very much aligned and similar already.
Cheers,
Stefano
Quoted 41 lines · Luca Fancellu
This serie aims to add more modularity to some feature that can be excluded without issues from the build.
The first patch is already reviewed.
Luca Fancellu (5):
arm/gicv2: make GICv2 driver and vGICv2 optional xen/arm: Addasm/domain.hinclude tokernel.harm/dom0less: put dom0less feature code in a separate module xen/arm: Move static memory build code in separate modules arm/dom0less: introduceKconfigfor dom0less featurexen/arch/arm/Kconfig | 28 + xen/arch/arm/Makefile | 7 +- xen/arch/arm/bootfdt.c | 161 +- xen/arch/arm/dom0less-build.c | 1086 ++++++ xen/arch/arm/domain_build.c | 4096 ++++++--------------- xen/arch/arm/efi/efi-boot.h | 4 + xen/arch/arm/gic-v3.c | 4 + xen/arch/arm/include/asm/dom0less-build.h | 35 + xen/arch/arm/include/asm/domain_build.h | 33 + xen/arch/arm/include/asm/kernel.h | 1 + xen/arch/arm/include/asm/setup.h | 1 - xen/arch/arm/include/asm/static-memory.h | 50 + xen/arch/arm/include/asm/static-shmem.h | 72 + xen/arch/arm/setup.c | 58 +- xen/arch/arm/static-memory.c | 294 ++ xen/arch/arm/static-shmem.c | 515 +++ xen/arch/arm/vgic.c | 2 + xen/arch/arm/vgic/Makefile | 4 +- 18 files changed, 3357 insertions(+), 3094 deletions(-) create mode 100644 xen/arch/arm/dom0less-build.c create mode 100644 xen/arch/arm/include/asm/dom0less-build.h create mode 100644 xen/arch/arm/include/asm/static-memory.h create mode 100644 xen/arch/arm/include/asm/static-shmem.h create mode 100644 xen/arch/arm/static-memory.c create mode 100644 xen/arch/arm/static-shmem.cSignature · 1 line
2.34.1
Re: Moving Dom0less to common, Was: [PATCH 0/5] Fine granular configuration
Quoted 15 lines · Stefano Stabellini
Adding hyperlaunch and x86 maintainers.
Hi Luca,
This patch series is very timely. You might not have realized but we were just discussing with the hyperlaunch guys to move dom0less code to common.
Your series is a great step in the right direction. However, we don't want to move the dom0less code twice because it would make 'git blame' very hard to use.
Quoted 5 lines
I wonder if I could ask you to move the code to xen/common/ instead. I am not asking you to make it buildable on x86, as that would take more work and also something along the lines of this patch series from Christopher:
https://patchew.org/Xen/[email protected]/
The question is whether we want to move everything related to dom0less parse/build to common. There are parts that make sense only for Arm. Also, a plain move might not be what hyperlaunch wants and what Daniel described in his plans for the future. FWIU, hyperlaunch wants to operate on flattened device tree whereas the majority of dom0less build/parse code is done using unflattened device tree (FDT is used at the very early stage of the boot and is contained in bootfdt.c). Maintaining two sets of parsers is not the best idea.
@Daniel,Christopher, what is the reason of using FDT and not DT on hyperlaunch? Is is because there are parts of configuration that you want to probe early (e.g. XSM module)?
~Michal
Re: Moving Dom0less to common, Was: [PATCH 0/5] Fine granular configuration
In reply to Stefano StabelliniQuoted 4 lines · Stefano Stabellini
Would the x86 maintainers be OK with it too? Of course further changes will be needed to make it useable on x86, but looking at the series from Christopher, the two sets of internal interfaces (dom0less/ARM and hyperlaunch/x86) are very much aligned and similar already.
Moving common code to common/ is surely okay with me. How much wants moving is (apparently) a different question.
Jan
Re: Moving Dom0less to common, Was: [PATCH 0/5] Fine granular configuration
Quoted 12 lines · Jan Beulich
Quoted 4 lines · Stefano Stabellini
Would the x86 maintainers be OK with it too? Of course further changes will be needed to make it useable on x86, but looking at the series from Christopher, the two sets of internal interfaces (dom0less/ARM and hyperlaunch/x86) are very much aligned and similar already.
Moving common code to common/ is surely okay with me. How much wants moving is (apparently) a different question.
Would x86 maintainers (and who is taking care of common/) be ok for the dom0less code to be part of common/ but in this first stage be protected by a dependency on the Kconfig ARM?
In a second stage the hyperlaunch people would do the proper modification to use the common boot modules to delete that dependency.
Provided that we have an answer for the question Michal raised.
Cheers,
Luca
Re: Moving Dom0less to common, Was: [PATCH 0/5] Fine granular configuration
Quoted 7 lines · Luca Fancellu
Quoted 7 lines · Jan Beulich
Quoted 4 lines · Stefano Stabellini
Would the x86 maintainers be OK with it too? Of course further changes will be needed to make it useable on x86, but looking at the series from Christopher, the two sets of internal interfaces (dom0less/ARM and hyperlaunch/x86) are very much aligned and similar already.
Quoted 6 lines
Quoted 2 lines
Moving common code to common/ is surely okay with me. How much wants moving is (apparently) a different question.
Would x86 maintainers (and who is taking care of common/) be ok for the dom0less code to be part of common/ but in this first stage be protected by a dependency on the
KconfigARM?
It's actually more than just being okay with this: I wouldn't be okay with there not being such a guard, as then x86 binaries would carry dead code.
Jan