ia64/xen-unstable

changeset 4852:9f5d923b1fb7

bitkeeper revision 1.1389.17.3 (42823d4825o1wYghBqsaekhllO6ocQ)

Domain builders need only set bit 9 of EFLAGS (Interrupt Enable).
Setting this bit is enforced by Xen.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed May 11 17:13:44 2005 +0000 (2005-05-11)
parents e40fb9ae58cf
children 2c883d988a41
files tools/libxc/xc_linux_build.c tools/libxc/xc_plan9_build.c tools/libxc/xc_vmx_build.c xen/arch/x86/domain.c
line diff
     1.1 --- a/tools/libxc/xc_linux_build.c	Wed May 11 17:12:35 2005 +0000
     1.2 +++ b/tools/libxc/xc_linux_build.c	Wed May 11 17:13:44 2005 +0000
     1.3 @@ -409,7 +409,7 @@ int xc_linux_build(int xc_handle,
     1.4      ctxt->user_regs.eip = vkern_entry;
     1.5      ctxt->user_regs.esp = vstartinfo_start + 2*PAGE_SIZE;
     1.6      ctxt->user_regs.esi = vstartinfo_start;
     1.7 -    ctxt->user_regs.eflags = (1<<9) | (1<<2);
     1.8 +    ctxt->user_regs.eflags = 1 << 9; /* Interrupt Enable */
     1.9  
    1.10      /* FPU is set up to default initial state. */
    1.11      memset(&ctxt->fpu_ctxt, 0, sizeof(ctxt->fpu_ctxt));
     2.1 --- a/tools/libxc/xc_plan9_build.c	Wed May 11 17:12:35 2005 +0000
     2.2 +++ b/tools/libxc/xc_plan9_build.c	Wed May 11 17:13:44 2005 +0000
     2.3 @@ -495,7 +495,7 @@ xc_plan9_build(int xc_handle,
     2.4  
     2.5  	/* why is this set? */
     2.6  	ctxt->user_regs.esi = ctxt->user_regs.esp;
     2.7 -	ctxt->user_regs.eflags = (1 << 9) | (1 << 2);
     2.8 +	ctxt->user_regs.eflags = 1 << 9; /* Interrupt Enable */
     2.9  
    2.10  	/* FPU is set up to default initial state. */
    2.11  	memset(&ctxt->fpu_ctxt, 0, sizeof(ctxt->fpu_ctxt));
     3.1 --- a/tools/libxc/xc_vmx_build.c	Wed May 11 17:12:35 2005 +0000
     3.2 +++ b/tools/libxc/xc_vmx_build.c	Wed May 11 17:13:44 2005 +0000
     3.3 @@ -447,7 +447,7 @@ static int setup_guest(int xc_handle,
     3.4      ctxt->user_regs.esi = vboot_params_start;
     3.5      ctxt->user_regs.edi = vboot_params_start + 0x2d0;
     3.6  
     3.7 -    ctxt->user_regs.eflags = (1<<2);
     3.8 +    ctxt->user_regs.eflags = 0;
     3.9  
    3.10      return 0;
    3.11  
     4.1 --- a/xen/arch/x86/domain.c	Wed May 11 17:12:35 2005 +0000
     4.2 +++ b/xen/arch/x86/domain.c	Wed May 11 17:13:44 2005 +0000
     4.3 @@ -409,13 +409,15 @@ int arch_set_info_guest(
     4.4  
     4.5      memcpy(&ed->arch.guest_context, c, sizeof(*c));
     4.6  
     4.7 -    /* IOPL privileges are virtualised. */
     4.8 -    ed->arch.iopl = (ed->arch.guest_context.user_regs.eflags >> 12) & 3;
     4.9 -    ed->arch.guest_context.user_regs.eflags &= ~EF_IOPL;
    4.10 +    if ( !(c->flags & VGCF_VMX_GUEST) )
    4.11 +    {
    4.12 +        /* IOPL privileges are virtualised. */
    4.13 +        ed->arch.iopl = (ed->arch.guest_context.user_regs.eflags >> 12) & 3;
    4.14 +        ed->arch.guest_context.user_regs.eflags &= ~EF_IOPL;
    4.15  
    4.16 -    /* Clear IOPL for unprivileged domains. */
    4.17 -    if ( !IS_PRIV(d) )
    4.18 -        ed->arch.guest_context.user_regs.eflags &= 0xffffcfff;
    4.19 +        /* Ensure real hardware interrupts are enabled. */
    4.20 +        ed->arch.guest_context.user_regs.eflags |= EF_IE;
    4.21 +    }
    4.22  
    4.23      if ( test_bit(EDF_DONEINIT, &ed->flags) )
    4.24          return 0;