WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Domain builders need only set bit 9 of EFLAGS (Interrupt

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Domain builders need only set bit 9 of EFLAGS (Interrupt Enable).
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Wed, 11 May 2005 17:13:44 +0000
Delivery-date: Wed, 11 May 2005 18:03:35 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1443, 2005/05/11 18:13:44+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        Domain builders need only set bit 9 of EFLAGS (Interrupt Enable).
        Setting this bit is enforced by Xen.
        Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>



 tools/libxc/xc_linux_build.c |    2 +-
 tools/libxc/xc_plan9_build.c |    2 +-
 tools/libxc/xc_vmx_build.c   |    2 +-
 xen/arch/x86/domain.c        |   14 ++++++++------
 4 files changed, 11 insertions(+), 9 deletions(-)


diff -Nru a/tools/libxc/xc_linux_build.c b/tools/libxc/xc_linux_build.c
--- a/tools/libxc/xc_linux_build.c      2005-05-11 14:04:08 -04:00
+++ b/tools/libxc/xc_linux_build.c      2005-05-11 14:04:08 -04:00
@@ -409,7 +409,7 @@
     ctxt->user_regs.eip = vkern_entry;
     ctxt->user_regs.esp = vstartinfo_start + 2*PAGE_SIZE;
     ctxt->user_regs.esi = vstartinfo_start;
-    ctxt->user_regs.eflags = (1<<9) | (1<<2);
+    ctxt->user_regs.eflags = 1 << 9; /* Interrupt Enable */
 
     /* FPU is set up to default initial state. */
     memset(&ctxt->fpu_ctxt, 0, sizeof(ctxt->fpu_ctxt));
diff -Nru a/tools/libxc/xc_plan9_build.c b/tools/libxc/xc_plan9_build.c
--- a/tools/libxc/xc_plan9_build.c      2005-05-11 14:04:08 -04:00
+++ b/tools/libxc/xc_plan9_build.c      2005-05-11 14:04:08 -04:00
@@ -495,7 +495,7 @@
 
        /* why is this set? */
        ctxt->user_regs.esi = ctxt->user_regs.esp;
-       ctxt->user_regs.eflags = (1 << 9) | (1 << 2);
+       ctxt->user_regs.eflags = 1 << 9; /* Interrupt Enable */
 
        /* FPU is set up to default initial state. */
        memset(&ctxt->fpu_ctxt, 0, sizeof(ctxt->fpu_ctxt));
diff -Nru a/tools/libxc/xc_vmx_build.c b/tools/libxc/xc_vmx_build.c
--- a/tools/libxc/xc_vmx_build.c        2005-05-11 14:04:08 -04:00
+++ b/tools/libxc/xc_vmx_build.c        2005-05-11 14:04:08 -04:00
@@ -447,7 +447,7 @@
     ctxt->user_regs.esi = vboot_params_start;
     ctxt->user_regs.edi = vboot_params_start + 0x2d0;
 
-    ctxt->user_regs.eflags = (1<<2);
+    ctxt->user_regs.eflags = 0;
 
     return 0;
 
diff -Nru a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     2005-05-11 14:04:08 -04:00
+++ b/xen/arch/x86/domain.c     2005-05-11 14:04:08 -04:00
@@ -409,13 +409,15 @@
 
     memcpy(&ed->arch.guest_context, c, sizeof(*c));
 
-    /* IOPL privileges are virtualised. */
-    ed->arch.iopl = (ed->arch.guest_context.user_regs.eflags >> 12) & 3;
-    ed->arch.guest_context.user_regs.eflags &= ~EF_IOPL;
+    if ( !(c->flags & VGCF_VMX_GUEST) )
+    {
+        /* IOPL privileges are virtualised. */
+        ed->arch.iopl = (ed->arch.guest_context.user_regs.eflags >> 12) & 3;
+        ed->arch.guest_context.user_regs.eflags &= ~EF_IOPL;
 
-    /* Clear IOPL for unprivileged domains. */
-    if ( !IS_PRIV(d) )
-        ed->arch.guest_context.user_regs.eflags &= 0xffffcfff;
+        /* Ensure real hardware interrupts are enabled. */
+        ed->arch.guest_context.user_regs.eflags |= EF_IE;
+    }
 
     if ( test_bit(EDF_DONEINIT, &ed->flags) )
         return 0;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Domain builders need only set bit 9 of EFLAGS (Interrupt Enable)., BitKeeper Bot <=