From patchwork Mon Jan 15 20:23:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 124557 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp784751lje; Mon, 15 Jan 2018 12:25:44 -0800 (PST) X-Google-Smtp-Source: ACJfBotnqnBfZmMRK63RJV0RmpEdhGMNB+w7ClEczCHtvSlzsb/2ykxU5qIXcxb84OHoHoNnziIA X-Received: by 10.98.89.194 with SMTP id k63mr32733193pfj.32.1516047944309; Mon, 15 Jan 2018 12:25:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516047944; cv=none; d=google.com; s=arc-20160816; b=j4hqnqDddAX+D0WiklF9uaJUKyPqPGEePn3iHMS+v6Rw8FYNo+/VwrDiG0FLxfffRt jF2fB8ZG+Q0lTRJaJaQjMFrNWM4D3zoDxOcGFAOxZARKUp4PrivubrwzzOZJGiscH2Bd PBlrq05m5WoXxAPQFZbhB/aOO9GcB9UuS2uw0jKXOAxqqdg5HFdjPNSG29JcVH5flJV/ MfclvEGwhFGOX0YzS/P+S8wQHyfQusDavWMKMdu7lsshQ8zWRLtyqjiFXOv+PQyaENZy CJ08J955ThQPxFjjIJLoZ5nxp3pGS/qTB0VHQT9H57KBebGSONFRKiIhp17yBsaOavbN xuUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=OxprNK3ATP1WZAT4tkD0v1S4aEc0r+Gg41lbmWLaZHY=; b=nb1T98/AxCr7HoloLDxklLaIqYDYdh2XL4TU9A/ZX3S0N5RlfNFMZnNVBUEs9nU68P fygEngZSxh4LjmbzbV5KOY9ApiVRf7Ljavht/yDQUIL+k31IULin4w7VdP5srCdI+CBg /NX4ttt+bxk9GG1PSBRu1I/48fn7lpyC4uyvMYCdq17IlNlCZJdxQrf31JBWO7FYntrC 0rFz0wuaTlyaygD4ViBAlDScb2t0wEaaa975mZTrGp89825k9xmxGgvmE9tooqP+orhA n1UUshs3+fUWN9caGl6CpMfKmRI9YEW3w8aldLdTGJpSjcE4a+GXvlrJcD+5yfcDw+E5 etEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9si326454plo.697.2018.01.15.12.25.44; Mon, 15 Jan 2018 12:25:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751525AbeAOUZm (ORCPT + 28 others); 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 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0MCUXh-1ejjsh0609-0099QX; Mon, 15 Jan 2018 21:23:38 +0100 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.9.0 Signed-off-by: Dou Liyang 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)