Skip to contentSkip to conversation

x86/xen: Fix sparse warning in enlighten_pv.c

PATCH In review Juergen Gross 2 participants 2 messages Dec 15, 2025

Subsystems (2)
lore
Share & tools
lore

Juergen Gross

author maintainer
#0 lore raw

PATCH 1/1 x86/xen: Fix sparse warning in enlighten_pv.c

The sparse tool issues a warning for arch/x76/xen/enlighten_pv.c:

arch/x86/xen/enlighten_pv.c:120:9: sparse: sparse: incorrect type
in initializer (different address spaces)
expected void const [noderef] __percpu *__vpp_verify got bool *

This is due to the percpu variable xen_in_preemptible_hcall being exported via EXPORT_SYMBOL_GPL() instead of EXPORT_PER_CPU_SYMBOL_GPL().

Fixes fdfd811ddde3 ("x86/xen: allow privcmd hypercalls to be preempted")
---
 arch/x86/xen/enlighten_pv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/xen/enlighten_pv.c +1 -1
index 4806cc28d7ca..b74ff8bc7f2a 100644
@@ -108,7 +108,7 @@ static int xen_cpu_dead_pv(unsigned int cpu);
  * calls.
  */
 DEFINE_PER_CPU(bool, xen_in_preemptible_hcall);
-EXPORT_SYMBOL_GPL(xen_in_preemptible_hcall);
+EXPORT_PER_CPU_SYMBOL_GPL(xen_in_preemptible_hcall);
 
 /*
  * In case of scheduling the flag must be cleared and restored after
Signature · 1 line
2.51.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Juergen Gross

The sparse tool issues a warning for arch/x76/xen/enlighten_pv.c:

arch/x86/xen/enlighten_pv.c:120:9: sparse: sparse: incorrect type
in initializer (different address spaces)
expected void const [noderef] __percpu *__vpp_verify got bool *

Quoted 7 lines

This is due to the percpu variable xen_in_preemptible_hcall being exported via EXPORT_SYMBOL_GPL() instead of EXPORT_PER_CPU_SYMBOL_GPL().

Fixes fdfd811ddde3 ("x86/xen: allow privcmd hypercalls to be preempted")