From: "Huang, Kai" <kai.huang@intel.com>
To: "pbonzini@redhat.com" <pbonzini@redhat.com>,
"seanjc@google.com" <seanjc@google.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Gao, Chao" <chao.gao@intel.com>
Subject: Re: [PATCH v3 2/8] KVM: Register cpuhp and syscore callbacks when enabling hardware
Date: Mon, 10 Jun 2024 00:55:24 +0000 [thread overview]
Message-ID: <c365bb0dc968b93f6df689ee2a0ffc4c19b7d79d.camel@intel.com> (raw)
In-Reply-To: <20240608000639.3295768-3-seanjc@google.com>
On Fri, 2024-06-07 at 17:06 -0700, Sean Christopherson wrote:
> Register KVM's cpuhp and syscore callback when enabling virtualization
> in hardware instead of registering the callbacks during initialization,
> and let the CPU up/down framework invoke the inner enable/disable
> functions. Registering the callbacks during initialization makes things
> more complex than they need to be, as KVM needs to be very careful about
> handling races between enabling CPUs being onlined/offlined and hardware
> being enabled/disabled.
>
> Intel TDX support will require KVM to enable virtualization during KVM
> initialization, i.e. will add another wrinkle to things, at which point
> sorting out the potential races with kvm_usage_count would become even
> more complex.
>
> Note, using the cpuhp framework has a subtle behavioral change: enabling
> will be done serially across all CPUs, whereas KVM currently sends an IPI
> to all CPUs in parallel. While serializing virtualization enabling could
> create undesirable latency, the issue is limited to creation of KVM's
> first VM, and even that can be mitigated, e.g. by letting userspace force
> virtualization to be enabled when KVM is initialized.
>
> Cc: Chao Gao <chao.gao@intel.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
>
Reviewed-by: Kai Huang <kai.huang@intel.com>
next prev parent reply other threads:[~2024-06-10 0:55 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-08 0:06 [PATCH v3 0/8] KVM: Register cpuhp/syscore callbacks when enabling virt Sean Christopherson
2024-06-08 0:06 ` [PATCH v3 1/8] KVM: Use dedicated mutex to protect kvm_usage_count to avoid deadlock Sean Christopherson
2024-06-10 0:26 ` Huang, Kai
2024-08-14 18:06 ` Paolo Bonzini
2024-08-15 14:39 ` Sean Christopherson
2024-08-15 16:10 ` Paolo Bonzini
2024-08-30 23:45 ` Sean Christopherson
2024-09-02 13:03 ` Paolo Bonzini
2024-06-08 0:06 ` [PATCH v3 2/8] KVM: Register cpuhp and syscore callbacks when enabling hardware Sean Christopherson
2024-06-10 0:55 ` Huang, Kai [this message]
2024-08-14 18:12 ` Paolo Bonzini
2024-08-14 20:55 ` Sean Christopherson
2024-06-08 0:06 ` [PATCH v3 3/8] KVM: Rename functions related to enabling virtualization hardware Sean Christopherson
2024-06-08 0:06 ` [PATCH v3 4/8] KVM: Add a module param to allow enabling virtualization when KVM is loaded Sean Christopherson
2024-08-02 12:02 ` Huang, Kai
2024-08-02 12:06 ` Huang, Kai
2024-08-13 2:31 ` Sean Christopherson
2024-08-13 5:22 ` Huang, Kai
2024-08-13 23:47 ` Huang, Kai
2024-08-14 18:14 ` Paolo Bonzini
2024-06-08 0:06 ` [PATCH v3 5/8] KVM: Add arch hooks for enabling/disabling virtualization Sean Christopherson
2024-08-14 18:15 ` Paolo Bonzini
2024-06-08 0:06 ` [PATCH v3 6/8] x86/reboot: Unconditionally define cpu_emergency_virt_cb typedef Sean Christopherson
2024-06-08 0:06 ` [PATCH v3 7/8] KVM: x86: Register "emergency disable" callbacks when virt is enabled Sean Christopherson
2024-06-08 0:06 ` [PATCH v3 8/8] KVM: Enable virtualization at load/initialization by default Sean Christopherson
2024-08-14 18:20 ` Paolo Bonzini
2024-06-10 0:59 ` [PATCH v3 0/8] KVM: Register cpuhp/syscore callbacks when enabling virt Huang, Kai
2024-08-14 18:23 ` Paolo Bonzini
2024-08-14 22:17 ` Huang, Kai
2024-08-15 14:41 ` Sean Christopherson
2024-08-20 8:57 ` Paolo Bonzini
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=c365bb0dc968b93f6df689ee2a0ffc4c19b7d79d.camel@intel.com \
--to=kai.huang@intel.com \
--cc=chao.gao@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
/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.