lkml.org 
[lkml]   [2018]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2018-03-08 21:56    [W:0.078 / U:2.760 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site