diff options
author | Maxim Levitsky <mlevitsk@redhat.com> | 2022-03-22 20:24:49 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-04-02 12:41:22 +0300 |
commit | ea91559b005443ddd9ea180ffdec4b4fda21d477 (patch) | |
tree | 44651694ff80a7a383c517de2649bb7686fe0f3c /arch/x86/kvm/svm/svm.h | |
parent | db663af4a0012a1ab0f966621a62617ce5907b35 (diff) |
KVM: x86: SVM: remove vgif_enabled()
KVM always uses vgif when allowed, thus there is
no need to query current vmcb for it
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20220322172449.235575-9-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm/svm.h')
-rw-r--r-- | arch/x86/kvm/svm/svm.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h index 57bde9569902..aad3a678c5ab 100644 --- a/arch/x86/kvm/svm/svm.h +++ b/arch/x86/kvm/svm/svm.h @@ -33,6 +33,7 @@ #define MSRPM_OFFSETS 16 extern u32 msrpm_offsets[MSRPM_OFFSETS] __read_mostly; extern bool npt_enabled; +extern int vgif; extern bool intercept_smi; /* @@ -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); -} - static inline void enable_gif(struct vcpu_svm *svm) { - if (vgif_enabled(svm)) + if (vgif) svm->vmcb->control.int_ctl |= V_GIF_MASK; else svm->vcpu.arch.hflags |= HF_GIF_MASK; @@ -468,7 +464,7 @@ static inline void enable_gif(struct vcpu_svm *svm) static inline void disable_gif(struct vcpu_svm *svm) { - if (vgif_enabled(svm)) + if (vgif) svm->vmcb->control.int_ctl &= ~V_GIF_MASK; else svm->vcpu.arch.hflags &= ~HF_GIF_MASK; @@ -476,7 +472,7 @@ static inline void disable_gif(struct vcpu_svm *svm) static inline bool gif_set(struct vcpu_svm *svm) { - if (vgif_enabled(svm)) + if (vgif) return !!(svm->vmcb->control.int_ctl & V_GIF_MASK); else return !!(svm->vcpu.arch.hflags & HF_GIF_MASK); |