mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
PVH dom0: set eflags resvd bit #1
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. Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com> For consistency (i.e. even if perhaps not strictly needed) also do the same on SVM. Signed-off-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
b5dda35f5a
commit
2e3eba1a3d
5 files changed
+5
-7
No files matched your search
@@ -743,8 +743,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 ( has_hvm_container_vcpu(v) )
|
||||
{
|
||||
/*
|
||||
|
||||
@@ -972,7 +972,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;
|
||||
@@ -1170,8 +1170,6 @@ int hvm_vcpu_initialise(struct vcpu *v)
|
||||
(void(*)(unsigned long))hvm_assert_evtchn_irq,
|
||||
(unsigned long)v);
|
||||
|
||||
v->arch.user_regs.eflags = 2;
|
||||
|
||||
v->arch.hvm_vcpu.inject_trap.vector = -1;
|
||||
|
||||
if ( is_pvh_vcpu(v) )
|
||||
@@ -3636,7 +3634,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));
|
||||
|
||||
@@ -76,6 +76,7 @@ UNLIKELY_END(svm_trace)
|
||||
mov UREGS_rsp(%rsp),%rax
|
||||
mov %rax,VMCB_rsp(%rcx)
|
||||
mov UREGS_eflags(%rsp),%rax
|
||||
or $X86_EFLAGS_MBS,%rax
|
||||
mov %rax,VMCB_rflags(%rcx)
|
||||
|
||||
pop %r15
|
||||
|
||||
@@ -3048,7 +3048,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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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 */
|
||||
|
||||