From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D91B2C4332F for ; Sun, 8 Sep 2019 13:01:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B2E3A2081B for ; Sun, 8 Sep 2019 13:01:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567947662; bh=M08pN6U0av6fpQMntlrBxMg+VAGfeSYQQXQfcRbQ7TY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=l/D/YIjnJ8obDuuHZMYC8EoVgCErtEJOw+ZDnq4yadGkkPTTtBGvx3bUn1UM9BR0m pNlYsa6RDUUJqJGeLZcdsOqTzWBuGHpiuAzmvTN0l/d8ROzYhb3tRBSDrFmM7df5Ng uu77Oc74KjDMmW/3x/wjY0BNVvifVSlZrItT16Ko= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729562AbfIHMnp (ORCPT ); Sun, 8 Sep 2019 08:43:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:57872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729539AbfIHMnp (ORCPT ); Sun, 8 Sep 2019 08:43:45 -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 DFB4B21971; Sun, 8 Sep 2019 12:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946623; bh=M08pN6U0av6fpQMntlrBxMg+VAGfeSYQQXQfcRbQ7TY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DcQx5fHxW4UH2uPUiJ3jZvSvi7s1Subra4N2OY993x/GeMbaAaPs07NqKLKxR5010 OInAjx6jEZ/ritQivljl+JLVNhqsw5+Y5hCdv3RXAosfGSXLFhhHeRC+7SQkwRXX+c 8qGK5BPYIA19nkJTmv/vYI/jBjgLjEy4ZfHgwcQk= 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.4 21/23] Revert "x86/apic: Include the LDR when clearing out APIC registers" Date: Sun, 8 Sep 2019 13:41:56 +0100 Message-Id: <20190908121104.672832570@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121052.898169328@linuxfoundation.org> References: <20190908121052.898169328@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 80c94fc8ad5ae..834d1b5b43557 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -1031,10 +1031,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