Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp2105749pxb; Sat, 19 Feb 2022 02:21:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJz8OlSsHdA13GC/r8RhF5fAPR70pKFIFi0rFP6wG1Ns4HvWatfGHDDJcvrQRdxdwkCARtbh X-Received: by 2002:a17:906:a24b:b0:6ce:70da:12bb with SMTP id bi11-20020a170906a24b00b006ce70da12bbmr9024427ejb.667.1645266114274; Sat, 19 Feb 2022 02:21:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645266114; cv=none; d=google.com; s=arc-20160816; b=fwqWQaGIopWAW3D0jKGdPE44/esV9L2SYh9TGPolyML0ghMjadFptvVw7oRNXVWUJ6 5xaLOCyV7++vceJSaAHPBndo038NLXa96XTmuKkU6IP3mzdXmkL7Ez4E02HhAr3sceKM r9OF1Pxq2zvMUVpcqY2+Z26979FfMvjExAPOddYlKzreOU+aiZJVT8+3hAaBQe88OWvz gLfnOqM8DBokbsWalfjqY/aGKuDiowxkfR7JhYPYg/CyJipN+CpTpPP+6wO7132Ayluj 7c0/OaOclMaD2iorgpJiM8k2CJiLwsR50frGRVIdwK+AcE3eGuQsTlDxrtbVSxr36fuJ +mMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6ui+XdqQ+V/acH1rGOlyzDTKLEuaung66NwvBtj6LuE=; b=sunAushnPRN+pZ++iiNbXlkYmT8HidOQcCLxyi7tziWSFu1o8LKNv7NJFR82ugYfdZ kGSLQVR1IFnFsre1VN27RirV10NLlP5kF5bxJtfhxNnw1Zb8Fj/FNrzUqjD2dHRHu16u pY+Df0DK4c/so9Xuwjeg6bQNCeFtMCX1OVfCNo2E1sEpZkkTAaoidVxuFwlKdBdlTM+E Ay2LMRvkcpubSd6LMzXrxbBVh4WMkJnflrwjh7Jzt2AeI2bVh2ICZEjhfZQxgaoKAdt2 3pCtwSwFhXKQ8Y5UXUCOcl+xe+3iZngD5459EYNoPUKM1Fw6DCR338fphXogveucy3lS HK/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=X8Yel7V2; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h16si7580899edj.304.2022.02.19.02.21.30; Sat, 19 Feb 2022 02:21:54 -0800 (PST) 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=@google.com header.s=20210112 header.b=X8Yel7V2; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239224AbiBRSfH (ORCPT + 99 others); Fri, 18 Feb 2022 13:35:07 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239233AbiBRSfF (ORCPT ); Fri, 18 Feb 2022 13:35:05 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E66661A4D46 for ; Fri, 18 Feb 2022 10:34:48 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id om7so9293194pjb.5 for ; Fri, 18 Feb 2022 10:34:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=6ui+XdqQ+V/acH1rGOlyzDTKLEuaung66NwvBtj6LuE=; b=X8Yel7V2IYImut8lQ0/DhVg5Kkg4WbtG3wN/JWTFXB8siwNd9e/xyeaRYAtT6WZRqQ VM+Vd8LSykDzBvCWff30AJNihA3q3n0MDibbC4Vw0Ag8nJjg0uLvqeKy4EcdZqT3p1Ly 8+Dq+n7P0DgbbNzZex+aB8SU6M+ZJ5XeSDzbQrJPlUFMcqJV9UWauyV4i8vG2W5Zes4c DqwTa5sb2uf3y5IE1mWKfTpv0yJvvX+XnRQ04u44SXHSpw+B9U++KYBmqh8FUJPQsjr1 cWHWxoSZEIld6gQAdIZ2X2zZENXG6WKvoO7Jn3MdLOtzyINhfbhFi5bqy0gjvzU6E08N mdBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6ui+XdqQ+V/acH1rGOlyzDTKLEuaung66NwvBtj6LuE=; b=Vm81dWl+uvB9QkpjCyiuKRAp9PHln/+zc/gDCp0KIdZGcusKezymQFO5+NwtMGzL6c pF1ABYh6IYFRxn1+89NceLD8f/URN2PzbxTrt7vV6K0Lhyod1WBV2T+5yC8bRb0VKkYk sGYrCQb4PeP41t24Y44Trho7hm0wSFMidHCw6R7ngYQzAZm2zBlknrEUN88MIjtsh2Tu EVDvILZ6F2k/p7SmPRyVdL3g+eGL0C3t3fmGV1Gp8dCOb3aXm4duMLGNbdXVvueWlrJ+ 5iH77lWmiMxc5D5KnMhrG7j0YqbdLBsOclT/DzEMuZ963YsjSP9BAbVQNBZfI2lTb6ue YDcA== X-Gm-Message-State: AOAM532dbiK5LtGv/p1cSax3GrUqUi07rmpoOFIiKWCoFkVdebycQ1P2 FGkIoYopp9jOSaeebSFaozfn8A== X-Received: by 2002:a17:902:9348:b0:14d:8ee9:329f with SMTP id g8-20020a170902934800b0014d8ee9329fmr8484514plp.80.1645209288178; Fri, 18 Feb 2022 10:34:48 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id h5sm3519418pfc.118.2022.02.18.10.34.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 10:34:47 -0800 (PST) Date: Fri, 18 Feb 2022 18:34:44 +0000 From: Sean Christopherson To: Chao Gao Cc: maz@kernel.org, kvm@vger.kernel.org, pbonzini@redhat.com, kevin.tian@intel.com, tglx@linutronix.de, John Garry , Will Deacon , Shaokun Zhang , Qi Liu , Sumanth Korikkar , Thomas Richter , Dave Chinner , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 5/6] KVM: Rename and move CPUHP_AP_KVM_STARTING to ONLINE section Message-ID: References: <20220216031528.92558-1-chao.gao@intel.com> <20220216031528.92558-6-chao.gao@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220216031528.92558-6-chao.gao@intel.com> X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 On Wed, Feb 16, 2022, Chao Gao wrote: > The CPU STARTING section doesn't allow callbacks to fail. Move KVM's > hotplug callback to ONLINE section so that it can abort onlining a CPU in > certain cases to avoid potentially breaking VMs running on existing CPUs. > For example, when kvm fails to enable hardware virtualization on the > hotplugged CPU. > > Place KVM's hotplug state before CPUHP_AP_SCHED_WAIT_EMPTY as it ensures > when offlining a CPU, all user tasks and non-pinned kernel tasks have left > the CPU, i.e. there cannot be a vCPU task around. So, it is safe for KVM's > CPU offline callback to disable hardware virtualization at that point. > Likewise, KVM's online callback can enable hardware virtualization before > any vCPU task gets a chance to run on hotplugged CPUs. > > KVM's CPU hotplug callbacks are renamed as well. > > Suggested-by: Thomas Gleixner > Signed-off-by: Chao Gao > --- For the KVM bits, Reviewed-by: Sean Christopherson Someone with more knowledge of the CPU hotplug sequences should really review this too.