From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Subject: Re: [PATCH 02/12] kvm/svm: add helper functions for global interrupt flag Date: Wed, 29 Jul 2009 15:15:11 +0200 Message-ID: <4A704B5F.5000206@suse.de> References: <1248872192-30881-1-git-send-email-joerg.roedel@amd.com> <1248872192-30881-3-git-send-email-joerg.roedel@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org, linux-kernel@vger.kernel.org To: Joerg Roedel Return-path: In-Reply-To: <1248872192-30881-3-git-send-email-joerg.roedel@amd.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Joerg Roedel wrote: > Signed-off-by: Joerg Roedel > --- > arch/x86/kvm/svm.c | 31 +++++++++++++++++++++++-------- > 1 files changed, 23 insertions(+), 8 deletions(-) > > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > index 27d26c3..9f69b25 100644 > --- a/arch/x86/kvm/svm.c > +++ b/arch/x86/kvm/svm.c > @@ -136,6 +136,21 @@ static inline bool is_nested(struct vcpu_svm *svm) > return svm->nested_vmcb; > } > > +static inline void enable_gif(struct vcpu_svm *svm) > +{ > + svm->vcpu.arch.hflags |= HF_GIF_MASK; > +} > + > +static inline void disable_gif(struct vcpu_svm *svm) > +{ > + svm->vcpu.arch.hflags &= ~HF_GIF_MASK; > +} > + > +static inline bool gif_set(struct vcpu_svm *svm) > +{ > + return !!(svm->vcpu.arch.hflags & HF_GIF_MASK); > +} > + > static unsigned long iopm_base; > > struct kvm_ldttss_desc { > @@ -630,7 +645,7 @@ static void init_vmcb(struct vcpu_svm *svm) > force_new_asid(&svm->vcpu); > > svm->nested_vmcb = 0; > - svm->vcpu.arch.hflags = HF_GIF_MASK; > + enable_gif(svm); > Are we sure hflags is always 0 here?