On Tue, Mar 22, 2022, Maxim Levitsky wrote: > KVM always uses vgif when allowed, thus there is > no need to query current vmcb for it It'd be helpful to explicitly call out that KVM always takes V_GIF_ENABLE_MASK from vmcs01, otherwise this looks like it does unintentend things when KVM is runing vmcb02. > Suggested-by: Paolo Bonzini <pbonzini@xxxxxxxxxx> > Signed-off-by: Maxim Levitsky <mlevitsk@xxxxxxxxxx> > --- > arch/x86/kvm/svm/svm.c | 12 ++++++------ > arch/x86/kvm/svm/svm.h | 12 ++++-------- > 2 files changed, 10 insertions(+), 14 deletions(-) > > diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c > index acf04cf4ed2a..70fc5897f5f2 100644 > --- a/arch/x86/kvm/svm/svm.c > +++ b/arch/x86/kvm/svm/svm.c > @@ -172,7 +172,7 @@ static int vls = true; > module_param(vls, int, 0444); > > /* enable/disable Virtual GIF */ > -static int vgif = true; > +int vgif = true; > module_param(vgif, int, 0444); ... > @@ -453,14 +454,9 @@ static inline bool svm_is_intercept(struct vcpu_svm *svm, int bit) > return vmcb_is_intercept(&svm->vmcb->control, bit); > } > > -static inline bool vgif_enabled(struct vcpu_svm *svm) > -{ > - return !!(svm->vmcb->control.int_ctl & V_GIF_ENABLE_MASK);