Skip to contentSkip to conversation

arm/gicv2: make GICv2 driver and vGICv2 optional

RFC PATCH In review Luca Fancellu 3 participants 22 messages Aug 2, 2023 – Aug 3, 2023

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 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 depends on GICV2 or GICV3 and compiles the GICv2 emulation for guests, it is required only when using GICV2 driver, otherwise using GICV3 it is optional and can be deselected if the user doesn't want to offer the vGICv2 interface to guests or maybe its GICv3 hardware can't offer the GICv2 compatible mode.

---
 xen/arch/arm/Kconfig        | 13 +++++++++++++
 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 ++
 5 files changed, 25 insertions(+), 2 deletions(-)
xen/arch/arm/Kconfig +13 -0
index fd57a82dd284..dc702f08ace7 100644
@@ -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,6 +100,11 @@ 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 guests"
+	default y
+	depends on (GICV2 || GICV3) && !NEW_VGIC
+
 config HVM
         def_bool y
 
xen/arch/arm/Makefile +2 -2
index 7bf07e992046..81c31c36fc3d 100644
@@ -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
index 39b4ee03a505..b2b609eb0c2d 100644
@@ -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
index 95e4f020febe..d18a3317ccc4 100644
@@ -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
index 97d6f6106638..86fa8bc7e894 100644
@@ -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);
Signature · 1 line
2.34.1
#1 lore raw

Hi Luca,

Quoted 25 lines · Luca Fancellu

Introduce Kconfig GICV2 to be able to compile the GICv2 driver only when needed, the option is active by default.

Introduce Kconfig VGICV2 that depends on GICV2 or GICV3 and compiles the GICv2 emulation for guests, it is required only when using GICV2 driver, otherwise using GICV3 it is optional and can be deselected if the user doesn't want to offer the vGICv2 interface to guests or maybe its GICv3 hardware can't offer the GICv2 compatible mode.

---
 xen/arch/arm/Kconfig        | 13 +++++++++++++
 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 ++
 5 files changed, 25 insertions(+), 2 deletions(-)
xen/arch/arm/Kconfig +0 -0
index fd57a82dd284..dc702f08ace7 100644

xen/arch/arm/Kconfig config ARM_EFI · line 81

Quoted 4 lines
xen/arch/arm/Kconfig +1 -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

So, now it would be possible to deselect both GIC drivers and Xen would not complain when building. This means that Xen would fail on boot without any message as it happens before serial driver initialization. Since having GIC driver built in is a must-have I think we need to make sure that at least one is enabled.

~Michal

#2 lore raw
Quoted 35 lines · Michal Orzel

Hi Luca,

Quoted 28 lines · Luca Fancellu

Introduce Kconfig GICV2 to be able to compile the GICv2 driver only when needed, the option is active by default.

Introduce Kconfig VGICV2 that depends on GICV2 or GICV3 and compiles the GICv2 emulation for guests, it is required only when using GICV2 driver, otherwise using GICV3 it is optional and can be deselected if the user doesn't want to offer the vGICv2 interface to guests or maybe its GICv3 hardware can't offer the GICv2 compatible mode.

---

xen/arch/arm/Kconfig        | 13 +++++++++++++
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 ++
5 files changed, 25 insertions(+), 2 deletions(-)
xen/arch/arm/Kconfig +0 -0
index fd57a82dd284..dc702f08ace7 100644
@@ -78,6 +78,14 @@ config ARM_EFI
         UEFI firmware. A UEFI stub is provided to allow Xen to
         be booted as an EFI application.
 
Quoted 4 lines

xen/arch/arm/Kconfig config ARM_EFI · line 81

Quoted 1 line
xen/arch/arm/Kconfig +1 -0
+config GICV2

So, now it would be possible to deselect both GIC drivers and Xen would not complain when building. This means that Xen would fail on boot without any message as it happens before serial driver initialization. Since having GIC driver built in is a must-have I think we need to make sure that at least one is enabled.

Hi Michal,

I tried and I had:

Starting kernel ...

- UART enabled -
- Boot CPU booting -
- Current EL 0000000000000008 -
- Initialize CPU -
- Turning on paging -
- Zero BSS -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000080000000 - 00000000feffffff
(XEN) RAM: 0000000880000000 - 00000008ffffffff
(XEN)
(XEN) MODULE[0]: 0000000084000000 - 000000008415d000 Xen
(XEN) MODULE[1]: 00000000fd6c5000 - 00000000fd6c8000 Device Tree
(XEN) MODULE[2]: 0000000080080000 - 00000000814f1a00 Kernel
(XEN) RESVD[0]: 0000000080000000 - 0000000080010000
(XEN) RESVD[1]: 0000000018000000 - 00000000187fffff
(XEN)
(XEN)
(XEN) Command line: noreboot dom0_mem=1024M console=dtuart dtuart=serial0 bootscrub=0 (XEN) PFN compression on bits 20...22
(XEN) Domain heap initialised
(XEN) Booting using Device Tree
(XEN) Platform: Generic System
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Unable to find compatible GIC in the device tree
(XEN) ****************************************
(XEN)
(XEN) Manual reset required ('noreboot' specified)

Wouldn’t be enough to suggest the user that at least one GIC needs to be selected? In the help it also states “if unsure, say Y"

Quoted 2 lines

~Michal

#3 lore raw

Hi,

Quoted 68 lines · Luca Fancellu
Quoted 35 lines · Michal Orzel

Hi Luca,

Quoted 28 lines · Luca Fancellu

Introduce Kconfig GICV2 to be able to compile the GICv2 driver only when needed, the option is active by default.

Introduce Kconfig VGICV2 that depends on GICV2 or GICV3 and compiles the GICv2 emulation for guests, it is required only when using GICV2 driver, otherwise using GICV3 it is optional and can be deselected if the user doesn't want to offer the vGICv2 interface to guests or maybe its GICv3 hardware can't offer the GICv2 compatible mode.

---

xen/arch/arm/Kconfig        | 13 +++++++++++++
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 ++
5 files changed, 25 insertions(+), 2 deletions(-)
xen/arch/arm/Kconfig +0 -0
index fd57a82dd284..dc702f08ace7 100644
@@ -78,6 +78,14 @@ config ARM_EFI
         UEFI firmware. A UEFI stub is provided to allow Xen to
         be booted as an EFI application.
 
Quoted 4 lines

xen/arch/arm/Kconfig config ARM_EFI · line 81

Quoted 1 line
xen/arch/arm/Kconfig +1 -0
+config GICV2

So, now it would be possible to deselect both GIC drivers and Xen would not complain when building. This means that Xen would fail on boot without any message as it happens before serial driver initialization. Since having GIC driver built in is a must-have I think we need to make sure that at least one is enabled.

Hi Michal,

I tried and I had:

Starting kernel ...

- UART enabled -
- Boot CPU booting -
- Current EL 0000000000000008 -
- Initialize CPU -
- Turning on paging -
- Zero BSS -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000080000000 - 00000000feffffff
(XEN) RAM: 0000000880000000 - 00000008ffffffff
(XEN)
(XEN) MODULE[0]: 0000000084000000 - 000000008415d000 Xen
(XEN) MODULE[1]: 00000000fd6c5000 - 00000000fd6c8000 Device Tree
(XEN) MODULE[2]: 0000000080080000 - 00000000814f1a00 Kernel
(XEN) RESVD[0]: 0000000080000000 - 0000000080010000
(XEN) RESVD[1]: 0000000018000000 - 00000000187fffff
(XEN)
(XEN)
(XEN) Command line: noreboot dom0_mem=1024M console=dtuart dtuart=serial0 bootscrub=0 (XEN) PFN compression on bits 20...22
(XEN) Domain heap initialised
(XEN) Booting using Device Tree

Quoted 8 lines

(XEN) Platform: Generic System
(XEN)
(XEN) **************************************** (XEN) Panic on CPU 0:
(XEN) Unable to find compatible GIC in the device tree (XEN) **************************************** (XEN)
(XEN) Manual reset required ('noreboot' specified)

Having early printk enabled all the time is not common and not enabled in release builds FWIK. So in general, user would just see "Starting kernel" from u-boot and had to debug what's going on.

Quoted 3 lines

Wouldn’t be enough to suggest the user that at least one GIC needs to be selected? In the help it also states “if unsure, say Y"

