[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yg/mxKrB5ZoRBIG+@google.com>
Date: Fri, 18 Feb 2022 18:34:44 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Chao Gao <chao.gao@...el.com>
Cc: maz@...nel.org, kvm@...r.kernel.org, pbonzini@...hat.com,
kevin.tian@...el.com, tglx@...utronix.de,
John Garry <john.garry@...wei.com>,
Will Deacon <will@...nel.org>,
Shaokun Zhang <zhangshaokun@...ilicon.com>,
Qi Liu <liuqi115@...wei.com>,
Sumanth Korikkar <sumanthk@...ux.ibm.com>,
Thomas Richter <tmricht@...ux.ibm.com>,
Dave Chinner <dchinner@...hat.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 5/6] KVM: Rename and move CPUHP_AP_KVM_STARTING to
ONLINE section
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 <tglx@...utronix.de>
> Signed-off-by: Chao Gao <chao.gao@...el.com>
> ---
For the KVM bits,
Reviewed-by: Sean Christopherson <seanjc@...gle.com>
Someone with more knowledge of the CPU hotplug sequences should really review this
too.
Powered by blists - more mailing lists