Skip to contentSkip to conversation

x86: fix duplication definication issue in making allyesconfig

PATCH In review Hongzhan Chen 2 participants 6 messages Apr 2, 2022 – Apr 6, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 x86: fix duplication definication issue in making allyesconfig

When making allyesconfig, there is duplication definication issue. To fix it, make them exclusive each other.

---
 arch/x86/kernel/irq_pipeline.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
arch/x86/kernel/irq_pipeline.c +2 -4
index 8daac9f78ebe..624fad67fe56 100644
@@ -138,13 +138,11 @@ static void do_sysvec_inband(struct irq_desc *desc)
 	case HYPERV_STIMER0_VECTOR:
 		__sysvec_hyperv_stimer0(regs);
 		break;
-#endif
-#ifdef CONFIG_ACRN_GUEST
+#elif defined CONFIG_ACRN_GUEST
 	case HYPERVISOR_CALLBACK_VECTOR:
 		__sysvec_acrn_hv_callback(regs);
 		break;
-#endif
-#ifdef CONFIG_XEN_PVHVM
+#elif defined CONFIG_XEN_PVHVM
 	case HYPERVISOR_CALLBACK_VECTOR:
 		__sysvec_xen_hvm_callback(regs);
 		break;
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 clocksource: GENERIC_CLOCKSOURCE_VDSO only supported on ARM

Currently, GENERIC_CLOCKSOURCE_VDSO only supported well on ARM. To fix build issue like following when make allyesconfig on x86 platform.

arch/x86/entry/vdso/../../../../lib/vdso/gettimeofday.c:145:14:
error: implicit declaration of function clock_open_device

---
 drivers/clocksource/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/Kconfig +1 -1
index 5138cd593373..1e8c1cd086d5 100644
@@ -644,7 +644,7 @@ config CLKSRC_ST_LPC
 	bool "Low power clocksource found in the LPC" if COMPILE_TEST
 	select TIMER_OF if OF
 	depends on HAS_IOMEM
-	select GENERIC_CLOCKSOURCE_VDSO
+	select GENERIC_CLOCKSOURCE_VDSO if ARM
 	help
 	  Enable this option to use the Low Power controller timer
 	  as clocksource.
Signature · 1 line
2.17.1
#2 lore raw

Re: [linux-dovetail PATCH 2/2] clocksource: GENERIC_CLOCKSOURCE_VDSO only supported on ARM

Quoted 16 lines · Hongzhan Chen via Xenomai

Currently, GENERIC_CLOCKSOURCE_VDSO only supported well on ARM. To fix build issue like following when make allyesconfig on x86 platform.

arch/x86/entry/vdso/../../../../lib/vdso/gettimeofday.c:145:14:
error: implicit declaration of function clock_open_device

---
 drivers/clocksource/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/Kconfig +0 -0
index 5138cd593373..1e8c1cd086d5 100644

drivers/clocksource/Kconfig config CLKSRC_ST_LPC · line 650

Quoted 8 lines
drivers/clocksource/Kconfig +1 -1
@@ -644,7 +644,7 @@ config CLKSRC_ST_LPC
 	bool "Low power clocksource found in the LPC" if COMPILE_TEST
 	select TIMER_OF if OF
 	depends on HAS_IOMEM
-	select GENERIC_CLOCKSOURCE_VDSO
+	select GENERIC_CLOCKSOURCE_VDSO if ARM
 	help
 	  Enable this option to use the Low Power controller timer
 	  as clocksource.

Starting from v5.17, Dovetail has generic support for clocksource access via the vDSO for CONFIG_ARM64 too. Which kernel release is this patch based on?

Signature · 1 line
Philippe.
#3 lore raw

RE: [linux-dovetail PATCH 2/2] clocksource: GENERIC_CLOCKSOURCE_VDSO only supported on ARM

Quoted 30 lines

-----Original Message-----
From: Philippe Gerum <[email protected]>
Sent: Saturday, April 2, 2022 5:11 PM
To: Chen, Hongzhan <[email protected]>
Cc: [email protected]
Subject: Re: [linux-dovetail PATCH 2/2] clocksource: GENERIC_CLOCKSOURCE_VDSO only supported on ARM

Quoted 20 lines · Hongzhan Chen via Xenomai

Currently, GENERIC_CLOCKSOURCE_VDSO only supported well on ARM. To fix build issue like following when make allyesconfig on x86 platform.

arch/x86/entry/vdso/../../../../lib/vdso/gettimeofday.c:145:14:
error: implicit declaration of function clock_open_device

---
 drivers/clocksource/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/Kconfig +0 -1
index 5138cd593373..1e8c1cd086d5 100644
@@ -644,7 +644,7 @@ config CLKSRC_ST_LPC
 	bool "Low power clocksource found in the LPC" if COMPILE_TEST
 	select TIMER_OF if OF
 	depends on HAS_IOMEM
-	select GENERIC_CLOCKSOURCE_VDSO
Quoted 8 lines

drivers/clocksource/Kconfig config CLKSRC_ST_LPC · line 650

