[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220823080831.GE2147148@ls.amr.corp.intel.com>
Date: Tue, 23 Aug 2022 01:08:31 -0700
From: Isaku Yamahata <isaku.yamahata@...il.com>
To: Chao Gao <chao.gao@...el.com>
Cc: isaku.yamahata@...el.com, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, isaku.yamahata@...il.com,
Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
Kai Huang <kai.huang@...el.com>, Will Deacon <will@...nel.org>
Subject: Re: [RFC PATCH 12/18] KVM: Do processor compatibility check on cpu
online and resume
On Tue, Aug 23, 2022 at 03:50:09PM +0800,
Chao Gao <chao.gao@...el.com> wrote:
> >diff --git a/virt/kvm/kvm_arch.c b/virt/kvm/kvm_arch.c
> >index 2ed8de0591c9..20971f43df95 100644
> >--- a/virt/kvm/kvm_arch.c
> >+++ b/virt/kvm/kvm_arch.c
> >@@ -99,9 +99,15 @@ __weak int kvm_arch_del_vm(int usage_count)
> >
> > __weak int kvm_arch_online_cpu(unsigned int cpu, int usage_count)
> > {
> >- if (usage_count)
> >- return __hardware_enable();
> >- return 0;
> >+ int r;
> >+
> >+ if (!usage_count)
> >+ return 0;
> >+
> >+ r = kvm_arch_check_processor_compat();
> >+ if (r)
> >+ return r;
>
> I think kvm_arch_check_processor_compat() should be called even when
> usage_count is 0. Otherwise, compatibility checks may be missing on some
> CPUs if no VM is running when those CPUs becomes online.
Oh, right. Compatibility check should be done unconditionally.
--
Isaku Yamahata <isaku.yamahata@...il.com>
Powered by blists - more mailing lists