Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6549953ybx; Mon, 11 Nov 2019 10:47:32 -0800 (PST) X-Google-Smtp-Source: APXvYqzJGnqhjAm2v4uuSKAE4ofCIKT9lLU6UDkVUT+Lu5q+qv3ZZ2hQCItyPLb0jis6ziYh0eyr X-Received: by 2002:a17:906:7e41:: with SMTP id z1mr23949547ejr.63.1573498052421; Mon, 11 Nov 2019 10:47:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573498052; cv=none; d=google.com; s=arc-20160816; b=qlnfYW1Y2P0R0eQVdBDsnkZUggQbMOgnjoET/eZmrjhYWsr3RGxOj/7PqeMmrkgFPd 7lvSQO/oK/GHrZf3YTzKgsklat1O0IuEq9YIGkzJoyqNO16/RP4CI+zeI786SkXRIEqd ql3mv4tC1iFj+UShSLlTwoXc/1cwHVl4q8egwC/QD7Lf4/ham+dIxSp/ebDdMgYyUkWx PNyFlE/gbHXGmqQXEZUNDUDfmyUmN4BhdwcA/4Qd7vNu4IKnxNyYsq12EkVyaAkg/pYD O5z+I+hWkegaHsx2WdSyasfJeSsAkPbYepRliMkzJAedPFl5/KeNfCFsHfWjTxsi81Jz yaPA== 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=o4mmyNfx4jys2BZDkuCzGflfPMwgC+VGPeMJ25OGKxo=; b=IOHo+E/DAJy6xQxj4pOf4i5xFjn1AUe13LbeqeVAlBDvdgTXrqs7SJ5mQqSUNtQag+ /eLO4wpqmAb8Fr2OY5CQbaduuuFFPUIOEe6NWT4D44G4+TziPMQz5VRbLQIzAFlh0ORt XC2IoJrb2EsJ9Tph/FNebW+CxfAeT6JemWE5F/1Oxer5tU7JB2fVJ6d48Lwc3b5+LcFq +Lndi6IxYo48ezFsXwgXQALpsEESagA5zJvtvWgyY+dtdjz30+ENLuDMRK13rJTL5pPM zAFdnuZ7XYTXeompRPv9yBANfFrer1HKdz4BYLFvINCUXLK/xBowij6NdNaXOuBO77Rz wcAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hplfVdbK; 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 r12si9882567ejx.217.2019.11.11.10.47.08; Mon, 11 Nov 2019 10:47:32 -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=hplfVdbK; 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 S1729214AbfKKSob (ORCPT + 99 others); Mon, 11 Nov 2019 13:44:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:36078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729731AbfKKSo0 (ORCPT ); Mon, 11 Nov 2019 13:44: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 4686020659; Mon, 11 Nov 2019 18:44:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497865; bh=pNojZG6+uptvh6ruf8GlebyJs3A2OICgYByTbMY2uXE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hplfVdbK7K3aFNVZ2ev6N2g2zD6zrfRUPpKi8svcLtRoo1jb/8vn1WovfOyaOXwzZ /l7pHlg7Q5uS6ilD2NhMiI/mq2wL8UlGUQKhG+tccYpZiKiDGZNqW9R3KAAuOnOLx3 jcVCj8BVYtrT1BoXUI8xjvfUYAhhJ+zZFboehoAQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan Beulich , Thomas Gleixner Subject: [PATCH 4.19 041/125] x86/apic/32: Avoid bogus LDR warnings Date: Mon, 11 Nov 2019 19:28:00 +0100 Message-Id: <20191111181445.890477711@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181438.945353076@linuxfoundation.org> References: <20191111181438.945353076@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 @@ -1528,9 +1528,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) { @@ -1571,16 +1568,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 /*