From: Sean Christopherson <seanjc@google.com>
To: lirongqing@baidu.com
Cc: pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com,
tglx@linutronix.de, mingo@redhat.com, x86@kernel.org,
kvm@vger.kernel.org
Subject: Re: [PATCH] x86/kvm: Don't use PVspinlock when mwait is advertised
Date: Mon, 13 Feb 2023 16:13:27 +0000 [thread overview]
Message-ID: <Y+php3UhTwEjXZcV@google.com> (raw)
In-Reply-To: <1676124399-16542-1-git-send-email-lirongqing@baidu.com>
On Sat, Feb 11, 2023, lirongqing@baidu.com wrote:
> From: Li RongQing <lirongqing@baidu.com>
>
> MWAIT is advertised in host is not overcommitted scenario, however,
> pvspinlock should be enabled in host overcommitted scenario. Let's
> add the MWAIT checking when enabling pvspinlock
>
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
> ---
> arch/x86/kernel/kvm.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
> index 1cceac5..dfa1451 100644
> --- a/arch/x86/kernel/kvm.c
> +++ b/arch/x86/kernel/kvm.c
> @@ -1087,6 +1087,11 @@ void __init kvm_spinlock_init(void)
> goto out;
> }
>
> + if (boot_cpu_has(X86_FEATURE_MWAIT)) {
IMO this is a bad idea. Odds are good that there are less-than-perfect VM configs
that advertise MONITOR+MWAIT but don't disable interception. Ugh, but we've already
added this logic for other features guaraded by KVM_HINTS_REALTIME in commit
40cd58dbf121 ("x86/kvm: Don't use PV TLB/yield when mwait is advertised")
Why doesn't the host simply advertise KVM_HINTS_REALTIME?
prev parent reply other threads:[~2023-02-13 16:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-11 14:06 [PATCH] x86/kvm: Don't use PVspinlock when mwait is advertised lirongqing
2023-02-13 16:13 ` Sean Christopherson [this message]
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=Y+php3UhTwEjXZcV@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=lirongqing@baidu.com \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=x86@kernel.org \
/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.