Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6556606ybx; Mon, 11 Nov 2019 10:54:21 -0800 (PST) X-Google-Smtp-Source: APXvYqy4K6C0xFZho0ycNreVMZ2ncSKhA6AVhSbbwChWQ2agJr5YSIsI4ykNgVynjh2jfdm1gMFb X-Received: by 2002:a17:906:2e5a:: with SMTP id r26mr24526081eji.283.1573498461715; Mon, 11 Nov 2019 10:54:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573498461; cv=none; d=google.com; s=arc-20160816; b=RXm3z4Mc5cv1BB7eK5aD8SJ9tZ8WRGdJz2EnX85tnAYDrk2ZQ11y6PRdLGoczqqv6J AqOnXOx4Me04HJtFKyNVfO+iDnQoO5TZCUSRdk01aFAkDZCvsmnSMrFJAhLmqnqBggFT X2h+7anhsToLyBp2Ga9ec4D9RTNwjB3UQDi0AtHiZUGpsoi33XqxHvNzNnGF6qe8re/e BZE7BZ9G/qRwlRq1f3wKrU5ILWcbf50xUqB5F8L93dv86OqNknt1M5E8cArYWKKFJeqb j2aeh32H6WTqXxnVrypv0eQ4jNw9W0bYFh3TlU6RxdYk6Bsn1KozOyoYSPmt1MuUHzql EMSw== 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=tVCCWt7bTGrLB7iVhNQUtHnaWGrPSTtdawbDs6QAiGs=; b=fxPegAHVOFOnexYYllxO6u/mEwpOk+Vquu/ENKGnGxvQdHjS0Gre2VKhja0qbdE10q aadi+WhLjlc8INsmybb4bSd+/2MWBFm8lgA8B3ATSqfbg4YLeLsVLVkz7hTcNkRKKwkN +mDUWeosVnXmKXwjxXapqPmwAu8IUU/xokfVzFh+T3JsZJ1y0tdxjE+k1uJox5uI4RIj b7dRKDmee2PjiI9ZATGbyIhA77EssSMWn/w6YQON9mk8f5EpeePpwCxKDliE1U+t18tH xt99amIuVXNXeTwmVXTzmFbLLnz+kMMXv6jGdvdticmBXGy8TTvoo75ExdcizQT++/Eo iUfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Xuc/M00k"; 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 r12si14280573edi.272.2019.11.11.10.53.58; Mon, 11 Nov 2019 10:54:21 -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="Xuc/M00k"; 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 S1728572AbfKKSx2 (ORCPT + 99 others); Mon, 11 Nov 2019 13:53:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:48220 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729594AbfKKSx0 (ORCPT ); Mon, 11 Nov 2019 13:53:26 -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 84078204EC; Mon, 11 Nov 2019 18:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573498405; bh=PqiC49kc30tvGS27xJH3WX24/feVFXmbvnQN0nLxgJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xuc/M00klHF1RhOiVf2Sr2ckRCLv4V8otAusOpdOOv5n1UvJBvAmAcwI6Pnfl1TIS 8Hmhagjv/4DCOXaYKPuhdrJjUSCj3z13PveHn6ANxyYdH2appftpZXe3OQqzqVo7Ae h6wq8gXWP4FBy7mas9srWuyDMvIoAoL5QRvSyCxw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan Beulich , Thomas Gleixner Subject: [PATCH 5.3 070/193] x86/apic/32: Avoid bogus LDR warnings Date: Mon, 11 Nov 2019 19:27:32 +0100 Message-Id: <20191111181506.275154395@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181459.850623879@linuxfoundation.org> References: <20191111181459.850623879@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 commit fe6f85ca121e9c74e7490fe66b0c5aae38e332c3 upstream. 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: Greg Kroah-Hartman --- arch/x86/kernel/apic/apic.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -1573,9 +1573,6 @@ static 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) { @@ -1616,16 +1613,21 @@ static 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 /*