All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Chao Gao <chao.gao@intel.com>
Cc: kvm@vger.kernel.org, pbonzini@redhat.com, kevin.tian@intel.com,
	tglx@linutronix.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/6] KVM: Do compatibility checks on hotplugged CPUs
Date: Wed, 12 Jan 2022 17:52:08 +0000	[thread overview]
Message-ID: <Yd8VSCghD3OvuGJ7@google.com> (raw)
In-Reply-To: <20220111053205.GD2175@gao-cwp>

On Tue, Jan 11, 2022, Chao Gao wrote:
> On Tue, Jan 11, 2022 at 12:46:52AM +0000, Sean Christopherson wrote:
> >This has a fairly big flaw in that it prevents KVM from creating VMs even if the
> >offending CPU is offlined.  That seems like a very reasonable thing to do, e.g.
> >admin sees that hotplugging a CPU broke KVM and removes the CPU to remedy the
> >problem.  And if KVM is built-in, reloading KVM to wipe hardware_incompatible
> >after offlining the CPU isn't an option.

...

> >That said, I'm not convinced that continuing with the hotplug in this scenario
> >is ever the right thing to do.  Either the CPU being hotplugged really is a different
> >CPU, or it's literally broken.  In both cases, odds are very, very good that running
> >on the dodgy CPU will hose the kernel sooner or later, i.e. KVM's compatibility checks
> >are just the canary in the coal mine.
> 
> Ok. Then here are two options:
> 1. KVM always prevents incompatible CPUs from being brought up regardless of running VMs
> 2. make "disabling KVM on incompatible CPUs" an opt-in feature.
> 
> Which one do you think is better?

IMO, #1.  It's simpler to implement and document, and is less likely to surprise
the user.  We can always pivot to #2 _if_ anyone requests the ability to dynamically
disable KVM in order to bring up heterogenous CPUs and has a reasonable, sane use
case for doing so.  But that's a big "if" as I would be very surprised if it's even
possible to encounter such a setup without a hardware bug, firmware bug, and/or user
error.

  reply	other threads:[~2022-01-12 17:52 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-27  8:15 [PATCH 0/6] Improve KVM's interaction with CPU hotplug Chao Gao
2021-12-27  8:15 ` Chao Gao
2021-12-27  8:15 ` Chao Gao
2021-12-27  8:15 ` Chao Gao
2021-12-27  8:15 ` [PATCH 1/6] KVM: x86: Move check_processor_compatibility from init ops to runtime ops Chao Gao
2022-01-10 23:27   ` Sean Christopherson
2022-01-11  3:36     ` Chao Gao
2022-01-12 17:59       ` Sean Christopherson
2021-12-27  8:15 ` [PATCH 2/6] KVM: x86: Use kvm_x86_ops in kvm_arch_check_processor_compat Chao Gao
2022-01-10 21:10   ` Sean Christopherson
2022-01-11  3:06     ` Chao Gao
2021-12-27  8:15 ` [PATCH 3/6] KVM: Remove opaque from kvm_arch_check_processor_compat Chao Gao
2021-12-27  8:15   ` Chao Gao
2021-12-27  8:15   ` Chao Gao
2021-12-27  8:15   ` Chao Gao
2022-01-10 23:06   ` Sean Christopherson
2022-01-10 23:06     ` Sean Christopherson
2022-01-10 23:06     ` Sean Christopherson
2022-01-10 23:06     ` Sean Christopherson
2022-01-11  3:19     ` Chao Gao
2022-01-11  3:19       ` Chao Gao
2022-01-11  3:19       ` Chao Gao
2022-01-11  3:19       ` Chao Gao
2022-01-12 17:20       ` Sean Christopherson
2022-01-12 17:20         ` Sean Christopherson
2022-01-12 17:20         ` Sean Christopherson
2022-01-12 17:20         ` Sean Christopherson
2022-01-12 17:21         ` Sean Christopherson
2022-01-12 17:21           ` Sean Christopherson
2022-01-12 17:21           ` Sean Christopherson
2022-01-12 17:21           ` Sean Christopherson
2021-12-27  8:15 ` [PATCH 4/6] KVM: Rename and move CPUHP_AP_KVM_STARTING to ONLINE section Chao Gao
2021-12-27  8:15 ` [PATCH 5/6] KVM: x86: Remove WARN_ON in kvm_arch_check_processor_compat Chao Gao
2022-01-10 22:59   ` Sean Christopherson
2022-01-11  2:15     ` Tian, Kevin
2022-01-11 19:48       ` Sean Christopherson
2022-01-12 11:00         ` Chao Gao
2022-01-12 17:35           ` Sean Christopherson
2022-01-17 13:35             ` Chao Gao
2022-01-17 13:46               ` Chao Gao
2022-01-19  0:34                 ` Sean Christopherson
2021-12-27  8:15 ` [PATCH 6/6] KVM: Do compatibility checks on hotplugged CPUs Chao Gao
2022-01-11  0:46   ` Sean Christopherson
2022-01-11  5:32     ` Chao Gao
2022-01-12 17:52       ` Sean Christopherson [this message]
2022-01-12 23:01         ` Jim Mattson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yd8VSCghD3OvuGJ7@google.com \
    --to=seanjc@google.com \
    --cc=chao.gao@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.