mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/jailhouse: fix building without X86_X2APIC
@ 2018-01-15 20:23 Arnd Bergmann
  2018-01-16  1:25 ` Dou Liyang
  0 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2018-01-15 20:23 UTC (permalink / raw)
  To: Jan Kiszka, Thomas Gleixner, x86
  Cc: jailhouse-dev, Arnd Bergmann, Ingo Molnar, H. Peter Anvin,
	Juergen Gross, Dou Liyang, linux-kernel

When CONFIG_X86_X2APIC is disabled, jailhouse fails to build:

arch/x86/kernel/jailhouse.c: In function 'jailhouse_get_smp_config':
arch/x86/kernel/jailhouse.c:73:3: error: 'x2apic_phys' undeclared (first use in this function); did you mean 'x2apic_mode'?

The code is protected by an appropriate x2apic_enabled() check that leads
to the assignment being optimized out without a link-time reference to
x2apic_phys, so we just lack a declaration.

Let's move x2apic_mode and x2apic_phys outside of the #ifdef together,
for consistency.

Fixes: 11c8dc419bbc ("x86/jailhouse: Enable APIC and SMP support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/x86/include/asm/apic.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 98722773391d..0317d635d9ba 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -188,6 +188,8 @@ static inline void lapic_assign_system_vectors(void) { }
 static inline void lapic_assign_legacy_vector(unsigned int i, bool r) { }
 #endif /* !CONFIG_X86_LOCAL_APIC */
 
+extern int x2apic_mode;
+extern int x2apic_phys;
 #ifdef CONFIG_X86_X2APIC
 /*
  * Make previous memory operations globally visible before
@@ -249,8 +251,6 @@ static inline u64 native_x2apic_icr_read(void)
 	return val;
 }
 
-extern int x2apic_mode;
-extern int x2apic_phys;
 extern void __init check_x2apic(void);
 extern void x2apic_setup(void);
 static inline int x2apic_enabled(void)
-- 
2.9.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-01-16 11:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-15 20:23 [PATCH] x86/jailhouse: fix building without X86_X2APIC Arnd Bergmann
2018-01-16  1:25 ` Dou Liyang
2018-01-16  2:34   ` Dou Liyang
2018-01-16  7:21     ` Arnd Bergmann
2018-01-16  8:17       ` Dou Liyang
2018-01-16  8:50         ` Arnd Bergmann
2018-01-16 11:02           ` Dou Liyang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®