Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4096998ybe; Mon, 9 Sep 2019 04:14:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzu1eqpaSxO35NJmTFpKLdcKfq8lCkFXfd0OJHS9eem0aPgH8R6llqq0nM8aDLq4hwHRErn X-Received: by 2002:a50:d758:: with SMTP id i24mr23448432edj.246.1568027683133; Mon, 09 Sep 2019 04:14:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568027683; cv=none; d=google.com; s=arc-20160816; b=x0e8K3VuqTJ0bJkQ6/5jwB0vw2ZbOKicopNrOqc6lnL7ubZQkpPiXIO4B1fC88ubCJ Kk2wuohUuVIKKcQ2ww6UOF5kJdklE1XnWmzv769BaNxjZ7Yjro0iEpvomO7chjY7Lwt+ Uruuu7H/I31vTjGCrNHzyEXHG8Vb3PwPoBeGhOHslB1XOO6IMg8qBAr38ZMoy1a9VB4N d4HGOIQ8cn5wdpbfzQe2xFfCMOBHBXhtJWOh14wNx7SlpdDHHKuHOJ30OZzHr9IYF0L3 l/7PZDHi7G5IeM5NfoAgXC9xApwBi/GipHYWJ6CFXvPdPtjcfTF2BQDwsBvkSI/sa+Re xHyw== 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=HDIMzdfXXEOfl4GwiupXYSE3KfjSawv5DiT7CGwJFt0=; b=H6JeFqYhYuI4oUnEqD39c9JxTYvcIvlKmDcVBLLli1yz0p0p/+q6IM1D8bn01tq5Mz n3iNOYpXzRj7hM57srlOfB/7p2yFdKH9opYQryCZL3uiXgs5AH7v4PZlzdYnKy8BqEBs JKs5ka1L8yLnCegtg4ECGb/B2UgAYNClIk/+x1s1YYA5Vl0N+gth1UmGeXu0vlV4i6xG OlPwx0hOI9NsEsYAqKkvdL6oa9gP8Gf+yrREAcBpQ99L45iF87AzGUBFaCAYlyugL20W yqSgrzKAEHCuVdLF3egPDLCyG+h8Gvq2A+7XJ55NUZlOcsP2dJSUtdpz+2vxc3OJukMM eR0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c1xpCyrf; 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 h14si8665807edb.425.2019.09.09.04.14.18; Mon, 09 Sep 2019 04:14:43 -0700 (PDT) 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=c1xpCyrf; 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 S1731274AbfIHMtC (ORCPT + 99 others); Sun, 8 Sep 2019 08:49:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:38482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731252AbfIHMs7 (ORCPT ); Sun, 8 Sep 2019 08:48:59 -0400 Received: from localhost (unknown [62.28.240.114]) (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 0A4E3218AC; Sun, 8 Sep 2019 12:48:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946938; bh=uldvdnQtccwzl2Fu+7GwSHUtMFCoTg+WbS+B7cuuhI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c1xpCyrf63llK37oXJOeUYB9ubLSZ/gUAHWaJGkXd1X/RBbXFKy3TvPDxAEF0QPOC 3VWqwBJuOwtpcUwQHr11bjFTBSWuqFa5XtKE3iyxFvAcsELPCdiF2fNBc2eV4AUWsS HpLFFv1OQ0Au6vgFHXW6eJCUDnyZAfSm39zjHuOE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Wilson , Thomas Gleixner , Bandan Das , Linus Torvalds , Sasha Levin Subject: [PATCH 4.19 57/57] Revert "x86/apic: Include the LDR when clearing out APIC registers" Date: Sun, 8 Sep 2019 13:42:21 +0100 Message-Id: <20190908121146.679875798@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121125.608195329@linuxfoundation.org> References: <20190908121125.608195329@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 [ Upstream commit 950b07c14e8c59444e2359f15fd70ed5112e11a0 ] This reverts commit 558682b5291937a70748d36fd9ba757fb25b99ae. Chris Wilson reports that it breaks his CPU hotplug test scripts. In particular, it breaks offlining and then re-onlining the boot CPU, which we treat specially (and the BIOS does too). The symptoms are that we can offline the CPU, but it then does not come back online again: smpboot: CPU 0 is now offline smpboot: Booting Node 0 Processor 0 APIC 0x0 smpboot: do_boot_cpu failed(-1) to wakeup CPU#0 Thomas says he knows why it's broken (my personal suspicion: our magic handling of the "cpu0_logical_apicid" thing), but for 5.3 the right fix is to just revert it, since we've never touched the LDR bits before, and it's not worth the risk to do anything else at this stage. [ Hotpluging of the boot CPU is special anyway, and should be off by default. See the "BOOTPARAM_HOTPLUG_CPU0" config option and the cpu0_hotplug kernel parameter. In general you should not do it, and it has various known limitations (hibernate and suspend require the boot CPU, for example). But it should work, even if the boot CPU is special and needs careful treatment - Linus ] Link: https://lore.kernel.org/lkml/156785100521.13300.14461504732265570003@skylake-alporthouse-com/ Reported-by: Chris Wilson Acked-by: Thomas Gleixner Cc: Bandan Das Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- arch/x86/kernel/apic/apic.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 90be3a1506d3f..b316bd61a6ace 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -1140,10 +1140,6 @@ void clear_local_APIC(void) apic_write(APIC_LVT0, v | APIC_LVT_MASKED); v = apic_read(APIC_LVT1); apic_write(APIC_LVT1, v | APIC_LVT_MASKED); - if (!x2apic_enabled()) { - v = apic_read(APIC_LDR) & ~APIC_LDR_MASK; - apic_write(APIC_LDR, v); - } if (maxlvt >= 4) { v = apic_read(APIC_LVTPC); apic_write(APIC_LVTPC, v | APIC_LVT_MASKED); -- 2.20.1