From patchwork Mon May 9 04:13:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 12843027 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3DAD1C433F5 for ; Mon, 9 May 2022 04:15:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uW8o737j9FTG+nM8ReczeezvCwRYOvwKDz65nNDuNsA=; b=h9e41UaR9JpTYS G678EP40JuVg2m6r713OMkbJxA6uAM+EgXoR5DzQb46KTcbe3qftrb1gvq2eNoimrnsX2NpTtnB/M kI5C1gWOn/aHP3oUVFzeNJ/NCDiXU525j6zxXd03AFvOUIXOg9WwkluJljL3ra2p1pVCVMXgbeJpH n6fiOQSRtHRQbk2u+aKY19VZTZVsyb7d6mzdipWCaw+QknsBA/F7DH4qix8uX3KMVsNQS89P1JW3x G1OMskguLHFqiOVN7fGkbd4O5N1rjDEkWy17iv5m5Or89LCWQ1Ay+Zoew/ZUzLvVkF3gezxkAOi7D 5btmOP7msr/OKuxHt+vg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nnumC-00CK6O-Sz; Mon, 09 May 2022 04:13:41 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nnum6-00CK4U-50 for linux-arm-kernel@lists.infradead.org; Mon, 09 May 2022 04:13:35 +0000 Received: by mail-pj1-x102c.google.com with SMTP id iq2-20020a17090afb4200b001d93cf33ae9so15906653pjb.5 for ; Sun, 08 May 2022 21:13:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yvzilvcidt0cy/+jVulM8s/ugqFP0eQunNYQSTfNZQQ=; b=VZlRW/We3EYhQtPGSwiA+/E8SQ9csMkZggbJQP8bDq93RAzZfEkKLiToa0CrYo2R6b Bw9GHO8xdQXPauGeSSZShZ6AcW0osz6zXk11mNUkJ7Zr22PeMHXZRYXR1A0AUoKsFmIG WRcIwZLmoMapXgqfsjRadkRfgdZ994AOY3pKiQ/LhphFBkKpGHvzrqGyFFNzacgFcgv9 uv40xCxir9ojG5hLanVpmtkP3lz5d+JtaVNDHwrsuyWt1ZCckRsmgry7staku/ADL/Bd 515bJtdiGHxIpP1ShGIxCTpusBl39fvK2BUfdMfgXmJOsqCL5A1sEiJGAp9grbq7gYln faZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yvzilvcidt0cy/+jVulM8s/ugqFP0eQunNYQSTfNZQQ=; b=0asiE3kkm+bLpmJnH1kacz7OayiIuaL9Dbh+439vKREvKFGCSkwute7FCHrym/YpuB xvGRLNabXKkWXmcGjKyOcROdCNsbTaly1cKN/GZ+713fmd0w2oj4qTJokJnHAFfY7EQ/ QfpHGQqRA0dT3BCTS7j8/v+hBRptu7j1S7cG9HnSRJ+iWoxHZQQ8mO7cwfWDocR78LCr PQw6pgKqFL4n+5iUtE8+HkXFa4KFv1hOPfz00dlKje4ddc+9nMzUXc7FeZDsP0iO8J7K Ac2I0rEZlh4h0qbf7lbHnjcBzuQJD+qAhephtWE8XHulcB3HunltIydPahldLfU5Tj2J zj+Q== X-Gm-Message-State: AOAM533FL99r53VgNlj1jb322NM8L+zr4BNaJEeYso+oHyJL6BQYqtWQ UNyFbIgfOg2++StlJEHnLg== X-Google-Smtp-Source: ABdhPJznFnzsSty9FB+peqx2+50gFD+ELmjTouVakza/raAO/f8MAY9hh3Kmuhr15ajevdFC9iJDXA== X-Received: by 2002:a17:902:d487:b0:15e:a0a4:69e3 with SMTP id c7-20020a170902d48700b0015ea0a469e3mr14746513plg.155.1652069613718; Sun, 08 May 2022 21:13:33 -0700 (PDT) Received: from piliu.users.ipa.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id m19-20020a17090a7f9300b001cd60246575sm11478545pjl.17.2022.05.08.21.13.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 21:13:33 -0700 (PDT) From: Pingfan Liu To: linux-ia64@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Pingfan Liu , Geert Uytterhoeven , Peter Zijlstra , Kees Cook , Jens Axboe , Russell King , Guenter Roeck , Arnd Bergmann , Wolfram Sang , Lee Jones , Catalin Marinas , Will Deacon , Mark Rutland , Peter Collingbourne , Marc Zyngier , linux-kernel@vger.kernel.org Subject: [PATCHv3 2/2] arm/arm64/ia64: kexec: fix the primary cpu passed to smp_shutdown_nonboot_cpus() Date: Mon, 9 May 2022 12:13:05 +0800 Message-Id: <20220509041305.15056-3-kernelfans@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220509041305.15056-1-kernelfans@gmail.com> References: <20220509041305.15056-1-kernelfans@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220508_211334_249344_DF458DD5 X-CRM114-Status: GOOD ( 16.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org kernel_kexec()->migrate_to_reboot_cpu() has already pinned the reboot thread on a valid online cpu, either reboot_cpu or the first online cpu. So machine_shutdown() should pass smp_processor_id() of the pinned thread as the primary cpu to smp_shutdown_nonboot_cpus(). Signed-off-by: Pingfan Liu Cc: Geert Uytterhoeven Cc: Peter Zijlstra Cc: Kees Cook Cc: Jens Axboe To: linux-ia64@vger.kernel.org Cc: Russell King Cc: Guenter Roeck Cc: Arnd Bergmann Cc: Wolfram Sang Cc: Lee Jones Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Peter Zijlstra Cc: Peter Collingbourne Cc: Marc Zyngier To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/kernel/reboot.c | 2 +- arch/arm64/kernel/process.c | 2 +- arch/ia64/kernel/process.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/kernel/reboot.c b/arch/arm/kernel/reboot.c index 3044fcb8d073..898405682e08 100644 --- a/arch/arm/kernel/reboot.c +++ b/arch/arm/kernel/reboot.c @@ -91,7 +91,7 @@ void soft_restart(unsigned long addr) */ void machine_shutdown(void) { - smp_shutdown_nonboot_cpus(reboot_cpu); + smp_shutdown_nonboot_cpus(smp_processor_id()); } /* diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 7fa97df55e3a..e5c130582cc6 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -86,7 +86,7 @@ void arch_cpu_idle_dead(void) */ void machine_shutdown(void) { - smp_shutdown_nonboot_cpus(reboot_cpu); + smp_shutdown_nonboot_cpus(smp_processor_id()); } /* diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index d7a256bd9d6b..ae732e35e7da 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c @@ -575,7 +575,7 @@ cpu_halt (void) void machine_shutdown(void) { - smp_shutdown_nonboot_cpus(reboot_cpu); + smp_shutdown_nonboot_cpus(smp_processor_id()); #ifdef CONFIG_KEXEC kexec_disable_iosapic();