I always think it is better to meet the users needs by preventing unwise mistakes like unselecting both drivers. As always, it is up to maintainers.

~Michal

#4 lore raw
Quoted 83 lines · Michal Orzel

Hi,

Quoted 68 lines · Luca Fancellu
Quoted 35 lines · Michal Orzel

Hi Luca,

Quoted 28 lines · Luca Fancellu

Introduce Kconfig GICV2 to be able to compile the GICv2 driver only when needed, the option is active by default.

Introduce Kconfig VGICV2 that depends on GICV2 or GICV3 and compiles the GICv2 emulation for guests, it is required only when using GICV2 driver, otherwise using GICV3 it is optional and can be deselected if the user doesn't want to offer the vGICv2 interface to guests or maybe its GICv3 hardware can't offer the GICv2 compatible mode.

---

xen/arch/arm/Kconfig        | 13 +++++++++++++
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 ++
5 files changed, 25 insertions(+), 2 deletions(-)
xen/arch/arm/Kconfig +0 -0
index fd57a82dd284..dc702f08ace7 100644
@@ -78,6 +78,14 @@ config ARM_EFI
        UEFI firmware. A UEFI stub is provided to allow Xen to
        be booted as an EFI application.
 
Quoted 4 lines

xen/arch/arm/Kconfig config ARM_EFI · line 81

Quoted 1 line
xen/arch/arm/Kconfig +1 -0
+config GICV2

So, now it would be possible to deselect both GIC drivers and Xen would not complain when building. This means that Xen would fail on boot without any message as it happens before serial driver initialization. Since having GIC driver built in is a must-have I think we need to make sure that at least one is enabled.

Hi Michal,

I tried and I had:

Starting kernel ...

- UART enabled -
- Boot CPU booting -
- Current EL 0000000000000008 -
- Initialize CPU -
- Turning on paging -
- Zero BSS -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000080000000 - 00000000feffffff
(XEN) RAM: 0000000880000000 - 00000008ffffffff
(XEN)
(XEN) MODULE[0]: 0000000084000000 - 000000008415d000 Xen
(XEN) MODULE[1]: 00000000fd6c5000 - 00000000fd6c8000 Device Tree
(XEN) MODULE[2]: 0000000080080000 - 00000000814f1a00 Kernel
(XEN) RESVD[0]: 0000000080000000 - 0000000080010000
(XEN) RESVD[1]: 0000000018000000 - 00000000187fffff
(XEN)
(XEN)
(XEN) Command line: noreboot dom0_mem=1024M console=dtuart dtuart=serial0 bootscrub=0 (XEN) PFN compression on bits 20...22
(XEN) Domain heap initialised
(XEN) Booting using Device Tree

Quoted 8 lines

(XEN) Platform: Generic System
(XEN)
(XEN) **************************************** (XEN) Panic on CPU 0:
(XEN) Unable to find compatible GIC in the device tree (XEN) **************************************** (XEN)
(XEN) Manual reset required ('noreboot' specified)

Quoted 8 lines

Having early printk enabled all the time is not common and not enabled in release builds FWIK. So in general, user would just see "Starting kernel" from u-boot and had to debug what's going on.

Quoted 3 lines

Wouldn’t be enough to suggest the user that at least one GIC needs to be selected? In the help it also states “if unsure, say Y"

I always think it is better to meet the users needs by preventing unwise mistakes like unselecting both drivers. As always, it is up to maintainers.

Anyway I understand your point, do you think something like that could be ok? I’ve checked and it works, it compile only if at least one GIC driver is enabled

xen/arch/arm/setup.c +3 -0
index 264d2f2d4b09..85b4a7f08932 100644
@@ -1096,6 +1096,9 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     preinit_xen_time();
 
+    /* Don't build if at least one GIC driver is enabled */
+    BUILD_BUG_ON(!(IS_ENABLED(CONFIG_GICV3) || IS_ENABLED(CONFIG_GICV2)
+                 || IS_ENABLED(CONFIG_NEW_VGIC)));
     gic_preinit();
 
     arm_uart_init();
Quoted 2 lines

~Michal

#5 lore raw

Hi Luca,

Quoted 81 lines · Luca Fancellu
Quoted 81 lines · Michal Orzel

Hi,

Quoted 76 lines · Luca Fancellu
Quoted 35 lines · Michal Orzel

Hi Luca,

Quoted 28 lines · Luca Fancellu

Introduce Kconfig GICV2 to be able to compile the GICv2 driver only when needed, the option is active by default.

Introduce Kconfig VGICV2 that depends on GICV2 or GICV3 and compiles the GICv2 emulation for guests, it is required only when using GICV2 driver, otherwise using GICV3 it is optional and can be deselected if the user doesn't want to offer the vGICv2 interface to guests or maybe its GICv3 hardware can't offer the GICv2 compatible mode.

---

xen/arch/arm/Kconfig        | 13 +++++++++++++
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 ++
5 files changed, 25 insertions(+), 2 deletions(-)
xen/arch/arm/Kconfig +0 -0
index fd57a82dd284..dc702f08ace7 100644
@@ -78,6 +78,14 @@ config ARM_EFI
         UEFI firmware. A UEFI stub is provided to allow Xen to
         be booted as an EFI application.
 
Quoted 4 lines

xen/arch/arm/Kconfig config ARM_EFI · line 81

Quoted 1 line
xen/arch/arm/Kconfig +1 -0
+config GICV2

So, now it would be possible to deselect both GIC drivers and Xen would not complain when building. This means that Xen would fail on boot without any message as it happens before serial driver initialization. Since having GIC driver built in is a must-have I think we need to make sure that at least one is enabled.

Hi Michal,

I tried and I had:

Starting kernel ...

- UART enabled -
- Boot CPU booting -
- Current EL 0000000000000008 -
- Initialize CPU -
- Turning on paging -
- Zero BSS -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000080000000 - 00000000feffffff
(XEN) RAM: 0000000880000000 - 00000008ffffffff
(XEN)
(XEN) MODULE[0]: 0000000084000000 - 000000008415d000 Xen
(XEN) MODULE[1]: 00000000fd6c5000 - 00000000fd6c8000 Device Tree
(XEN) MODULE[2]: 0000000080080000 - 00000000814f1a00 Kernel
(XEN) RESVD[0]: 0000000080000000 - 0000000080010000
(XEN) RESVD[1]: 0000000018000000 - 00000000187fffff
(XEN)
(XEN)
(XEN) Command line: noreboot dom0_mem=1024M console=dtuart dtuart=serial0 bootscrub=0 (XEN) PFN compression on bits 20...22
(XEN) Domain heap initialised
(XEN) Booting using Device Tree
(XEN) Platform: Generic System
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Unable to find compatible GIC in the device tree
(XEN) ****************************************
(XEN)
(XEN) Manual reset required ('noreboot' specified)

Quoted 1 line
Quoted 1 line

Having early printk enabled all the time is not common and not enabled in release builds FWIK.

There are a lot of information printed before the console is properly brought up. I wonder if we should look at adding early console like Linux does?

Quoted 16 lines
Quoted 7 lines

So in general, user would just see "Starting kernel" from u-boot and had to debug what's going on.

Quoted 3 lines

Wouldn’t be enough to suggest the user that at least one GIC needs to be selected? In the help it also states “if unsure, say Y"

I always think it is better to meet the users needs by preventing unwise mistakes like unselecting both drivers. As always, it is up to maintainers.

Anyway I understand your point, do you think something like that could be ok? I’ve checked and it works, it compile only if at least one GIC driver is enabled

xen/arch/arm/setup.c +0 -0
index 264d2f2d4b09..85b4a7f08932 100644

