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 6BC0CC433EF for ; Fri, 18 Feb 2022 18:34:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239254AbiBRSfG (ORCPT ); Fri, 18 Feb 2022 13:35:06 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239224AbiBRSfF (ORCPT ); Fri, 18 Feb 2022 13:35:05 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E18E11A4D45 for ; Fri, 18 Feb 2022 10:34:48 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id om7so9293191pjb.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=n+nMUJdLME+EGjMQOoJXVRGFt/Y+6UQiBNcefoToQGa4BsRfWEvG6tdUeIIz22IVX2 nDSOnXljPGm1PWkv/TiBjgWiJJdY/6ieRy1eTsLuO6ty7MfeEQ3gEgZjw3f/EaaNl/ZI MUDyV9l27yE2dLMU+TyibNRhV7aP0P/LtdLSNSzOZBWXB61W0nvqTna+LTGpqz90OJNg W8jSOTlJJhp4HUCoFy5/5dhxfaJzDqpR4fqzlUviCZfiE5Cn6WJ0YdW5eJagNOkg7Zl6 XFmbyRsE4NtFEvqQ0Ee5nOWPg5z4GWyfvFIk3oO4Ft1Mr74YRHa+KZCSO2YiGW01z3WM ykvQ== X-Gm-Message-State: AOAM532fKPLDo1BH0H4zGjFNYKqEIIvimEahI32hr56TrKzfjfoLR/GQ fM8Pb8y8zD/2StNo1Pd5VwNvjLZaIEY7Tw== 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: kvm@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.