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-devel

[Xen-devel] [PATCH] Enable CR4.VME to improve the performance of vm86 em

To: Ian Pratt <Ian.Pratt@xxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Enable CR4.VME to improve the performance of vm86 emulation.
From: Arun Sharma <arun.sharma@xxxxxxxxx>
Date: Wed, 13 Jul 2005 16:14:02 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 13 Jul 2005 23:08:01 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
Enable CR4.VME to improve the performance of vm86 emulation. 

Setting this bit eliminates the calls to the vm86 monitor to handle
interrupts and exceptions that occur while executing programs in vm86
mode.

Signed-off-by: Asit Mallick <asit.k.mallick@xxxxxxxxx>
Signed-off-by: Arun Sharma <arun.sharma@xxxxxxxxx>

diff -r ae5dbce3f530 -r 3e44f5b38645 tools/firmware/vmxassist/Makefile
--- a/tools/firmware/vmxassist/Makefile Wed Jul 13 19:12:38 2005
+++ b/tools/firmware/vmxassist/Makefile Wed Jul 13 19:12:43 2005
@@ -24,7 +24,7 @@
 # The emulator code lives in ROM space
 TEXTADDR=0x000D0000
 
-DEFINES=-DDEBUG -DTEXTADDR=${TEXTADDR} -D_ACPI_
+DEFINES=-DDEBUG -DENABLE_VME -DTEXTADDR=${TEXTADDR}
 XENINC=-I$(XEN_ROOT)/xen/include -I$(XEN_ROOT)/tools/libxc
 #DEFINES=-DDEBUG -DTEST -DTEXTADDR=${TEXTADDR}
 #XENINC=-I/home/leendert/xen/xeno-unstable.bk/xen/include
diff -r ae5dbce3f530 -r 3e44f5b38645 tools/firmware/vmxassist/machine.h
--- a/tools/firmware/vmxassist/machine.h        Wed Jul 13 19:12:38 2005
+++ b/tools/firmware/vmxassist/machine.h        Wed Jul 13 19:12:43 2005
@@ -40,7 +40,8 @@
 #define EFLAGS_TF      (1 << 8)
 #define EFLAGS_IF      (1 << 9)
 #define EFLAGS_DF      (1 << 10)
-#define EFLAGS_VM      (1 << 17)
+#define EFLAGS_IOPL (3 << 12)
+#define EFLAGS_VM      ((1 << 17) | EFLAGS_IOPL)
 #define EFLAGS_VIF     (1 << 19)
 #define EFLAGS_VIP     (1 << 20)
 
@@ -109,6 +110,9 @@
        unsigned short  _5;
        unsigned short  _6;
        unsigned short  iomap_base;
+#ifdef ENABLE_VME
+       unsigned long   int_redir[8];
+#endif
        unsigned char   iomap[8192];
 };
 
@@ -177,20 +181,20 @@
         return rv;
 }
 
+static inline void
+set_cr3(unsigned addr)
+{
+        __asm__ __volatile__("movl %0, %%cr3" : /* no outputs */ : "r"(addr));
+}
+
+static inline void
+set_cr4(unsigned value)
+{
+       __asm__ __volatile__("movl %0, %%cr4" : /* no outputs */ : "r"(value));
+}
+
 #ifdef TEST
 static inline void
-set_cr3(unsigned addr)
-{
-        __asm__ __volatile__("movl %0, %%cr3" : /* no outputs */ : "r"(addr));
-}
-
-static inline void
-set_cr4(unsigned value)
-{
-       __asm__ __volatile__("movl %0, %%cr4" : /* no outputs */ : "r"(value));
-}
-
-static inline void
 breakpoint(void)
 {
        outw(0x8A00, 0x8AE0);
diff -r ae5dbce3f530 -r 3e44f5b38645 tools/firmware/vmxassist/setup.c
--- a/tools/firmware/vmxassist/setup.c  Wed Jul 13 19:12:38 2005
+++ b/tools/firmware/vmxassist/setup.c  Wed Jul 13 19:12:43 2005
@@ -121,7 +121,7 @@
 setup_gdt(void)
 {
        /* setup task state segment */
-       memset(&tss, 0, sizeof(0));
+       memset(&tss, 0, sizeof(tss));
        tss.ss0 = DATA_SELECTOR;
        tss.esp0 = (unsigned) stack_top - 4*4;
        tss.iomap_base = offsetof(struct tss, iomap);
@@ -353,6 +353,9 @@
 #endif
        setup_gdt();
        setup_idt();
+#ifdef ENABLE_VME
+       set_cr4(get_cr4() | CR4_VME); 
+#endif
        setup_ctx();
        setup_pic();
        start_bios();

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Enable CR4.VME to improve the performance of vm86 emulation., Arun Sharma <=