[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090729134403.GI18313@amd.com>
Date: Wed, 29 Jul 2009 15:44:03 +0200
From: Joerg Roedel <joerg.roedel@....com>
To: Alexander Graf <agraf@...e.de>
CC: Avi Kivity <avi@...hat.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 02/12] kvm/svm: add helper functions for global
interrupt flag
On Wed, Jul 29, 2009 at 03:15:11PM +0200, Alexander Graf wrote:
> Joerg Roedel wrote:
> > Signed-off-by: Joerg Roedel <joerg.roedel@....com>
> > ---
> > 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?
Hmm, yes. Except for the vcpu reset path clear_page is called for before
init_vmcb is called. I'll change it to set hflags to 0 in this function.
Joerg
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists