From patchwork Sun Jul 9 11:57:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 117504 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp4438261vqx; Sun, 9 Jul 2023 06:14:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlEIanjiI4CU8aK4gMKWrZ8Ssrjw5mG3s0mVGKdpeeVISTkScw8SkonFMx8QBRAl3jsP0E9g X-Received: by 2002:a17:902:ef92:b0:1b7:d23f:8a66 with SMTP id iz18-20020a170902ef9200b001b7d23f8a66mr10265060plb.59.1688908449159; Sun, 09 Jul 2023 06:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688908449; cv=none; d=google.com; s=arc-20160816; b=mSNunpOt9AvDB+X1tAL5KxUpNkI+nOyIyTdkc1MwKabKGCr3mLGpa3iATIJTJW3l76 C5G4wuiX7i1WC88cwxTFrUY368lmWviCqQ5z2F9mSManM51cETLyJLivrqlwJBgn3SUE T1OmVKYGfydX27fVBJcWJ0GtmF4YV8n4sAu5VEWuUnlc5kRZmemdgp71LLXFFx1bu6Qg Y4DD0ManNiMmguNUC9UrKLBvobsNkenMsZPd8rFlTAtmyYY3sGDN5hIMV7h+Z9Ml/mN3 5ehtRu20g+85lge9Ys/+Dlc58YSaS5OS8wmiIL87UhJ8kKw8aPRrMnWGpqrp17zOxXNg Q4vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:content-transfer-encoding :message-id:subject:cc:to:dkim-signature:dkim-signature:from; bh=1kWrvpmhbHCJ21kyLibA+w+bJszSzuk/ADgUYUUWBsg=; fh=FFOvuGpVfxtYCW248UC5FvN/ivnuY+zd4HbKwQso+sg=; b=GdxwzGHGvWPvCVUC2GVvZb2JVYaL/KGLVMZEQhmQsmbYj4YQbXYVPUtk22oaozJMzl x3DIO5zD2rYsPdsFAJNIT0KLhpwOI7g9VpYwFNsStFk/P1KdWeSgAayjbDlerSlksDhp 7LWZAuK+qir8wudnUk50yEMTZ/wBRugRLUh94DRswmqBURvxJs8JIzCdKee4ZlGUhzHm JIrnjrtCPtA73DTWgm9cGf8l2xXPdGVUMWWnUo5RfEUdex70g2VE+RPqvhY8Lk+tp2eF 66yr1ew9ITYEyBqXJHHSibTPM9jQ2s4suikAHTi06o5aCzX4GtFamG5OmjUuOK6pA5tw EoOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="g/6eGCvz"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ka6-20020a170903334600b001b81a112f9bsi6399086plb.586.2023.07.09.06.13.57; Sun, 09 Jul 2023 06:14:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="g/6eGCvz"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231228AbjGIL5p (ORCPT + 99 others); Sun, 9 Jul 2023 07:57:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229915AbjGIL5n (ORCPT ); Sun, 9 Jul 2023 07:57:43 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8341719A for ; Sun, 9 Jul 2023 04:57:12 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1688903824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1kWrvpmhbHCJ21kyLibA+w+bJszSzuk/ADgUYUUWBsg=; b=g/6eGCvzQr9G5hHaE8Q5s6e6A8jKolY2cBKfEoXIr/NhT3usFNvdaAXirbEJzZoo4V1n4h n1mzGGisfOoGrUFhoomrCSkzDDmhnvOEkrEsZRqRih3u5cfxB52Ee3j/pc5ZGnr1oxr+P9 LQXIgriOs2RM1Sm6KnqgS4nRGfM9U0RYs1p2tOPIlaV7rjL5jxCS5lYV4sBL4e69XAm+k5 Lj8kwzt1dm+h2FO0gT3pKCEFZ+YmPS8lIKS/IyfRePqjVPvFNYJ5KhKQyMFEbj2NUsfMHq /AWGbc7diUJfZpdqDQFjkwOgkW+Fi9NfL30tRkT0JiRa4i8j3XhW3DPdq69Zmw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1688903824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1kWrvpmhbHCJ21kyLibA+w+bJszSzuk/ADgUYUUWBsg=; b=EyYSOIXytp7ei7fRWLLgINmcTOhc1EhoVOvHGWswjddJpVoaEC1MM0nxFW6PLQXgDSUe6n 4N5j3hcfuA++tbCA== To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] x86/core for v6.5-rc1 Message-ID: <168890380261.187070.2103277819790991312.tglx@xen13> MIME-Version: 1.0 Date: Sun, 9 Jul 2023 13:57:03 +0200 (CEST) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770948865825783982?= X-GMAIL-MSGID: =?utf-8?q?1770948865825783982?= Linus, please pull the latest x86/core branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-core-2023-07-09 up to: b1472a60a584: x86/smp: Don't send INIT to boot CPU A single fix for the mechanism to park CPUs with an INIT IPI. On shutdown or kexec, the kernel tries to park the non-boot CPUs with an INIT IPI. But the same code path is also used by the crash utility. If the CPU which panics is not the boot CPU then it sends an INIT IPI to the boot CPU which resets the machine. Prevent this by validating that the CPU which runs the stop mechanism is the boot CPU. If not, leave the other CPUs in HLT. Thanks, tglx ------------------> Thomas Gleixner (1): x86/smp: Don't send INIT to boot CPU arch/x86/kernel/smpboot.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 4ee43396b910..7417d9b55b21 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1473,6 +1473,14 @@ bool smp_park_other_cpus_in_init(void) if (apic->wakeup_secondary_cpu_64 || apic->wakeup_secondary_cpu) return false; + /* + * If this is a crash stop which does not execute on the boot CPU, + * then this cannot use the INIT mechanism because INIT to the boot + * CPU will reset the machine. + */ + if (this_cpu) + return false; + for_each_present_cpu(cpu) { if (cpu == this_cpu) continue;