Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751525AbeAOUZm (ORCPT + 1 other); Mon, 15 Jan 2018 15:25:42 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:61676 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750799AbeAOUZS (ORCPT ); Mon, 15 Jan 2018 15:25:18 -0500 From: Arnd Bergmann To: Jan Kiszka , Thomas Gleixner , x86@kernel.org Cc: jailhouse-dev@googlegroups.com, Arnd Bergmann , Ingo Molnar , "H. Peter Anvin" , Juergen Gross , Dou Liyang , linux-kernel@vger.kernel.org Subject: [PATCH] x86/jailhouse: fix building without X86_X2APIC Date: Mon, 15 Jan 2018 21:23:21 +0100 Message-Id: <20180115202335.1645883-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:o+HMjzr9y8yl9zxM34qkBZGl4m0PP/HsTTXjyS7oF7FZ84kAGrs SVh3atn6OTU+5/RFoaRPrUqJ/aTfz+0C3OdT02bMPn4ZzGq+TYy+0G8d34lydHGnZ5F3vIs k+LIkzK53f0GB6eYr0ZxGwFPYJH6GWPl/0Mg3onRhuztmGYCoxMwrnC3QmOWWino2PDJ3sF sPIFt2JADl1qwW9Z3FEgA== X-UI-Out-Filterresults: notjunk:1;V01:K0:UEVw7tQ4b+U=:IN2UGHgEshzZM7AV2G8qKR 6doDoYEn5lGxUdAx/AqTkblwF1WwiMOw5AuNTyZ5xjMkD4VfaHvqei8U6aX9CR5ectDyhY5Ig D3/rAzVmV61L7t+veHmAu3LoQEb0Q2F46yQK90L/0D6E2zCqpoDQITuQedc7u03pXkXU8U93q L0L8Y2EAhSCG9rWRi7FVoE6h3WRm4qFFZ4xmA9RJge0EDolHyy8yemhy/y3VfgI4K+ygTlcwf d6ee4NxWixEfUSEcq90riq/dSSMJtBuxS7kZQz0HwBv3xIQZ3xGK8/QjWb3fSLWfjY1b3KEcP wgzNI54iTZj2hdlVdbB2wYeVvVQAGgSdMlXAqyYKHrq054fZll5gK5cYYJUPeeHKlTfaRteSN QuejN/uAczJ9dDGV9KUNGvWx5Aro6Q7KoPxkjYcfDn7PZUwFjY/mPBV+c5jXyb2q9qOHmtkSs KUef1cPeYrWL9yl/PW+cZLNBOCNo5qMHT9HrPcWbD2WpZSiqB5VfIYzE0Gmk70uFIJgwQP+MZ p0JyUu0S8lyYICJY0qsZvefRJm84/ACyBnQwZNWZHu/8V1JkIu07vkLDoqvR8xssLcYWhegYM X2ET+OYTzEJbUklJYqb+alwoCyntPUwlBJ0qV80acWjqLOsg03Vunv93mp+UvzgyOUFn80HB/ rgetGpoWJBQE0Otsza8Bw7oArjPaeId1hailhx5ih9k9KPXhxH6+bNaWTefP5mYvWu+4sNQJF gPqDYsB7E4ko4ZkpdnntF0fVIjH37n8uDCFF5Q== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 --- 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