xen/arch/arm/setup.c void __init start_xen(unsigned long boot_phys_offset, · line 1101

Quoted 6 lines
xen/arch/arm/setup.c +3 -0
@@ -1096,6 +1096,9 @@ void __init start_xen(unsigned long boot_phys_offset,
 
      preinit_xen_time();
 
+    /* Don't build if at least one GIC driver is enabled */
+    BUILD_BUG_ON(!(IS_ENABLED(CONFIG_GICV3) || IS_ENABLED(CONFIG_GICV2)
+                 || IS_ENABLED(CONFIG_NEW_VGIC)));

randconfig in gitlab will now randomly fail compilation. If we want to encode the dependency then it should be done in Kconfig. But I haven't looked at how to do that.

Cheers,

Signature · 1 line
Julien Grall
#6 lore raw
Quoted 99 lines · Julien Grall

Hi Luca,

Quoted 81 lines · Luca Fancellu
Quoted 81 lines · Michal Orzel

Hi,

Quoted 76 lines · Luca Fancellu
Quoted 35 lines · Michal Orzel

Hi Luca,

Quoted 28 lines · Luca Fancellu

Introduce Kconfig GICV2 to be able to compile the GICv2 driver only when needed, the option is active by default.

Introduce Kconfig VGICV2 that depends on GICV2 or GICV3 and compiles the GICv2 emulation for guests, it is required only when using GICV2 driver, otherwise using GICV3 it is optional and can be deselected if the user doesn't want to offer the vGICv2 interface to guests or maybe its GICv3 hardware can't offer the GICv2 compatible mode.

---

xen/arch/arm/Kconfig        | 13 +++++++++++++
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 ++
5 files changed, 25 insertions(+), 2 deletions(-)
xen/arch/arm/Kconfig +0 -0
index fd57a82dd284..dc702f08ace7 100644
@@ -78,6 +78,14 @@ config ARM_EFI
        UEFI firmware. A UEFI stub is provided to allow Xen to
        be booted as an EFI application.
 
Quoted 4 lines

xen/arch/arm/Kconfig config ARM_EFI · line 81

Quoted 1 line
xen/arch/arm/Kconfig +1 -0
+config GICV2

So, now it would be possible to deselect both GIC drivers and Xen would not complain when building. This means that Xen would fail on boot without any message as it happens before serial driver initialization. Since having GIC driver built in is a must-have I think we need to make sure that at least one is enabled.

Hi Michal,

I tried and I had:

Starting kernel ...

- UART enabled -
- Boot CPU booting -
- Current EL 0000000000000008 -
- Initialize CPU -
- Turning on paging -
- Zero BSS -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000080000000 - 00000000feffffff
(XEN) RAM: 0000000880000000 - 00000008ffffffff
(XEN)
(XEN) MODULE[0]: 0000000084000000 - 000000008415d000 Xen
(XEN) MODULE[1]: 00000000fd6c5000 - 00000000fd6c8000 Device Tree
(XEN) MODULE[2]: 0000000080080000 - 00000000814f1a00 Kernel
(XEN) RESVD[0]: 0000000080000000 - 0000000080010000
(XEN) RESVD[1]: 0000000018000000 - 00000000187fffff
(XEN)
(XEN)
(XEN) Command line: noreboot dom0_mem=1024M console=dtuart dtuart=serial0 bootscrub=0 (XEN) PFN compression on bits 20...22
(XEN) Domain heap initialised
(XEN) Booting using Device Tree
(XEN) Platform: Generic System
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Unable to find compatible GIC in the device tree
(XEN) ****************************************
(XEN)
(XEN) Manual reset required ('noreboot' specified)

Quoted 1 line
Quoted 1 line

Having early printk enabled all the time is not common and not enabled in release builds FWIK.

There are a lot of information printed before the console is properly brought up. I wonder if we should look at adding early console like Linux does?

Quoted 7 lines
Quoted 7 lines

So in general, user would just see "Starting kernel" from u-boot and had to debug what's going on.

Quoted 3 lines

Wouldn’t be enough to suggest the user that at least one GIC needs to be selected? In the help it also states “if unsure, say Y"

I always think it is better to meet the users needs by preventing unwise mistakes like unselecting both drivers. As always, it is up to maintainers.

Quoted 12 lines

xen/arch/arm/setup.c void __init start_xen(unsigned long boot_phys_offset, · line 1099

Quoted 11 lines

Anyway I understand your point, do you think something like that could be ok? I’ve checked and it works, it compile only if at least one GIC driver is enabled

xen/arch/arm/setup.c +2 -0
index 264d2f2d4b09..85b4a7f08932 100644
@@ -1096,6 +1096,9 @@ void __init start_xen(unsigned long boot_phys_offset,
       preinit_xen_time();
 +    /* Don't build if at least one GIC driver is enabled */
+    BUILD_BUG_ON(!(IS_ENABLED(CONFIG_GICV3) || IS_ENABLED(CONFIG_GICV2)
+                 || IS_ENABLED(CONFIG_NEW_VGIC)));

randconfig in gitlab will now randomly fail compilation. If we want to encode the dependency then it should be done in Kconfig. But I haven't looked at how to do that.

Ok I’ll investigate it, apart from that, if I find a possible way to have that in Kconfig, do you have any objection on what this patch is doing and the approach taken?

Quoted 5 lines

Cheers,

Signature · 1 line
Julien Grall
#7 lore raw

Hi,

Quoted 112 lines · Luca Fancellu
Quoted 99 lines · Julien Grall

Hi Luca,

Quoted 81 lines · Luca Fancellu
Quoted 81 lines · Michal Orzel

Hi,

Quoted 76 lines · Luca Fancellu
Quoted 35 lines · Michal Orzel

Hi Luca,

Quoted 28 lines · Luca Fancellu

Introduce Kconfig GICV2 to be able to compile the GICv2 driver only when needed, the option is active by default.

Introduce Kconfig VGICV2 that depends on GICV2 or GICV3 and compiles the GICv2 emulation for guests, it is required only when using GICV2 driver, otherwise using GICV3 it is optional and can be deselected if the user doesn't want to offer the vGICv2 interface to guests or maybe its GICv3 hardware can't offer the GICv2 compatible mode.

---

xen/arch/arm/Kconfig        | 13 +++++++++++++
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 ++
5 files changed, 25 insertions(+), 2 deletions(-)
xen/arch/arm/Kconfig +0 -0
index fd57a82dd284..dc702f08ace7 100644
@@ -78,6 +78,14 @@ config ARM_EFI
         UEFI firmware. A UEFI stub is provided to allow Xen to
         be booted as an EFI application.
 
Quoted 4 lines

xen/arch/arm/Kconfig config ARM_EFI · line 81

Quoted 1 line
xen/arch/arm/Kconfig +1 -0
+config GICV2

So, now it would be possible to deselect both GIC drivers and Xen would not complain when building. This means that Xen would fail on boot without any message as it happens before serial driver initialization. Since having GIC driver built in is a must-have I think we need to make sure that at least one is enabled.

Hi Michal,

I tried and I had:

Starting kernel ...

- UART enabled -
- Boot CPU booting -
- Current EL 0000000000000008 -
- Initialize CPU -
- Turning on paging -
- Zero BSS -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000080000000 - 00000000feffffff
(XEN) RAM: 0000000880000000 - 00000008ffffffff
(XEN)
(XEN) MODULE[0]: 0000000084000000 - 000000008415d000 Xen
(XEN) MODULE[1]: 00000000fd6c5000 - 00000000fd6c8000 Device Tree
(XEN) MODULE[2]: 0000000080080000 - 00000000814f1a00 Kernel
(XEN) RESVD[0]: 0000000080000000 - 0000000080010000
(XEN) RESVD[1]: 0000000018000000 - 00000000187fffff
(XEN)
(XEN)
(XEN) Command line: noreboot dom0_mem=1024M console=dtuart dtuart=serial0 bootscrub=0 (XEN) PFN compression on bits 20...22
(XEN) Domain heap initialised
(XEN) Booting using Device Tree
(XEN) Platform: Generic System
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Unable to find compatible GIC in the device tree
(XEN) ****************************************
(XEN)
(XEN) Manual reset required ('noreboot' specified)

Quoted 1 line
Quoted 1 line

Having early printk enabled all the time is not common and not enabled in release builds FWIK.

There are a lot of information printed before the console is properly brought up. I wonder if we should look at adding early console like Linux does?

Quoted 7 lines
Quoted 7 lines

So in general, user would just see "Starting kernel" from u-boot and had to debug what's going on.

Quoted 3 lines

Wouldn’t be enough to suggest the user that at least one GIC needs to be selected? In the help it also states “if unsure, say Y"

I always think it is better to meet the users needs by preventing unwise mistakes like unselecting both drivers. As always, it is up to maintainers.

Quoted 12 lines

xen/arch/arm/setup.c void __init start_xen(unsigned long boot_phys_offset, · line 1099

Quoted 11 lines

Anyway I understand your point, do you think something like that could be ok? I’ve checked and it works, it compile only if at least one GIC driver is enabled

xen/arch/arm/setup.c +2 -0
index 264d2f2d4b09..85b4a7f08932 100644
@@ -1096,6 +1096,9 @@ void __init start_xen(unsigned long boot_phys_offset,
        preinit_xen_time();
  +    /* Don't build if at least one GIC driver is enabled */
+    BUILD_BUG_ON(!(IS_ENABLED(CONFIG_GICV3) || IS_ENABLED(CONFIG_GICV2)
+                 || IS_ENABLED(CONFIG_NEW_VGIC)));

randconfig in gitlab will now randomly fail compilation. If we want to encode the dependency then it should be done in Kconfig. But I haven't looked at how to do that.

Quoted 1 line

Ok I’ll investigate it, apart from that, if I find a possible way to have that in Kconfig, do you have any objection on what this patch is doing and the approach taken?

Even if it is not possible, I wouldn't worry too much about it. While I agree with Michal that it is not great to have nothing printed, Kconfig can only reject configuration that are properly broken. But there are plenty that are sound but would still not boot on some platform.

A pretty good example is someone may decide to disable GICv3 and try to boot on a GICv3 platform... Another one is not enabling the UART driver for your platform :).

The latter there is nothing we can do without earlyprintk. But for the former, then we can try to enable the console earlier and/or delay when the GIC is initialized.

Cheers,

Signature · 1 line
Julien Grall
#8 lore raw
Quoted 116 lines · Julien Grall

Hi,

Quoted 109 lines · Luca Fancellu
Quoted 109 lines · Julien Grall

Hi Luca,

Quoted 81 lines · Luca Fancellu
Quoted 81 lines · Michal Orzel

Hi,

Quoted 76 lines · Luca Fancellu
Quoted 35 lines · Michal Orzel

Hi Luca,

Quoted 28 lines · Luca Fancellu

Introduce Kconfig GICV2 to be able to compile the GICv2 driver only when needed, the option is active by default.

Introduce Kconfig VGICV2 that depends on GICV2 or GICV3 and compiles the GICv2 emulation for guests, it is required only when using GICV2 driver, otherwise using GICV3 it is optional and can be deselected if the user doesn't want to offer the vGICv2 interface to guests or maybe its GICv3 hardware can't offer the GICv2 compatible mode.

---

xen/arch/arm/Kconfig        | 13 +++++++++++++
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 ++
5 files changed, 25 insertions(+), 2 deletions(-)
xen/arch/arm/Kconfig +0 -0
index fd57a82dd284..dc702f08ace7 100644
@@ -78,6 +78,14 @@ config ARM_EFI
        UEFI firmware. A UEFI stub is provided to allow Xen to
        be booted as an EFI application.
 
Quoted 4 lines

xen/arch/arm/Kconfig config ARM_EFI · line 81

Quoted 1 line
xen/arch/arm/Kconfig +1 -0
+config GICV2

So, now it would be possible to deselect both GIC drivers and Xen would not complain when building. This means that Xen would fail on boot without any message as it happens before serial driver initialization. Since having GIC driver built in is a must-have I think we need to make sure that at least one is enabled.

Hi Michal,

I tried and I had:

Starting kernel ...

- UART enabled -
- Boot CPU booting -
- Current EL 0000000000000008 -
- Initialize CPU -
- Turning on paging -
- Zero BSS -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000080000000 - 00000000feffffff
(XEN) RAM: 0000000880000000 - 00000008ffffffff
(XEN)
(XEN) MODULE[0]: 0000000084000000 - 000000008415d000 Xen
(XEN) MODULE[1]: 00000000fd6c5000 - 00000000fd6c8000 Device Tree
(XEN) MODULE[2]: 0000000080080000 - 00000000814f1a00 Kernel
(XEN) RESVD[0]: 0000000080000000 - 0000000080010000
(XEN) RESVD[1]: 0000000018000000 - 00000000187fffff
(XEN)
(XEN)
(XEN) Command line: noreboot dom0_mem=1024M console=dtuart dtuart=serial0 bootscrub=0 (XEN) PFN compression on bits 20...22
(XEN) Domain heap initialised
(XEN) Booting using Device Tree
(XEN) Platform: Generic System
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Unable to find compatible GIC in the device tree
(XEN) ****************************************
(XEN)
(XEN) Manual reset required ('noreboot' specified)

Quoted 1 line
Quoted 1 line

Having early printk enabled all the time is not common and not enabled in release builds FWIK.

There are a lot of information printed before the console is properly brought up. I wonder if we should look at adding early console like Linux does?

Quoted 14 lines
Quoted 7 lines

So in general, user would just see "Starting kernel" from u-boot and had to debug what's going on.

Quoted 3 lines

Wouldn’t be enough to suggest the user that at least one GIC needs to be selected? In the help it also states “if unsure, say Y"

I always think it is better to meet the users needs by preventing unwise mistakes like unselecting both drivers. As always, it is up to maintainers.

Anyway I understand your point, do you think something like that could be ok? I’ve checked and it works, it compile only if at least one GIC driver is enabled

xen/arch/arm/setup.c +0 -0
index 264d2f2d4b09..85b4a7f08932 100644

xen/arch/arm/setup.c void __init start_xen(unsigned long boot_phys_offset, · line 1099

Quoted 4 lines
xen/arch/arm/setup.c +2 -0
@@ -1096,6 +1096,9 @@ void __init start_xen(unsigned long boot_phys_offset,
       preinit_xen_time();
 +    /* Don't build if at least one GIC driver is enabled */
+    BUILD_BUG_ON(!(IS_ENABLED(CONFIG_GICV3) || IS_ENABLED(CONFIG_GICV2)
+                 || IS_ENABLED(CONFIG_NEW_VGIC)));

randconfig in gitlab will now randomly fail compilation. If we want to encode the dependency then it should be done in Kconfig. But I haven't looked at how to do that.

Quoted 7 lines
Quoted 1 line

Ok I’ll investigate it, apart from that, if I find a possible way to have that in Kconfig, do you have any objection on what this patch is doing and the approach taken?

Even if it is not possible, I wouldn't worry too much about it. While I agree with Michal that it is not great to have nothing printed, Kconfig can only reject configuration that are properly broken. But there are plenty that are sound but would still not boot on some platform.

A pretty good example is someone may decide to disable GICv3 and try to boot on a GICv3 platform... Another one is not enabling the UART driver for your platform :).

The latter there is nothing we can do without earlyprintk. But for the former, then we can try to enable the console earlier and/or delay when the GIC is initialized.

:) Just found a way

xen/arch/arm/Kconfig +1 -0
index 5cdba07df964..93309cd49144 100644
@@ -18,6 +18,7 @@ config ARM
        select HAS_PMAP
        select HAS_UBSAN
        select IOMMU_FORCE_PT_SHARE
+       select GICV2 if !GICV3 && !NEW_VGIC
 
 config ARCH_DEFCONFIG
        string

If I’ve played a bit with the menuconfig and it selects GICv2 if no other gic driver is selected, so basically as before when gicv2 was always enabled.
If everyone agrees I can use this solution and include it in the next push

Quoted 5 lines

Cheers,

Signature · 1 line
Julien Grall
#9 lore raw

Hi Luca,

Quoted 13 lines · Luca Fancellu
xen/arch/arm/Kconfig +1 -0
index 5cdba07df964..93309cd49144 100644
@@ -18,6 +18,7 @@ config ARM
         select HAS_PMAP
         select HAS_UBSAN
         select IOMMU_FORCE_PT_SHARE
+       select GICV2 if !GICV3 && !NEW_VGIC
 
  config ARCH_DEFCONFIG
         string
Quoted 3 lines

If I’ve played a bit with the menuconfig and it selects GICv2 if no other gic driver is selected, so basically as before when gicv2 was always enabled.
If everyone agrees I can use this solution and include it in the next push

I am not thrilled with this approach. I understand that the default today is GICv2, but why should it continue to be like that?

Even if we were switching to GICv3, it feels rather a odd approach because you would make it work for one set of the users but not the others.

Cheers,

Signature · 1 line
Julien Grall
#10 lore raw
In reply to Julien Grall
Quoted 86 lines · Julien Grall

Hi Luca,

Quoted 81 lines · Luca Fancellu
Quoted 81 lines · Michal Orzel

Hi,

Quoted 76 lines · Luca Fancellu
Quoted 35 lines · Michal Orzel

Hi Luca,

Quoted 28 lines · Luca Fancellu

Introduce Kconfig GICV2 to be able to compile the GICv2 driver only when needed, the option is active by default.

Introduce Kconfig VGICV2 that depends on GICV2 or GICV3 and compiles the GICv2 emulation for guests, it is required only when using GICV2 driver, otherwise using GICV3 it is optional and can be deselected if the user doesn't want to offer the vGICv2 interface to guests or maybe its GICv3 hardware can't offer the GICv2 compatible mode.

---

xen/arch/arm/Kconfig        | 13 +++++++++++++
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 ++
5 files changed, 25 insertions(+), 2 deletions(-)
xen/arch/arm/Kconfig +0 -0
index fd57a82dd284..dc702f08ace7 100644
@@ -78,6 +78,14 @@ config ARM_EFI
         UEFI firmware. A UEFI stub is provided to allow Xen to
         be booted as an EFI application.
 
Quoted 4 lines

xen/arch/arm/Kconfig config ARM_EFI · line 81

Quoted 1 line
xen/arch/arm/Kconfig +1 -0
+config GICV2

So, now it would be possible to deselect both GIC drivers and Xen would not complain when building. This means that Xen would fail on boot without any message as it happens before serial driver initialization. Since having GIC driver built in is a must-have I think we need to make sure that at least one is enabled.

Hi Michal,

I tried and I had:

Starting kernel ...

- UART enabled -
- Boot CPU booting -
- Current EL 0000000000000008 -
- Initialize CPU -
- Turning on paging -
- Zero BSS -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000080000000 - 00000000feffffff
(XEN) RAM: 0000000880000000 - 00000008ffffffff
(XEN)
(XEN) MODULE[0]: 0000000084000000 - 000000008415d000 Xen
(XEN) MODULE[1]: 00000000fd6c5000 - 00000000fd6c8000 Device Tree
(XEN) MODULE[2]: 0000000080080000 - 00000000814f1a00 Kernel
(XEN) RESVD[0]: 0000000080000000 - 0000000080010000
(XEN) RESVD[1]: 0000000018000000 - 00000000187fffff
(XEN)
(XEN)
(XEN) Command line: noreboot dom0_mem=1024M console=dtuart dtuart=serial0 bootscrub=0 (XEN) PFN compression on bits 20...22
(XEN) Domain heap initialised
(XEN) Booting using Device Tree
(XEN) Platform: Generic System
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Unable to find compatible GIC in the device tree
(XEN) ****************************************
(XEN)
(XEN) Manual reset required ('noreboot' specified)

Quoted 5 lines
Quoted 1 line
Quoted 1 line

Having early printk enabled all the time is not common and not enabled in release builds FWIK.

There are a lot of information printed before the console is properly brought up. I wonder if we should look at adding early console like Linux does?

I guess it is not a matter of "if" but "when" and I think it's just that no one has time to do that since it is more a like a feature for developers rather than for customers (they just report the issue and we need to fix it :)). There are so many things that can go wrong during early boot including the entire boofdt parsing and having earlycon would be so desirable.

~Michal

#11 lore raw

Hi,

Quoted 87 lines · Michal Orzel
Quoted 86 lines · Julien Grall

Hi Luca,

Quoted 81 lines · Luca Fancellu
Quoted 81 lines · Michal Orzel

Hi,

Quoted 76 lines · Luca Fancellu
Quoted 35 lines · Michal Orzel

Hi Luca,

Quoted 28 lines · Luca Fancellu

Introduce Kconfig GICV2 to be able to compile the GICv2 driver only when needed, the option is active by default.

Introduce Kconfig VGICV2 that depends on GICV2 or GICV3 and compiles the GICv2 emulation for guests, it is required only when using GICV2 driver, otherwise using GICV3 it is optional and can be deselected if the user doesn't want to offer the vGICv2 interface to guests or maybe its GICv3 hardware can't offer the GICv2 compatible mode.

---

xen/arch/arm/Kconfig        | 13 +++++++++++++
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 ++
5 files changed, 25 insertions(+), 2 deletions(-)
xen/arch/arm/Kconfig +0 -0
index fd57a82dd284..dc702f08ace7 100644
@@ -78,6 +78,14 @@ config ARM_EFI
          UEFI firmware. A UEFI stub is provided to allow Xen to
          be booted as an EFI application.
 
Quoted 4 lines

xen/arch/arm/Kconfig config ARM_EFI · line 81

Quoted 1 line
xen/arch/arm/Kconfig +1 -0
+config GICV2

So, now it would be possible to deselect both GIC drivers and Xen would not complain when building. This means that Xen would fail on boot without any message as it happens before serial driver initialization. Since having GIC driver built in is a must-have I think we need to make sure that at least one is enabled.

Hi Michal,

I tried and I had:

Starting kernel ...

- UART enabled -
- Boot CPU booting -
- Current EL 0000000000000008 -
- Initialize CPU -
- Turning on paging -
- Zero BSS -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000080000000 - 00000000feffffff
(XEN) RAM: 0000000880000000 - 00000008ffffffff
(XEN)
(XEN) MODULE[0]: 0000000084000000 - 000000008415d000 Xen
(XEN) MODULE[1]: 00000000fd6c5000 - 00000000fd6c8000 Device Tree
(XEN) MODULE[2]: 0000000080080000 - 00000000814f1a00 Kernel
(XEN) RESVD[0]: 0000000080000000 - 0000000080010000
(XEN) RESVD[1]: 0000000018000000 - 00000000187fffff
(XEN)
(XEN)
(XEN) Command line: noreboot dom0_mem=1024M console=dtuart dtuart=serial0 bootscrub=0 (XEN) PFN compression on bits 20...22
(XEN) Domain heap initialised
(XEN) Booting using Device Tree
(XEN) Platform: Generic System
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Unable to find compatible GIC in the device tree
(XEN) ****************************************
(XEN)
(XEN) Manual reset required ('noreboot' specified)

Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line

Having early printk enabled all the time is not common and not enabled in release builds FWIK.

There are a lot of information printed before the console is properly brought up. I wonder if we should look at adding early console like Linux does?

I guess it is not a matter of "if" but "when" and I think it's just that no one has time to do that since it is more a like a feature for developers rather than for customers (they just report the issue and we need to fix it :)).

Sure. This is always the case, but it also means developpers will continue to waste time when investigating early boot issues. I wouldn't be surprised if the total time wasted is more than the actual effort to add support :).

Quoted 2 lines

There are so many things that can go wrong during early boot including the entire boofdt parsing and having earlycon would be so desirable.

It is not clear what to take from your reply. Earlier you were concerned about the error not showing up in the log if the .config is not correct.

There is no really quick fix for that as a .config may work for platform A but not platform B. The only viable solution is having an early console.

Anything else like forcing to always have one GICvX selected is just a hack that would work for one set of people but not the others.

Cheers,

Signature · 1 line
Julien Grall
#12 lore raw
Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 24 lines

- UART enabled -
- Boot CPU booting -
- Current EL 0000000000000008 -
- Initialize CPU -
- Turning on paging -
- Zero BSS -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000080000000 - 00000000feffffff
(XEN) RAM: 0000000880000000 - 00000008ffffffff
(XEN)
(XEN) MODULE[0]: 0000000084000000 - 000000008415d000 Xen
(XEN) MODULE[1]: 00000000fd6c5000 - 00000000fd6c8000 Device Tree
(XEN) MODULE[2]: 0000000080080000 - 00000000814f1a00 Kernel
(XEN) RESVD[0]: 0000000080000000 - 0000000080010000
(XEN) RESVD[1]: 0000000018000000 - 00000000187fffff
(XEN)
(XEN)
(XEN) Command line: noreboot dom0_mem=1024M console=dtuart dtuart=serial0 bootscrub=0 (XEN) PFN compression on bits 20...22
(XEN) Domain heap initialised
(XEN) Booting using Device Tree

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

(XEN) Platform: Generic System
(XEN)
(XEN) **************************************** (XEN) Panic on CPU 0:
(XEN) Unable to find compatible GIC in the device tree (XEN) **************************************** (XEN)
(XEN) Manual reset required ('noreboot' specified)

Hi Julien, Michal,

Quoted 10 lines
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line

Having early printk enabled all the time is not common and not enabled in release builds FWIK.

There are a lot of information printed before the console is properly brought up. I wonder if we should look at adding early console like Linux does?

I guess it is not a matter of "if" but "when" and I think it's just that no one has time to do that since it is more a like a feature for developers rather than for customers (they just report the issue and we need to fix it :)).

Sure. This is always the case, but it also means developpers will continue to waste time when investigating early boot issues. I wouldn't be surprised if the total time wasted is more than the actual effort to add support :).

I’ve not investigated on the amount of time needed to add that, I wouldn’t underestimate that and unfortunately people have different capacity and companies have different priorities, so a quick feature can translate on months when the time allocated for a particular job is, let’s say, one day a month.

Quoted 8 lines
Quoted 3 lines

There are so many things that can go wrong during early boot including the entire boofdt parsing and having earlycon would be so desirable.

It is not clear what to take from your reply. Earlier you were concerned about the error not showing up in the log if the .config is not correct.

There is no really quick fix for that as a .config may work for platform A but not platform B. The only viable solution is having an early console.

Anything else like forcing to always have one GICvX selected is just a hack that would work for one set of people but not the others.

I agree with you in part, when you say that it would work for one set of people but not the others, isn’t it always the case? We are providing a defconfig that would fit the majority of the people, but it’s always a set of them.

More specific to this patch, with the provided Kconfig “hack” as you say, it is not only providing the same user experience as the current state, it is doing more, it is providing a way to exclude from the build the GICv2 which is not possible currently, this work aims to provide a more fine granular configuration so that experienced users can remove entire modules that they don’t need in their platform so that they don’t have to take them into account when going to, for example, safety critical audits.

I agree with you that earlycon would be perfect, so that we could make the user remove every module and let him know quickly the issue, but on the other hand it is a complete new feature that you are requesting (are you?) to make this patch go forward.

My personal opinion is that, since this patch is not affecting the user experience, it is maintaining the current status (not ideal), but at least It is providing something more, it would be a shame to throw that in the bin because no one has time to work on earlycon.

Cheers,
Luca

#13 lore raw
Quoted 10 lines · Luca Fancellu
Quoted 7 lines
Quoted 2 lines

There are so many things that can go wrong during early boot including the entire boofdt parsing and having earlycon would be so desirable.

It is not clear what to take from your reply. Earlier you were concerned about the error not showing up in the log if the .config is not correct.

There is no really quick fix for that as a .config may work for platform A but not platform B. The only viable solution is having an early console.

Anything else like forcing to always have one GICvX selected is just a hack that would work for one set of people but not the others.

I agree with you in part, when you say that it would work for one set of people but not the others, isn’t it always the case? We are providing a defconfig that would fit the majority of the people, but it’s always a set of them.

Correct.

Quoted 5 lines

More specific to this patch, with the provided Kconfig “hack” as you say, it is not only providing the same user experience as the current state, it is doing more, it is providing a way to exclude from the build the GICv2 which is not possible currently, this work aims to provide a more fine granular configuration so that experienced users can remove entire modules that they don’t need in their platform so that they don’t have to take them into account when going to, for example, safety critical audits.

There seems to be some misunderstanding about the hack I am referring to. This is not about the patch itself but the following line:

select GICV2 if !GICV3 && !NEW_VGIC

Now that GICv2 can be deselecting, I see no point to force select GICV2 if GICV3 is not selected.

As I wrote earlier, there is so many way for someone to create .config that is wrong or doesn't boot on their platform. So someone tweaking .config should always be careful when selecting/deselecting options.

Quoted 3 lines

I agree with you that earlycon would be perfect, so that we could make the user remove every module and let him know quickly the issue, but on the other hand it is a complete new feature that you are requesting (are you?) to make this patch go forward.

I didn't suggest it. I was making the point that if you have time, it is best to spend it trying to enable the early console rather than trying to prevent the user to disable both GIC.

Cheers,

Signature · 1 line
Julien Grall
#14 lore raw
Quoted 24 lines · Julien Grall
Quoted 9 lines · Luca Fancellu
Quoted 7 lines
Quoted 2 lines

There are so many things that can go wrong during early boot including the entire boofdt parsing and having earlycon would be so desirable.

It is not clear what to take from your reply. Earlier you were concerned about the error not showing up in the log if the .config is not correct.

There is no really quick fix for that as a .config may work for platform A but not platform B. The only viable solution is having an early console.

Anything else like forcing to always have one GICvX selected is just a hack that would work for one set of people but not the others.

I agree with you in part, when you say that it would work for one set of people but not the others, isn’t it always the case? We are providing a defconfig that would fit the majority of the people, but it’s always a set of them.

Correct.

Quoted 4 lines

More specific to this patch, with the provided Kconfig “hack” as you say, it is not only providing the same user experience as the current state, it is doing more, it is providing a way to exclude from the build the GICv2 which is not possible currently, this work aims to provide a more fine granular configuration so that experienced users can remove entire modules that they don’t need in their platform so that they don’t have to take them into account when going to, for example, safety critical audits.

Quoted 5 lines

There seems to be some misunderstanding about the hack I am referring to. This is not about the patch itself but the following line:

select GICV2 if !GICV3 && !NEW_VGIC

Now that GICv2 can be deselecting, I see no point to force select GICV2 if GICV3 is not selected.

Ok I see

Quoted 2 lines

As I wrote earlier, there is so many way for someone to create .config that is wrong or doesn't boot on their platform. So someone tweaking .config should always be careful when selecting/deselecting options.

Yes indeed

Quoted 5 lines
Quoted 3 lines

I agree with you that earlycon would be perfect, so that we could make the user remove every module and let him know quickly the issue, but on the other hand it is a complete new feature that you are requesting (are you?) to make this patch go forward.

I didn't suggest it. I was making the point that if you have time, it is best to spend it trying to enable the early console rather than trying to prevent the user to disable both GIC.

It will be for sure something I will investigate, but in the mean time unfortunately I won’t have time at least until October to even start an investigation.

I would like to ask if you see this one going forwards or not (as it is), because I have a set of patches to isolate and Kconfig-out the dom0less code, that is depending on this one (for a small bit) and before sending them I need to understand if this one can see the light or not.

Quoted 5 lines

Cheers,

Signature · 1 line
Julien Grall
#15 lore raw

Hi,

Quoted 3 lines · Luca Fancellu

I would like to ask if you see this one going forwards or not (as it is), because I have a set of patches to isolate and Kconfig-out the dom0less code, that is depending on this one (for a small bit) and before sending them I need to understand if this one can see the light or not.

In principle, I have no issues with trying to disable some part of Xen code. I will still need to look at each one to confirm I am happy with the changes.

For this case, I will have a look in a bit.

Cheers,

Signature · 1 line
Julien Grall
#16 lore raw
In reply to Julien Grall
Quoted 97 lines · Julien Grall

Hi,

Quoted 92 lines · Michal Orzel
Quoted 91 lines · Julien Grall

Hi Luca,

Quoted 81 lines · Luca Fancellu
Quoted 81 lines · Michal Orzel

Hi,

Quoted 76 lines · Luca Fancellu
Quoted 35 lines · Michal Orzel

Hi Luca,

Quoted 28 lines · Luca Fancellu

Introduce Kconfig GICV2 to be able to compile the GICv2 driver only when needed, the option is active by default.

Introduce Kconfig VGICV2 that depends on GICV2 or GICV3 and compiles the GICv2 emulation for guests, it is required only when using GICV2 driver, otherwise using GICV3 it is optional and can be deselected if the user doesn't want to offer the vGICv2 interface to guests or maybe its GICv3 hardware can't offer the GICv2 compatible mode.

---

xen/arch/arm/Kconfig        | 13 +++++++++++++
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 ++
5 files changed, 25 insertions(+), 2 deletions(-)
xen/arch/arm/Kconfig +0 -0
index fd57a82dd284..dc702f08ace7 100644
@@ -78,6 +78,14 @@ config ARM_EFI
          UEFI firmware. A UEFI stub is provided to allow Xen to
          be booted as an EFI application.
 
Quoted 4 lines

xen/arch/arm/Kconfig config ARM_EFI · line 81

Quoted 1 line
xen/arch/arm/Kconfig +1 -0
+config GICV2

So, now it would be possible to deselect both GIC drivers and Xen would not complain when building. This means that Xen would fail on boot without any message as it happens before serial driver initialization. Since having GIC driver built in is a must-have I think we need to make sure that at least one is enabled.

Hi Michal,

I tried and I had:

Starting kernel ...

- UART enabled -
- Boot CPU booting -
- Current EL 0000000000000008 -
- Initialize CPU -
- Turning on paging -
- Zero BSS -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000080000000 - 00000000feffffff
(XEN) RAM: 0000000880000000 - 00000008ffffffff
(XEN)
(XEN) MODULE[0]: 0000000084000000 - 000000008415d000 Xen
(XEN) MODULE[1]: 00000000fd6c5000 - 00000000fd6c8000 Device Tree
(XEN) MODULE[2]: 0000000080080000 - 00000000814f1a00 Kernel
(XEN) RESVD[0]: 0000000080000000 - 0000000080010000
(XEN) RESVD[1]: 0000000018000000 - 00000000187fffff
(XEN)
(XEN)
(XEN) Command line: noreboot dom0_mem=1024M console=dtuart dtuart=serial0 bootscrub=0 (XEN) PFN compression on bits 20...22
(XEN) Domain heap initialised
(XEN) Booting using Device Tree
(XEN) Platform: Generic System
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Unable to find compatible GIC in the device tree
(XEN) ****************************************
(XEN)
(XEN) Manual reset required ('noreboot' specified)

Quoted 1 line
Quoted 1 line

Having early printk enabled all the time is not common and not enabled in release builds FWIK.

There are a lot of information printed before the console is properly brought up. I wonder if we should look at adding early console like Linux does?

Quoted 8 lines
Quoted 3 lines

I guess it is not a matter of "if" but "when" and I think it's just that no one has time to do that since it is more a like a feature for developers rather than for customers (they just report the issue and we need to fix it :)).

Sure. This is always the case, but it also means developpers will continue to waste time when investigating early boot issues. I wouldn't be surprised if the total time wasted is more than the actual effort to add support :).

most probably

Quoted 11 lines
Quoted 3 lines

There are so many things that can go wrong during early boot including the entire boofdt parsing and having earlycon would be so desirable.

It is not clear what to take from your reply. Earlier you were concerned about the error not showing up in the log if the .config is not correct.

There is no really quick fix for that as a .config may work for platform A but not platform B. The only viable solution is having an early console.

Anything else like forcing to always have one GICvX selected is just a hack that would work for one set of people but not the others.

Yes, having early console would solve these issues and for now we might need to be on the mercy of users to do wise selection. That said, the scenario with GIC is not really the same as for something that can work on platform A and not on B. No GIC built-in cannot work on any platform, hence my concern (it is different than selecting wrong GIC). But because I do not see any simple solution other than building always both and you don't like what Luca just did (fallback to GICv2), I'm ok. Initializing UART prior to GIC would also require quite some work to defer the IRQ translation that depends on the GIC.

~Michal

#17 lore raw

Hi Michal,

Quoted 113 lines · Michal Orzel
Quoted 93 lines · Julien Grall
Quoted 92 lines · Michal Orzel
Quoted 91 lines · Julien Grall

Hi Luca,

Quoted 81 lines · Luca Fancellu
Quoted 81 lines · Michal Orzel

Hi,

Quoted 76 lines · Luca Fancellu
Quoted 35 lines · Michal Orzel

Hi Luca,

Quoted 28 lines · Luca Fancellu

Introduce Kconfig GICV2 to be able to compile the GICv2 driver only when needed, the option is active by default.

Introduce Kconfig VGICV2 that depends on GICV2 or GICV3 and compiles the GICv2 emulation for guests, it is required only when using GICV2 driver, otherwise using GICV3 it is optional and can be deselected if the user doesn't want to offer the vGICv2 interface to guests or maybe its GICv3 hardware can't offer the GICv2 compatible mode.

---

xen/arch/arm/Kconfig        | 13 +++++++++++++
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 ++
5 files changed, 25 insertions(+), 2 deletions(-)
xen/arch/arm/Kconfig +0 -0
index fd57a82dd284..dc702f08ace7 100644
@@ -78,6 +78,14 @@ config ARM_EFI
           UEFI firmware. A UEFI stub is provided to allow Xen to
           be booted as an EFI application.
 
Quoted 4 lines

xen/arch/arm/Kconfig config ARM_EFI · line 81

Quoted 1 line
xen/arch/arm/Kconfig +1 -0
+config GICV2

So, now it would be possible to deselect both GIC drivers and Xen would not complain when building. This means that Xen would fail on boot without any message as it happens before serial driver initialization. Since having GIC driver built in is a must-have I think we need to make sure that at least one is enabled.

Hi Michal,

I tried and I had:

Starting kernel ...

- UART enabled -
- Boot CPU booting -
- Current EL 0000000000000008 -
- Initialize CPU -
- Turning on paging -
- Zero BSS -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000080000000 - 00000000feffffff
(XEN) RAM: 0000000880000000 - 00000008ffffffff
(XEN)
(XEN) MODULE[0]: 0000000084000000 - 000000008415d000 Xen
(XEN) MODULE[1]: 00000000fd6c5000 - 00000000fd6c8000 Device Tree
(XEN) MODULE[2]: 0000000080080000 - 00000000814f1a00 Kernel
(XEN) RESVD[0]: 0000000080000000 - 0000000080010000
(XEN) RESVD[1]: 0000000018000000 - 00000000187fffff
(XEN)
(XEN)
(XEN) Command line: noreboot dom0_mem=1024M console=dtuart dtuart=serial0 bootscrub=0 (XEN) PFN compression on bits 20...22
(XEN) Domain heap initialised
(XEN) Booting using Device Tree
(XEN) Platform: Generic System
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Unable to find compatible GIC in the device tree
(XEN) ****************************************
(XEN)
(XEN) Manual reset required ('noreboot' specified)

Quoted 1 line
Quoted 1 line

Having early printk enabled all the time is not common and not enabled in release builds FWIK.

There are a lot of information printed before the console is properly brought up. I wonder if we should look at adding early console like Linux does?

Quoted 8 lines
Quoted 3 lines

I guess it is not a matter of "if" but "when" and I think it's just that no one has time to do that since it is more a like a feature for developers rather than for customers (they just report the issue and we need to fix it :)).

Sure. This is always the case, but it also means developpers will continue to waste time when investigating early boot issues. I wouldn't be surprised if the total time wasted is more than the actual effort to add support :).

most probably

Quoted 9 lines
Quoted 3 lines

There are so many things that can go wrong during early boot including the entire boofdt parsing and having earlycon would be so desirable.

It is not clear what to take from your reply. Earlier you were concerned about the error not showing up in the log if the .config is not correct.

There is no really quick fix for that as a .config may work for platform A but not platform B. The only viable solution is having an early console.

Quoted 6 lines
Quoted 2 lines

Anything else like forcing to always have one GICvX selected is just a hack that would work for one set of people but not the others.

Yes, having early console would solve these issues and for now we might need to be on the mercy of users to do wise selection. That said, the scenario with GIC is not really the same as for something that can work on platform A and not on B. No GIC built-in cannot work on any platform, hence my concern (it is different than selecting wrong GIC).

The assumption behind this is the user will always have a platform where it can boot Xen. I am not aware of many users with this opportunity of choice. So to me this is not very different from Xen can't boot on A but can on B.

Cheers,

Signature · 1 line
Julien Grall
#18 lore raw
In reply to Luca Fancellu

Hi,

Quoted 38 lines · Luca Fancellu

Introduce Kconfig GICV2 to be able to compile the GICv2 driver only when needed, the option is active by default.

Introduce Kconfig VGICV2 that depends on GICV2 or GICV3 and compiles the GICv2 emulation for guests, it is required only when using GICV2 driver, otherwise using GICV3 it is optional and can be deselected if the user doesn't want to offer the vGICv2 interface to guests or maybe its GICv3 hardware can't offer the GICv2 compatible mode.

---
  xen/arch/arm/Kconfig        | 13 +++++++++++++
  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 ++
  5 files changed, 25 insertions(+), 2 deletions(-)
xen/arch/arm/Kconfig +8 -0
index fd57a82dd284..dc702f08ace7 100644
@@ -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

xen/arch/arm/Kconfig config HAS_ITS · line 104

Quoted 5 lines
xen/arch/arm/Kconfig +2 -0
@@ -92,6 +100,11 @@ 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 guests"

This description is a bit misleading as the vGICv2 will also be used for dom0 in the case of vGICv2.

xen/arch/arm/Kconfig config HAS_ITS · line 105

Quoted 1 line
xen/arch/arm/Kconfig +1 -0
+	default y

Please add a longer help.

xen/arch/arm/Kconfig config HAS_ITS · line 106

Quoted 1 line
xen/arch/arm/Kconfig +1 -0
+	depends on (GICV2 || GICV3) && !NEW_VGIC

In the near future, I don't expect anyone to introduce a new non-GIC of interrupt controller for Arm. But I would expect new version of the GIC. So I would drop (GICV2 || GICV3).

Also when !NEW_VGIC is selected, this will make VGICV2 will be unselected. I was actually expecting the other way around given that new vGIC only offer v2 support.

The rest of the changes LGTM.

Cheers,

Signature · 1 line
Julien Grall
#19 lore raw

Hi Julien,

Quoted 16 lines

Review config HAS_ITS · line 103

Quoted 9 lines
(quoted diff) +2 -0
+
 config GICV3
  bool "GICv3 driver"
  depends on !NEW_VGIC
@@ -92,6 +100,11 @@ 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 guests"

This description is a bit misleading as the vGICv2 will also be used for dom0 in the case of vGICv2.

Review config HAS_ITS · line 104

Quoted 1 line
(quoted diff) +1 -0
+ default y

Please add a longer help.

Quoted 7 lines

Review config HAS_ITS · line 105

Quoted 1 line
(quoted diff) +1 -0
+ depends on (GICV2 || GICV3) && !NEW_VGIC

In the near future, I don't expect anyone to introduce a new non-GIC of interrupt controller for Arm. But I would expect new version of the GIC. So I would drop (GICV2 || GICV3).

Also when !NEW_VGIC is selected, this will make VGICV2 will be unselected. I was actually expecting the other way around given that new vGIC only offer v2 support.

The rest of the changes LGTM.

Thanks a lot for having a look on this patch, you are right the NEW_VGIC is offering only v2 support at the moment, does this changes captures your Comments?

xen/arch/arm/Kconfig +6 -2
index 5cdba07df964..1c600b3b8d04 100644
@@ -110,15 +110,19 @@ config HAS_ITS
         depends on GICV3 && !NEW_VGIC && !ARM_32
 
 config VGICV2
-       bool "vGICv2 interface for guests"
+       bool "vGICv2 interface for domains"
        default y
-       depends on (GICV2 || GICV3) && !NEW_VGIC
+       help
+         Provides a virtualised interface for the Generic Interrupt Controller that
+         can be used by Xen's domains.
+         If unsure, say Y
 
 config HVM
         def_bool y
 
 config NEW_VGIC
        bool "Use new VGIC implementation"
+       select VGICV2
        ---help---
 
        This is an alternative implementation of the ARM GIC interrupt
xen/arch/arm/vgic/Makefile +2 -2
index 806826948e20..60cbf7f2f94a 100644
@@ -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
Quoted 5 lines

Cheers,

Signature · 1 line
Julien Grall
#20 lore raw
Quoted 50 lines · Luca Fancellu

Hi Julien,

Quoted 16 lines

Review config HAS_ITS · line 103

Quoted 9 lines

+
config GICV3
bool "GICv3 driver"
depends on !NEW_VGIC

(quoted diff) +2 -0
@@ -92,6 +100,11 @@ 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 guests"

This description is a bit misleading as the vGICv2 will also be used for dom0 in the case of vGICv2.

Review config HAS_ITS · line 104

Quoted 1 line
(quoted diff) +1 -0
+ default y

Please add a longer help.

Quoted 7 lines

Review config HAS_ITS · line 105

Quoted 1 line
(quoted diff) +1 -0
+ depends on (GICV2 || GICV3) && !NEW_VGIC

In the near future, I don't expect anyone to introduce a new non-GIC of interrupt controller for Arm. But I would expect new version of the GIC. So I would drop (GICV2 || GICV3).

Also when !NEW_VGIC is selected, this will make VGICV2 will be unselected. I was actually expecting the other way around given that new vGIC only offer v2 support.

The rest of the changes LGTM.

Thanks a lot for having a look on this patch, you are right the NEW_VGIC is offering only v2 support at the moment, does this changes captures your Comments?

xen/arch/arm/Kconfig +0 -0
index 5cdba07df964..1c600b3b8d04 100644
@@ -110,15 +110,19 @@ config HAS_ITS
        depends on GICV3 && !NEW_VGIC && !ARM_32
 

config VGICV2

xen/arch/arm/Kconfig +5 -2
-       bool "vGICv2 interface for guests"
+       bool "vGICv2 interface for domains"
       default y
-       depends on (GICV2 || GICV3) && !NEW_VGIC
+       help
+         Provides a virtualised interface for the Generic Interrupt Controller that
+         can be used by Xen's domains.
+         If unsure, say Y
Quoted 6 lines

config HVM
def_bool y

config NEW_VGIC
bool "Use new VGIC implementation"
+ select VGICV2

Sorry, I meant to use here “select GICV2"

Quoted 23 lines

---help---

This is an alternative implementation of the ARM GIC interrupt

xen/arch/arm/vgic/Makefile +0 -0
index 806826948e20..60cbf7f2f94a 100644
@@ -1,5 +1,5 @@

obj-y += vgic.o

xen/arch/arm/vgic/Makefile +1 -1
-obj-y += vgic-v2.o
+obj-$(CONFIG_VGICV2) += vgic-v2.o

obj-y += vgic-mmio.o

xen/arch/arm/vgic/Makefile +1 -1
-obj-y += vgic-mmio-v2.o
+obj-$(CONFIG_VGICV2) += vgic-mmio-v2.o

obj-y += vgic-init.o

Quoted 5 lines

Cheers,

Signature · 1 line
Julien Grall
#21 lore raw
In reply to Luca Fancellu
Quoted 1 line · Luca Fancellu

Hi Julien,

Hi,

Quoted 32 lines
Quoted 16 lines

Review config HAS_ITS · line 103

Quoted 9 lines
(quoted diff) +2 -0
+
  config GICV3
   bool "GICv3 driver"
   depends on !NEW_VGIC
@@ -92,6 +100,11 @@ 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 guests"

This description is a bit misleading as the vGICv2 will also be used for dom0 in the case of vGICv2.

Review config HAS_ITS · line 104

Quoted 1 line
(quoted diff) +1 -0
+ default y

Please add a longer help.

Quoted 7 lines

Review config HAS_ITS · line 105

Quoted 1 line
(quoted diff) +1 -0
+ depends on (GICV2 || GICV3) && !NEW_VGIC

In the near future, I don't expect anyone to introduce a new non-GIC of interrupt controller for Arm. But I would expect new version of the GIC. So I would drop (GICV2 || GICV3).

Also when !NEW_VGIC is selected, this will make VGICV2 will be unselected. I was actually expecting the other way around given that new vGIC only offer v2 support.

The rest of the changes LGTM.

Thanks a lot for having a look on this patch, you are right the NEW_VGIC is offering only v2 support at the moment, does this changes captures your Comments?

xen/arch/arm/Kconfig +0 -0
index 5cdba07df964..1c600b3b8d04 100644

xen/arch/arm/Kconfig config HAS_ITS · line 117

Quoted 10 lines
xen/arch/arm/Kconfig +4 -2
@@ -110,15 +110,19 @@ config HAS_ITS
          depends on GICV3 && !NEW_VGIC && !ARM_32
 
  config VGICV2
-       bool "vGICv2 interface for guests"
+       bool "vGICv2 interface for domains"
         default y
-       depends on (GICV2 || GICV3) && !NEW_VGIC
+       help
+         Provides a virtualised interface for the Generic Interrupt Controller that
+         can be used by Xen's domains.

How about:

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.

Quoted 32 lines
xen/arch/arm/Kconfig +2 -0
+         If unsure, say Y
 
  config HVM
          def_bool y
 
  config NEW_VGIC
         bool "Use new VGIC implementation"
+       select VGICV2
         ---help---
 
         This is an alternative implementation of the ARM GIC interrupt
xen/arch/arm/vgic/Makefile +2 -2
index 806826948e20..60cbf7f2f94a 100644
@@ -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
Quoted 8 lines

Cheers,

Signature · 1 line
Julien Grall
Signature · 1 line
Julien Grall