Quoted 4 lines
drivers/clocksource/Kconfig +1 -0
+	select GENERIC_CLOCKSOURCE_VDSO if ARM
 	help
 	  Enable this option to use the Low Power controller timer
 	  as clocksource.

Starting from v5.17, Dovetail has generic support for clocksource access via the vDSO for CONFIG_ARM64 too. Which kernel release is this patch based on?

Sorry, I had not described it clearly. It is based on 5.10.

Regards

Hongzhan Chen

Quoted 3 lines
Signature · 2 lines
-- 
Philippe.
#4 lore raw

Re: [linux-dovetail PATCH 2/2] clocksource: GENERIC_CLOCKSOURCE_VDSO only supported on ARM

Quoted 39 lines · Hongzhan
Quoted 30 lines

-----Original Message-----
From: Philippe Gerum <[email protected]>
Sent: Saturday, April 2, 2022 5:11 PM
To: Chen, Hongzhan <[email protected]>
Cc: [email protected]
Subject: Re: [linux-dovetail PATCH 2/2] clocksource: GENERIC_CLOCKSOURCE_VDSO only supported on ARM

Quoted 20 lines · Hongzhan Chen via Xenomai

Currently, GENERIC_CLOCKSOURCE_VDSO only supported well on ARM. To fix build issue like following when make allyesconfig on x86 platform.

arch/x86/entry/vdso/../../../../lib/vdso/gettimeofday.c:145:14:
error: implicit declaration of function clock_open_device

---
 drivers/clocksource/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/Kconfig +0 -1
index 5138cd593373..1e8c1cd086d5 100644
@@ -644,7 +644,7 @@ config CLKSRC_ST_LPC
 	bool "Low power clocksource found in the LPC" if COMPILE_TEST
 	select TIMER_OF if OF
 	depends on HAS_IOMEM
-	select GENERIC_CLOCKSOURCE_VDSO
Quoted 8 lines

drivers/clocksource/Kconfig config CLKSRC_ST_LPC · line 650

Quoted 4 lines
drivers/clocksource/Kconfig +1 -0
+	select GENERIC_CLOCKSOURCE_VDSO if ARM
 	help
 	  Enable this option to use the Low Power controller timer
 	  as clocksource.

Starting from v5.17, Dovetail has generic support for clocksource access via the vDSO for CONFIG_ARM64 too. Which kernel release is this patch based on?

Quoted 2 lines

Sorry, I had not described it clearly. It is based on 5.10.

No problem. I just backported the vDSO support to 5.10/arm64 along with a fix for allyesconfig per your suggestion (v5.10.107-dovetail1-rebase), so both LTS trees I'm maintaining have it now:

7585543a1ebb arm64: vDSO: export user-visible MMIO clocksources 143579c7945c clocksource/drivers: dovetail: fix dependency on GENERIC_CLOCKSOURCE_VDSO

Signature · 1 line
Philippe.
#5 lore raw
In reply to Hongzhan Chen
Quoted 18 lines · Hongzhan Chen via Xenomai

When making allyesconfig, there is duplication definication issue. To fix it, make them exclusive each other.

---
 arch/x86/kernel/irq_pipeline.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
arch/x86/kernel/irq_pipeline.c +0 -2
index 8daac9f78ebe..624fad67fe56 100644
@@ -138,13 +138,11 @@ static void do_sysvec_inband(struct irq_desc *desc)
 	case HYPERV_STIMER0_VECTOR:
 		__sysvec_hyperv_stimer0(regs);
 		break;
-#endif
-#ifdef CONFIG_ACRN_GUEST

arch/x86/kernel/irq_pipeline.c static void do_sysvec_inband(struct irq_desc *desc) · line 148

Quoted 10 lines
arch/x86/kernel/irq_pipeline.c +2 -2
+#elif defined CONFIG_ACRN_GUEST
 	case HYPERVISOR_CALLBACK_VECTOR:
 		__sysvec_acrn_hv_callback(regs);
 		break;
-#endif
-#ifdef CONFIG_XEN_PVHVM
+#elif defined CONFIG_XEN_PVHVM
 	case HYPERVISOR_CALLBACK_VECTOR:
 		__sysvec_xen_hvm_callback(regs);
 		break;

There may be a broader issue in the original implementation which this patch only papers over.

In theory, building a kernel image one could run on multiple flavors of HV should be possible - there seems to be no mutal exclusion in the Kconfig specs between XEN, ACRN and HYPERV client support - which this change would disable by always preferring HYPERV over ACRN when it comes to pipelining interrupts.

However, Dovetail does not cope well with paravirtualization ATM anyway, which is why XEN depends on !IRQ_PIPELINE. As a result, there is no point in keeping the case for XEN_PVHVM around. We should have the same constraint on CONFIG_HYPERV, therefore the other conflicting case should go away, leaving ACRN_GUEST as the sole user of HYPERVISOR_CALLBACK_VECTOR, with no conflict anymore.

Signature · 1 line
Philippe.