Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6539433ybx; Mon, 11 Nov 2019 10:36:50 -0800 (PST) X-Google-Smtp-Source: APXvYqxI60OkckaJnPN/ZBKtbxw1S4afYtddv5sZg7OUTwOdFeTZIuxTrFWX2Fo5QZPIM/vJiwSG X-Received: by 2002:aa7:c048:: with SMTP id k8mr27953444edo.254.1573497410115; Mon, 11 Nov 2019 10:36:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573497410; cv=none; d=google.com; s=arc-20160816; b=eSuep2qAL/PbwyYV5zIvayuPzRjs4x35Qy71n/GF/zfGWioS/y6Ia0+qii5eEU+opM dvpWuKjf5xjsfCJR0vtdfrLChdb70/DFu2wuUJgsDOQa9ThmSXbL4Fwh5foW75+p3txv LUmOtUHaQexFiNIF1/tjOYYDuP5jKeJLZfEf+IVf8DI635wvzADnYtXJKzI4DnCsKyTP tQTlkTmz3iuDNT9Vr+i27W5kctAGKqk/82F4NOE07ZxdjFjjJLwnaR2Hr7ol74Ndzco/ XyKSc7VoZFrEkK7F5xvkBW3rjQsaxtsuHU1uoL03r3xJz0SHqVijXwwXr5GUSlAXbnGM LxSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8pnIzhTrPOOiWiJ2Xt2QAZDz9kzOx4+yTR1Nlw/fnCE=; b=NbNNLIpUyoRX4b1L6yA9vR2QwnSkFLI+odrgU7sHS0Gk3u304uhPFPAP/G4kUdkMX6 GrpeHgxIUTPi3QL7F1dBr+C/fmRHGqxAkUl7PPD45zcPckW49qutjvjUyOZc0pbESGvt cLQsb1tHS0hW3doHeEOR+KFaomssNjfPpTud2zzSh/K2Rp/gUigBIzdfA348HChwJSoy gkwyaBAbQ0j0/kMY5zn2ZGNHNPWsp9yRbMg/lK1u7kQ/0yFXs9KrzpxiFiduBpZbkcND HVnYcueRVkpWVceSIHb7q2mnpV4UCHbU/TJX1KZsLIXMGjjJcEF5pijrmo1zJmYbGgRE V/VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OGN2+CGy; 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 y16si9637686ejw.142.2019.11.11.10.36.26; Mon, 11 Nov 2019 10:36:50 -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; dkim=pass header.i=@kernel.org header.s=default header.b=OGN2+CGy; 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 S1728363AbfKKSeb (ORCPT + 99 others); Mon, 11 Nov 2019 13:34:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:52150 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728343AbfKKSea (ORCPT ); Mon, 11 Nov 2019 13:34:30 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0E60A21655; Mon, 11 Nov 2019 18:34:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497269; bh=ruQE4AZSfn+uFm1Jnz+1l3fCPEtKaaORfqJq7BvjEco=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OGN2+CGyS4M4OjOqLrNAJ4rURZRJPFWhhcq6GscRKgzXB4IwJvuC+Cdt1z31xGmQs 7qpjalSgA7g/5TOHUMO8pWawkwShz97UwSBTX1P7MJqpeMx2nPqVvgwAAqSSzaChCT V0PgJKogznaaiJgBVqNiY2r6VYQlYLPPawqp7/hw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan Beulich , Thomas Gleixner , Sasha Levin Subject: [PATCH 4.9 62/65] x86/apic/32: Avoid bogus LDR warnings Date: Mon, 11 Nov 2019 19:29:02 +0100 Message-Id: <20191111181356.216949292@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181331.917659011@linuxfoundation.org> References: <20191111181331.917659011@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jan Beulich [ Upstream commit fe6f85ca121e9c74e7490fe66b0c5aae38e332c3 ] The removal of the LDR initialization in the bigsmp_32 APIC code unearthed a problem in setup_local_APIC(). The code checks unconditionally for a mismatch of the logical APIC id by comparing the early APIC id which was initialized in get_smp_config() with the actual LDR value in the APIC. Due to the removal of the bogus LDR initialization the check now can trigger on bigsmp_32 APIC systems emitting a warning for every booting CPU. This is of course a false positive because the APIC is not using logical destination mode. Restrict the check and the possibly resulting fixup to systems which are actually using the APIC in logical destination mode. [ tglx: Massaged changelog and added Cc stable ] Fixes: bae3a8d3308 ("x86/apic: Do not initialize LDR and DFR for bigsmp") Signed-off-by: Jan Beulich Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/666d8f91-b5a8-1afd-7add-821e72a35f03@suse.com Signed-off-by: Sasha Levin --- arch/x86/kernel/apic/apic.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index ad2a220a4a7f7..722a76b88bcc0 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -1341,9 +1341,6 @@ void setup_local_APIC(void) { int cpu = smp_processor_id(); unsigned int value; -#ifdef CONFIG_X86_32 - int logical_apicid, ldr_apicid; -#endif if (disable_apic) { @@ -1384,16 +1381,21 @@ void setup_local_APIC(void) apic->init_apic_ldr(); #ifdef CONFIG_X86_32 - /* - * APIC LDR is initialized. If logical_apicid mapping was - * initialized during get_smp_config(), make sure it matches the - * actual value. - */ - logical_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu); - ldr_apicid = GET_APIC_LOGICAL_ID(apic_read(APIC_LDR)); - WARN_ON(logical_apicid != BAD_APICID && logical_apicid != ldr_apicid); - /* always use the value from LDR */ - early_per_cpu(x86_cpu_to_logical_apicid, cpu) = ldr_apicid; + if (apic->dest_logical) { + int logical_apicid, ldr_apicid; + + /* + * APIC LDR is initialized. If logical_apicid mapping was + * initialized during get_smp_config(), make sure it matches + * the actual value. + */ + logical_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu); + ldr_apicid = GET_APIC_LOGICAL_ID(apic_read(APIC_LDR)); + if (logical_apicid != BAD_APICID) + WARN_ON(logical_apicid != ldr_apicid); + /* Always use the value from LDR. */ + early_per_cpu(x86_cpu_to_logical_apicid, cpu) = ldr_apicid; + } #endif /* -- 2.20.1