From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5606C433FE for ; Fri, 18 Feb 2022 18:34:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239261AbiBRSfH (ORCPT ); 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-Google-Smtp-Source: ABdhPJxVv/mRb2EhPSozftkcIU8eYn58a6qBEj8s0jA/yOkyFR7Djbb4fHuOjFvBLzo8ayCyt0EVlQ== 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> 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.