Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4850346iob; Mon, 9 May 2022 03:09:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9a1p3Ril7UeNv/CuvD8fi9ADeRSXUeDonM/nF5FG+XwfiJUhqJYW78WGpBvqU639H9kst X-Received: by 2002:a17:902:d490:b0:15e:b443:6852 with SMTP id c16-20020a170902d49000b0015eb4436852mr15509185plg.111.1652090988913; Mon, 09 May 2022 03:09:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652090988; cv=none; d=google.com; s=arc-20160816; b=uz2EUHlPMdZBXydZi8ix7NkHmTwkOHypS/9mUqVJpR0KXKuTS2x93aR/8hoGQ//si0 9JEXlFHGNsHxVH47uZ7OgH9uGcr5zVIj2GoZFyzJZRQ0ohCK7oYEJQH1P9pwrwGvIALo 6f9Yj0rMKUvn7KsnsI/OB/MF3Q3i34drJi+flrpSK1LIxTnsbp9fbZRRWoTussInlCvY fMDPB+gT3LIq3HRnHEJGUaiB6jB/ONkaPT9GrMnt1gaiH1EmO7CtcXVuuvIURGh96pEd 4WDPp+bIYZxo2H3WWk6kGN+yWMKJu4lfdJnOkZcN2Gw1eyeeWSgXQNtWWGcu4avmDjkL kKmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=i4ZmSEZyae107M7woQKre9aBPoaep2udL6cDHmolvx4=; b=wa8bRlJMPv2FHu3CRtP2FFPkwkZtDJpxeuvxFYONRkzI6FxE+zd/DUl0NmjZoyIhuk 9fiyDIQZSLAtibG0zUUBC+7SBdJCP5bTVI2UHzN2V9h7nqWJ1cC1bAKqMu4X6mfYmCoU B/VF2Ca+Hl8og7GVYVhELiwF6Nbx+WKivMIJ/dMLMkOIJoo07bAanuOBorOCvhKGBrKX g2qdyauTzGq0qzc4+7yyyWXrZmfggj+5njj+OMqrYCFCMJD5bTPPWJqM/MmioJx/4KWm dexGp8TnGqhfwzFWfyyptHCynOXRyawHQFes4RTeJXejK1w3vTNwz1sow48EM0PvwJlp NpgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EelE4Sk2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id w4-20020a056a0014c400b0050e17a48253si16172013pfu.117.2022.05.09.03.09.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 03:09:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EelE4Sk2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3FFE8227801; Mon, 9 May 2022 02:49:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232606AbiEIE1A (ORCPT + 99 others); Mon, 9 May 2022 00:27:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234220AbiEIERT (ORCPT ); Mon, 9 May 2022 00:17:19 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D391A11922A; Sun, 8 May 2022 21:13:25 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id cq17-20020a17090af99100b001dc0386cd8fso11719142pjb.5; Sun, 08 May 2022 21:13:25 -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=ULAP5IHq7nPoYoWagFHgca4TVzdX6PcHk8CSjbkKR2uql9cD4ftNojc6sDAtfNhzfZ gs/DPPBF5eSecSP3E4ww3H44ebF++e4mmUXt3x5NkFLak2WpbRH3wtZtd8GW9OWLSWd0 UWzdHQP1nMXIxwvrGBoGFowdggGALWfO0jFPLtC0/Y2+D4jK1EvCVQhlBIJ5rHYhxRjq ZiOq91IbI6Zwh9dfRLzZ3KiprRZZnVRDBcp6kzibUtK9HuJELV32pavYPlvcKevQkpR3 Sbm2ew4AaFuVPdMMzxOeqQaXYi23P0R7wmDGgfZJxQrOoYycYttrYaX6evgudR7cUa/k oKqA== X-Gm-Message-State: AOAM533s9h/53jyabYEWfvDRyFjQ2Ea7mZpZr1UXzprsOKkXkJjsRPe4 9OjfTEYK5H2IfIkBAq3rnZgdH70RPRsx 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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(-) -- 2.31.1