From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH 1/3] KVM: X86: Provides userspace with a capability to not intercept MWAIT
Date: Thu, 8 Mar 2018 21:55:19 +0100 [thread overview]
Message-ID: <20180308205519.GM12290@flask> (raw)
In-Reply-To: <20180308203132.GJ12290@flask>
2018-03-08 21:31+0100, Radim Krčmář:
> 2018-03-01 17:49+0800, Wanpeng Li:
> > @@ -264,10 +262,12 @@ static inline u64 nsec_to_cycles(struct kvm_vcpu *vcpu, u64 nsec)
> > __rem; \
> > })
> >
> > -static inline bool kvm_mwait_in_guest(void)
> > +#define KVM_X86_DISABLE_EXITS_MWAIT (1 << 0)
> > +#define KVM_X86_DISABLE_VALID_EXITS (KVM_X86_DISABLE_EXITS_MWAIT)
> > +
> > +static inline bool kvm_mwait_in_guest(struct kvm *kvm)
> > {
> > - return boot_cpu_has(X86_FEATURE_MWAIT) &&
> > - !boot_cpu_has_bug(X86_BUG_MONITOR);
> > + return kvm->arch.mwait_in_guest;
>
> With this nice variable, the wrapper actually makes the code harder to
> read. Please use kvm->arch.mwait_in_guest directly (and the same for
> the other two future exits),
I take that back. kvm->arch.mwait_in_guest looks ok, but it would be
vmx->vcpu.kvm->arch.mwait_in_guest elsewhere and that is just too bad.
next prev parent reply other threads:[~2018-03-08 20:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-01 9:49 [PATCH 1/3] KVM: X86: Provides userspace with a capability to not intercept MWAIT Wanpeng Li
2018-03-01 9:49 ` [PATCH 2/3] KVM: X86: Provides userspace with a capability to not intercept HLT Wanpeng Li
2018-03-08 20:40 ` Radim Krčmář
2018-03-09 0:51 ` Wanpeng Li
2018-03-01 9:49 ` [PATCH 3/3] KVM: X86: Provides userspace with a capability to not intercept PAUSE Wanpeng Li
2018-03-08 20:52 ` Radim Krčmář
2018-03-08 20:31 ` [PATCH 1/3] KVM: X86: Provides userspace with a capability to not intercept MWAIT Radim Krčmář
2018-03-08 20:55 ` Radim Krčmář [this message]
2018-03-09 2:34 ` Wanpeng Li
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=20180308205519.GM12290@flask \
--to=rkrcmar@redhat.com \
--cc=kernellwp@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.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.