[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180308205519.GM12290@flask>
Date: Thu, 8 Mar 2018 21:55:19 +0100
From: Radim Krčmář <rkrcmar@...hat.com>
To: Wanpeng Li <kernellwp@...il.com>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
Paolo Bonzini <pbonzini@...hat.com>
Subject: Re: [PATCH 1/3] KVM: X86: Provides userspace with a capability to
not intercept MWAIT
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.
Powered by blists - more mailing lists