Skip to contentSkip to conversation

x86/xen: fix 'nopvspin' build error

PATCH In review Randy Dunlap 2 participants 2 messages Jan 15, 2021 – Jan 18, 2021

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

PATCH 1/1 x86/xen: fix 'nopvspin' build error

Fix build error in x86/xen/ when PARAVIRT_SPINLOCKS is not enabled.

Fixes this build error:

../arch/x86/xen/smp_hvm.c: In function ‘xen_hvm_smp_init’:
../arch/x86/xen/smp_hvm.c:77:3: error: ‘nopvspin’ undeclared (first use in this function)
nopvspin = true;

Fixes 3d7746bea925 ("x86/xen: Fix xen_hvm_smp_init() when vector callback not available")
Cc David Woodhouse <[email protected]>
Cc Juergen Gross <[email protected]>

---
I tried to use IS_ENABLED(CONFIG_PARAVIRT_SPINLOCKS) on the if line and on the nopvspin assignment line but both of those failed for me-- using gcc 7.5.0.

 arch/x86/xen/smp_hvm.c |    2 ++
 1 file changed, 2 insertions(+)
arch/x86/xen/smp_hvm.c +2 -0
@@ -74,7 +74,9 @@ void __init xen_hvm_smp_init(void)
 	smp_ops.cpu_die = xen_hvm_cpu_die;
 
 	if (!xen_have_vector_callback) {
+#ifdef CONFIG_PARAVIRT_SPINLOCKS
 		nopvspin = true;
+#endif
 		return;
 	}
 
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Randy Dunlap

Fix build error in x86/xen/ when PARAVIRT_SPINLOCKS is not enabled.

Fixes this build error:

Quoted 8 lines

../arch/x86/xen/smp_hvm.c: In function ‘xen_hvm_smp_init’:
../arch/x86/xen/smp_hvm.c:77:3: error: ‘nopvspin’ undeclared (first use in this function)

    nopvspin = true;
Fixes 3d7746bea925 ("x86/xen: Fix xen_hvm_smp_init() when vector callback not available")
Cc David Woodhouse <[email protected]>
Cc Juergen Gross <[email protected]>

Juergen