Skip to contentSkip to conversation

x86/shim: Make PV_SHIM depend on CPU_ONLINE_OFFLINE

PATCH In review Michal Orzel 4 participants 7 messages Dec 3

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/shim: Make PV_SHIM depend on CPU_ONLINE_OFFLINE

PV shim calls cpu_up_helper() and cpu_down_helper() from pv_shim_cpu_{up,down}(). Since commit e8b34da6a098 ("Kconfig: Make cpu hotplug configurable"), these helpers are only built with CONFIG_CPU_ONLINE_OFFLINE. With this option disabled and PV_SHIM enabled the build fails at link time:

shim.c:866: undefined reference to cpu_up_helper' shim.c:899: undefined reference to cpu_down_helper'

Make PV_SHIM depend on CPU_ONLINE_OFFLINE.

Fixes e8b34da6a098 ("Kconfig: Make cpu hotplug configurable")

---
I found this issue when re-running the failed jobs on a recent Stefano push:
Here, the randconfig job failed:
https://gitlab.com/xen-project/hardware/xen/-/jobs/18591389353

---
 xen/arch/x86/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/Kconfig +1 -1
index 6b5562173bed..868fab16c2ce 100644
@@ -291,7 +291,7 @@ config PVH_GUEST
 config PV_SHIM
 	def_bool y
 	prompt "PV Shim"
-	depends on PV && XEN_GUEST
+	depends on PV && XEN_GUEST && CPU_ONLINE_OFFLINE
 	help
 	  Build Xen with a mode which acts as a shim to allow PV guest to run
 	  in an HVM/PVH container. This mode can only be enabled with command
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 26 lines · Michal Orzel

PV shim calls cpu_up_helper() and cpu_down_helper() from pv_shim_cpu_{up,down}(). Since commit e8b34da6a098 ("Kconfig: Make cpu hotplug configurable"), these helpers are only built with CONFIG_CPU_ONLINE_OFFLINE. With this option disabled and PV_SHIM enabled the build fails at link time:

shim.c:866: undefined reference to cpu_up_helper' shim.c:899: undefined reference to cpu_down_helper'

Make PV_SHIM depend on CPU_ONLINE_OFFLINE.

Fixes e8b34da6a098 ("Kconfig: Make cpu hotplug configurable")

---
I found this issue when re-running the failed jobs on a recent Stefano push:
Here, the randconfig job failed:
https://gitlab.com/xen-project/hardware/xen/-/jobs/18591389353

---
 xen/arch/x86/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/Kconfig +0 -0
index 6b5562173bed..868fab16c2ce 100644

xen/arch/x86/Kconfig config PVH_GUEST · line 297

Quoted 8 lines
xen/arch/x86/Kconfig +1 -1
@@ -291,7 +291,7 @@ config PVH_GUEST
 config PV_SHIM
 	def_bool y
 	prompt "PV Shim"
-	depends on PV && XEN_GUEST
+	depends on PV && XEN_GUEST && CPU_ONLINE_OFFLINE
 	help
 	  Build Xen with a mode which acts as a shim to allow PV guest to run
 	  in an HVM/PVH container. This mode can only be enabled with command

Thanks for catching this.

#2 lore raw
In reply to Michal Orzel
Quoted 6 lines · Michal Orzel

PV shim calls cpu_up_helper() and cpu_down_helper() from pv_shim_cpu_{up,down}(). Since commit e8b34da6a098 ("Kconfig: Make cpu hotplug configurable"), these helpers are only built with CONFIG_CPU_ONLINE_OFFLINE. With this option disabled and PV_SHIM enabled the build fails at link time:

Quoted 7 lines

shim.c:866: undefined reference to cpu_up_helper' shim.c:899: undefined reference to cpu_down_helper'

Make PV_SHIM depend on CPU_ONLINE_OFFLINE.

Fixes e8b34da6a098 ("Kconfig: Make cpu hotplug configurable")

I was tempted to give this an ack right away, but then I wondered:

xen/arch/x86/Kconfig config PVH_GUEST · line 294

Quoted 8 lines
xen/arch/x86/Kconfig +1 -1
@@ -291,7 +291,7 @@ config PVH_GUEST
 config PV_SHIM
 	def_bool y
 	prompt "PV Shim"
-	depends on PV && XEN_GUEST
+	depends on PV && XEN_GUEST && CPU_ONLINE_OFFLINE

Might this not better be a select in this particular case?

Jan

#3 lore raw
Quoted 17 lines · Jan Beulich
Quoted 6 lines · Michal Orzel

PV shim calls cpu_up_helper() and cpu_down_helper() from pv_shim_cpu_{up,down}(). Since commit e8b34da6a098 ("Kconfig: Make cpu hotplug configurable"), these helpers are only built with CONFIG_CPU_ONLINE_OFFLINE. With this option disabled and PV_SHIM enabled the build fails at link time:

Quoted 7 lines

shim.c:866: undefined reference to cpu_up_helper' shim.c:899: undefined reference to cpu_down_helper'

Make PV_SHIM depend on CPU_ONLINE_OFFLINE.

Fixes e8b34da6a098 ("Kconfig: Make cpu hotplug configurable")

I was tempted to give this an ack right away, but then I wondered:

Quoted 10 lines

xen/arch/x86/Kconfig config PVH_GUEST · line 294

