[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3ZQP3C1f8pk199t@google.com>
Date: Thu, 17 Nov 2022 15:16:15 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: "Huang, Kai" <kai.huang@...el.com>
Cc: "borntraeger@...ux.ibm.com" <borntraeger@...ux.ibm.com>,
"Yao, Yuan" <yuan.yao@...el.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"kvm-riscv@...ts.infradead.org" <kvm-riscv@...ts.infradead.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"Yamahata, Isaku" <isaku.yamahata@...el.com>,
"suzuki.poulose@....com" <suzuki.poulose@....com>,
"pbonzini@...hat.com" <pbonzini@...hat.com>,
"david@...hat.com" <david@...hat.com>,
"linux-mips@...r.kernel.org" <linux-mips@...r.kernel.org>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
"kvmarm@...ts.linux.dev" <kvmarm@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"mjrosato@...ux.ibm.com" <mjrosato@...ux.ibm.com>,
"oliver.upton@...ux.dev" <oliver.upton@...ux.dev>,
"farosas@...ux.ibm.com" <farosas@...ux.ibm.com>,
"linux-s390@...r.kernel.org" <linux-s390@...r.kernel.org>,
"palmer@...belt.com" <palmer@...belt.com>,
"chenhuacai@...nel.org" <chenhuacai@...nel.org>,
"mpe@...erman.id.au" <mpe@...erman.id.au>,
"aou@...s.berkeley.edu" <aou@...s.berkeley.edu>,
"alexandru.elisei@....com" <alexandru.elisei@....com>,
"vkuznets@...hat.com" <vkuznets@...hat.com>,
"maz@...nel.org" <maz@...nel.org>,
"anup@...infault.org" <anup@...infault.org>,
"frankja@...ux.ibm.com" <frankja@...ux.ibm.com>,
"aleksandar.qemu.devel@...il.com" <aleksandar.qemu.devel@...il.com>,
"james.morse@....com" <james.morse@....com>,
"kvmarm@...ts.cs.columbia.edu" <kvmarm@...ts.cs.columbia.edu>,
"farman@...ux.ibm.com" <farman@...ux.ibm.com>,
"paul.walmsley@...ive.com" <paul.walmsley@...ive.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"atishp@...shpatra.org" <atishp@...shpatra.org>,
"imbrenda@...ux.ibm.com" <imbrenda@...ux.ibm.com>,
"Gao, Chao" <chao.gao@...el.com>
Subject: Re: [PATCH 38/44] KVM: Disable CPU hotplug during hardware enabling
On Thu, Nov 17, 2022, Huang, Kai wrote:
> On Wed, 2022-11-16 at 17:11 +0000, Sean Christopherson wrote:
> > static int kvm_x86_check_processor_compatibility(void)
> > {
> > int cpu = smp_processor_id();
> > struct cpuinfo_x86 *c = &cpu_data(cpu);
> >
> > /*
> > * Compatibility checks are done when loading KVM and when enabling
> > * hardware, e.g. during CPU hotplug, to ensure all online CPUs are
> > * compatible, i.e. KVM should never perform a compatibility check on
> > * an offline CPU.
> > */
> > WARN_ON(!cpu_online(cpu));
>
> Looks good to me. Perhaps this also can be removed, though.
Hmm, it's a bit superfluous, but I think it could fire if KVM messed up CPU
hotplug again, e.g. if the for_each_online_cpu() => IPI raced with CPU unplug.
> And IMHO the removing of WARN_ON(!irq_disabled()) should be folded to the patch
> "[PATCH 37/44] KVM: Rename and move CPUHP_AP_KVM_STARTING to ONLINE section".
> Because moving from STARTING section to ONLINE section changes the IRQ status
> when the compatibility check is called.
Yep, that's what I have coded up, just smushed it all together here.
Powered by blists - more mailing lists