From patchwork Mon May 9 04:13:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 12843026 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 3D692C433EF for ; Mon, 9 May 2022 04:15:02 +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: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:In-Reply-To:References: List-Owner; bh=RdHXI0Uy37MeRNt3rp2kBkq445Fua3hduzn3stB/NLE=; b=3eG0LoIwda5rwE Ifwa2hBUw+C6LjV69Ukb1dz/YOvXEhrX6NMiaSGmGieaiBlS/2fjg7p4/s4A72XqFCOTDKcMu/agz qt3H+XJ6Sn+PSWPEy6Zavnihw/ikwkKpAvSWqpCB2A6hVHj2v169bB7Bv5v/80VIL4Ad3xm6TtRAI h8w9FMjIS2veYMbK2Tq6mSyLaGnnpaXgQsvD5bJFSIsU8Yog4tXgo5p19CM2hmtRZpwCgU6AF6yRA caC38PHuO/ZZ7ZajKoEt7zyOQqVPTHXm4enL7/pgPAKrzvryYY6/0OWLJAsTubgAJots3X8HIlhKY czO/l5AFOfjjmMcP1QTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nnulz-00CK2I-8L; Mon, 09 May 2022 04:13:27 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nnulv-00CK10-Og; Mon, 09 May 2022 04:13:25 +0000 Received: by mail-pj1-x1035.google.com with SMTP id o69so12023590pjo.3; Sun, 08 May 2022 21:13:21 -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:mime-version :content-transfer-encoding; bh=i4ZmSEZyae107M7woQKre9aBPoaep2udL6cDHmolvx4=; b=EelE4Sk2rLVbk1vLK9xnYcqXSyseWXVcrB40eFirQUnctT0lgrGQBnNU9A2L6k+bb7 OjDg+CYdzVjkdzqvx5z0D/d1zRh6WjH0+7K8OQrg1yKK/yaIsti73fDLvugPzgRgE98p Po61z8180HgTwzAO1H7b46taafqDlg2GeN2Z8lI+6hpgcfQhlQV2ivduSA92N8HYX79q 6qN07SFMZpwKLDRQr2aKIJiRfiaTUsp0HBUDbIAPm+s4S8xU32heA+KWOUxMF3xvaVvn fTGg+jDPKbodCq8Vtpj2sSfKIvQXG4tMqXOx/iBl9keMTJkMEduWgBvuxY1EFLa/QuB1 Egqg== 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:mime-version :content-transfer-encoding; bh=i4ZmSEZyae107M7woQKre9aBPoaep2udL6cDHmolvx4=; b=0Ik7eiasB1VC8YYDS9CJuSPBLRnf/pTrYYwiWFmyE05fJ90PpaPZAMDDUOOmHOETDy 8EK7G8Y5qXxP/+C6qd+aE6QByDh9BaPSHUWN9Bzwt537ArncxSAOZLv8WymbJhjV1ZG7 W1xWt4zkgz9M1feyAdgwXiAQLIlzvmbk3injkabNPPnIAe9HDC3crASTxIP2NzmEh48Q ju+xyTz76Nna3baN6/1zkWxsB4nlY5dk75Q7C+5kzjnzs53Ys0X7UoWzuqM6vOXQwdAt rZsryiYe2KIPk0xql8iErtvydfElTh26ArDuywqpjZEIBpjuJO581PFBOKvw9Em5XvYF C8qQ== X-Gm-Message-State: AOAM530lp76cdIyXE4Ri2s+1JRYAZEVYhAusiFlleLKy0EGqvhIYvXM2 vnEfXvZoctW6YHhPmXME3A== X-Google-Smtp-Source: ABdhPJwA12GMNtxipiY1QrrqNCB1QXJ3EJmQp3Iv9uD5xQEH9BSDFsZL5vlxX/0LpgkUo1SfW2hNOg== X-Received: by 2002:a17:903:1211:b0:15e:8208:8cc0 with SMTP id l17-20020a170903121100b0015e82088cc0mr14708514plh.52.1652069600512; Sun, 08 May 2022 21:13:20 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 21:13:20 -0700 (PDT) From: Pingfan Liu To: linux-ia64@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Pingfan Liu , Eric Biederman , Peter Zijlstra , Thomas Gleixner , Valentin Schneider , Vincent Donnefort , Ingo Molnar , YueHaibing , Baokun Li , Randy Dunlap , kexec@lists.infradead.org, Geert Uytterhoeven , Kees Cook , Jens Axboe , Russell King , Guenter Roeck , Arnd Bergmann , Wolfram Sang , Lee Jones , Catalin Marinas , Will Deacon , Mark Rutland , Peter Collingbourne , Marc Zyngier Subject: [PATCHv3 0/2] cpu/hotplug: Keep cpu hotplug disabled until the rebooting cpu is stable Date: Mon, 9 May 2022 12:13:03 +0800 Message-Id: <20220509041305.15056-1-kernelfans@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220508_211323_867520_316FEEC4 X-CRM114-Status: GOOD ( 16.12 ) 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 For the arches (arm/arm64/ia64/riscv), which relies on the cpu hot-removing mechanism to implement "kexec -e", it is important to make sure that the rebooting happens on a valid online cpu. And this logic should have been guaranteed in migrate_to_reboot_cpu(). But the current code has either contradict (resolved by [2/2]) or redundancy (resolved by [1/2]) about the logic. V2 -> V3: Taking in [2/2], which also has problem with the valid rebooting cpu. (I had sent three patches for different arches. But maybe it is better to collapse them into one and collect acks from different arches' maintainers ) Cc: Eric Biederman Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Valentin Schneider Cc: Vincent Donnefort Cc: Ingo Molnar Cc: YueHaibing Cc: Baokun Li Cc: Randy Dunlap Cc: Valentin Schneider Cc: kexec@lists.infradead.org Cc: Geert Uytterhoeven 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 Collingbourne Cc: Marc Zyngier To: linux-arm-kernel@lists.infradead.org To: linux-kernel@vger.kernel.org Pingfan Liu (2): cpu/hotplug: Keep cpu hotplug disabled until the rebooting cpu is stable arm/arm64/ia64: kexec: fix the primary cpu passed to smp_shutdown_nonboot_cpus() arch/arm/kernel/reboot.c | 2 +- arch/arm64/kernel/process.c | 2 +- arch/ia64/kernel/process.c | 2 +- kernel/cpu.c | 16 ++++++++++------ kernel/kexec_core.c | 10 ++++------ 5 files changed, 17 insertions(+), 15 deletions(-)