Quoted 8 lines
xen/arch/x86/Kconfig +1 -1
@@ -291,7 +291,7 @@ config PVH_GUEST
 config PV_SHIM
 	def_bool y
 	prompt "PV Shim"
-	depends on PV && XEN_GUEST
+	depends on PV && XEN_GUEST && CPU_ONLINE_OFFLINE

Might this not better be a select in this particular case?

It's up to you. I can do either way because I don't have any preference here.

~Michal

#4 lore raw
Quoted 28 lines · Michal
Quoted 17 lines · Jan Beulich
Quoted 6 lines · Michal Orzel

PV shim calls cpu_up_helper() and cpu_down_helper() from pv_shim_cpu_{up,down}(). Since commit e8b34da6a098 ("Kconfig: Make cpu hotplug configurable"), these helpers are only built with CONFIG_CPU_ONLINE_OFFLINE. With this option disabled and PV_SHIM enabled the build fails at link time:

Quoted 7 lines

shim.c:866: undefined reference to cpu_up_helper' shim.c:899: undefined reference to cpu_down_helper'

Make PV_SHIM depend on CPU_ONLINE_OFFLINE.

Fixes e8b34da6a098 ("Kconfig: Make cpu hotplug configurable")

I was tempted to give this an ack right away, but then I wondered:

Quoted 10 lines

xen/arch/x86/Kconfig config PVH_GUEST · line 294

Quoted 8 lines
xen/arch/x86/Kconfig +1 -1
@@ -291,7 +291,7 @@ config PVH_GUEST
 config PV_SHIM
 	def_bool y
 	prompt "PV Shim"
-	depends on PV && XEN_GUEST
+	depends on PV && XEN_GUEST && CPU_ONLINE_OFFLINE

Might this not better be a select in this particular case?

Quoted 1 line

It's up to you. I can do either way because I don't have any preference here.

To a person configuring Xen (for purely-shim, or for with-shim) it may not be obvious that this extra setting needs enabling manually. Hence why I think "select" would be better here. (I'm inclined to say that the same may, perhaps to a lesser degree, also be true for PV and XEN_GUEST.) Let's see if other x86 maintainers have a different view (without waiting for too long).

Jan

#5 lore raw
In reply to Orzel, Michal
Quoted 30 lines · Michal
Quoted 17 lines · Jan Beulich
Quoted 6 lines · Michal Orzel

PV shim calls cpu_up_helper() and cpu_down_helper() from pv_shim_cpu_{up,down}(). Since commit e8b34da6a098 ("Kconfig: Make cpu hotplug configurable"), these helpers are only built with CONFIG_CPU_ONLINE_OFFLINE. With this option disabled and PV_SHIM enabled the build fails at link time:

Quoted 7 lines

shim.c:866: undefined reference to cpu_up_helper' shim.c:899: undefined reference to cpu_down_helper'

Make PV_SHIM depend on CPU_ONLINE_OFFLINE.

Fixes e8b34da6a098 ("Kconfig: Make cpu hotplug configurable")

I was tempted to give this an ack right away, but then I wondered:

Quoted 10 lines

xen/arch/x86/Kconfig config PVH_GUEST · line 294

Quoted 8 lines
xen/arch/x86/Kconfig +1 -1
@@ -291,7 +291,7 @@ config PVH_GUEST
 config PV_SHIM
 	def_bool y
 	prompt "PV Shim"
-	depends on PV && XEN_GUEST
+	depends on PV && XEN_GUEST && CPU_ONLINE_OFFLINE

Might this not better be a select in this particular case?

Quoted 1 line

It's up to you. I can do either way because I don't have any preference here.

I would go with select, so that a user doesn't have to enable CPU_ONLINE_OFFLINE to see PV_SHIM. It's a non-trivial connection to make.

Thanks, Roger.

Acked-by
#6 lore raw
Quoted 29 lines · Roger Pau Monné
Quoted 28 lines · Michal
Quoted 27 lines · Jan Beulich
Quoted 6 lines · Michal Orzel

PV shim calls cpu_up_helper() and cpu_down_helper() from pv_shim_cpu_{up,down}(). Since commit e8b34da6a098 ("Kconfig: Make cpu hotplug configurable"), these helpers are only built with CONFIG_CPU_ONLINE_OFFLINE. With this option disabled and PV_SHIM enabled the build fails at link time:

Quoted 7 lines

shim.c:866: undefined reference to cpu_up_helper' shim.c:899: undefined reference to cpu_down_helper'

Make PV_SHIM depend on CPU_ONLINE_OFFLINE.

Fixes e8b34da6a098 ("Kconfig: Make cpu hotplug configurable")

I was tempted to give this an ack right away, but then I wondered:

xen/arch/x86/Kconfig config PVH_GUEST · line 294

Quoted 8 lines
xen/arch/x86/Kconfig +1 -1
@@ -291,7 +291,7 @@ config PVH_GUEST
 config PV_SHIM
 	def_bool y
 	prompt "PV Shim"
-	depends on PV && XEN_GUEST
+	depends on PV && XEN_GUEST && CPU_ONLINE_OFFLINE

Might this not better be a select in this particular case?

Quoted 5 lines
Quoted 1 line

It's up to you. I can do either way because I don't have any preference here.

I would go with select, so that a user doesn't have to enable CPU_ONLINE_OFFLINE to see PV_SHIM. It's a non-trivial connection to make.

And with the adjustment (no need to re-submit):

Jan