From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [V1 PATCH 01/11] PVH dom0: set eflags resvd bit #1 Date: Tue, 12 Nov 2013 11:19:41 -0500 Message-ID: <20131112161941.GF11354@phenom.dumpdata.com> References: <1383960215-22444-1-git-send-email-mukesh.rathor@oracle.com> <1383960215-22444-2-git-send-email-mukesh.rathor@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1383960215-22444-2-git-send-email-mukesh.rathor@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Mukesh Rathor Cc: Xen-devel@lists.xensource.com, tim@xen.org, keir.xen@gmail.com, JBeulich@suse.com List-Id: xen-devel@lists.xenproject.org On Fri, Nov 08, 2013 at 05:23:26PM -0800, Mukesh Rathor wrote: > In this patch the eflags resv bit #1 is set in vmx_vmenter_helper. If > the bit is not set, the vmlaunch/resume will fail with guest state > invalid. What does 'MBS' stand for? Somehow I assumed you would call it RSV???? > > Signed-off-by: Mukesh Rathor > --- > xen/arch/x86/domain.c | 2 -- > xen/arch/x86/hvm/hvm.c | 7 ++----- > xen/arch/x86/hvm/vmx/vmx.c | 2 +- > xen/include/asm-x86/processor.h | 1 + > 4 files changed, 4 insertions(+), 8 deletions(-) > > diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c > index 0736a4b..e9ab6c8 100644 > --- a/xen/arch/x86/domain.c > +++ b/xen/arch/x86/domain.c > @@ -732,8 +732,6 @@ int arch_set_info_guest( > for ( i = 0; i < ARRAY_SIZE(v->arch.debugreg); ++i ) > v->arch.debugreg[i] = c(debugreg[i]); > > - v->arch.user_regs.eflags |= 2; > - > if ( !is_pv_vcpu(v) ) > { > hvm_set_info_guest(v); > diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c > index 61b5d8e..0d7ab44 100644 > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -952,7 +952,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h) > v->arch.user_regs.edi = ctxt.rdi; > v->arch.user_regs.esp = ctxt.rsp; > v->arch.user_regs.eip = ctxt.rip; > - v->arch.user_regs.eflags = ctxt.rflags | 2; > + v->arch.user_regs.eflags = ctxt.rflags | X86_EFLAGS_MBS; > v->arch.user_regs.r8 = ctxt.r8; > v->arch.user_regs.r9 = ctxt.r9; > v->arch.user_regs.r10 = ctxt.r10; > @@ -1133,7 +1133,6 @@ static int pvh_vcpu_initialise(struct vcpu *v) > (unsigned long)v); > > v->arch.hvm_vcpu.hcall_64bit = 1; /* PVH 32bitfixme. */ > - v->arch.user_regs.eflags = 2; > v->arch.hvm_vcpu.inject_trap.vector = -1; > > if ( (rc = hvm_vcpu_cacheattr_init(v)) != 0 ) > @@ -1218,8 +1217,6 @@ int hvm_vcpu_initialise(struct vcpu *v) > (void(*)(unsigned long))hvm_assert_evtchn_irq, > (unsigned long)v); > > - v->arch.user_regs.eflags = 2; > - > if ( v->vcpu_id == 0 ) > { > /* NB. All these really belong in hvm_domain_initialise(). */ > @@ -3619,7 +3616,7 @@ void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip) > > v->arch.vgc_flags = VGCF_online; > memset(&v->arch.user_regs, 0, sizeof(v->arch.user_regs)); > - v->arch.user_regs.eflags = 2; > + v->arch.user_regs.eflags = X86_EFLAGS_MBS; > v->arch.user_regs.edx = 0x00000f00; > v->arch.user_regs.eip = ip; > memset(&v->arch.debugreg, 0, sizeof(v->arch.debugreg)); > diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c > index e93fd98..1f39220 100644 > --- a/xen/arch/x86/hvm/vmx/vmx.c > +++ b/xen/arch/x86/hvm/vmx/vmx.c > @@ -3033,7 +3033,7 @@ void vmx_vmenter_helper(const struct cpu_user_regs *regs) > > __vmwrite(GUEST_RIP, regs->rip); > __vmwrite(GUEST_RSP, regs->rsp); > - __vmwrite(GUEST_RFLAGS, regs->rflags); > + __vmwrite(GUEST_RFLAGS, regs->rflags | X86_EFLAGS_MBS); > } > > /* > diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h > index 551036d..73a3202 100644 > --- a/xen/include/asm-x86/processor.h > +++ b/xen/include/asm-x86/processor.h > @@ -35,6 +35,7 @@ > * EFLAGS bits > */ > #define X86_EFLAGS_CF 0x00000001 /* Carry Flag */ > +#define X86_EFLAGS_MBS 0x00000002 /* Resvd bit */ > #define X86_EFLAGS_PF 0x00000004 /* Parity Flag */ > #define X86_EFLAGS_AF 0x00000010 /* Auxillary carry Flag */ > #define X86_EFLAGS_ZF 0x00000040 /* Zero Flag */ > -- > 1.7.2.3 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel