ia64/xen-unstable

changeset 5773:637127cded4e

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@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Jul 14 08:00:23 2005 +0000 (2005-07-14)
parents 9d2ca2da280e
children 71d000e59b13
files tools/firmware/vmxassist/Makefile tools/firmware/vmxassist/machine.h tools/firmware/vmxassist/setup.c
line diff
     1.1 --- a/tools/firmware/vmxassist/Makefile	Thu Jul 14 07:39:18 2005 +0000
     1.2 +++ b/tools/firmware/vmxassist/Makefile	Thu Jul 14 08:00:23 2005 +0000
     1.3 @@ -24,7 +24,7 @@ include $(XEN_ROOT)/tools/Rules.mk
     1.4  # The emulator code lives in ROM space
     1.5  TEXTADDR=0x000D0000
     1.6  
     1.7 -DEFINES=-DDEBUG -DTEXTADDR=${TEXTADDR} -D_ACPI_
     1.8 +DEFINES=-DDEBUG -DENABLE_VME -DTEXTADDR=${TEXTADDR}
     1.9  XENINC=-I$(XEN_ROOT)/xen/include -I$(XEN_ROOT)/tools/libxc
    1.10  #DEFINES=-DDEBUG -DTEST -DTEXTADDR=${TEXTADDR}
    1.11  #XENINC=-I/home/leendert/xen/xeno-unstable.bk/xen/include
     2.1 --- a/tools/firmware/vmxassist/machine.h	Thu Jul 14 07:39:18 2005 +0000
     2.2 +++ b/tools/firmware/vmxassist/machine.h	Thu Jul 14 08:00:23 2005 +0000
     2.3 @@ -40,7 +40,8 @@
     2.4  #define EFLAGS_TF	(1 << 8)
     2.5  #define EFLAGS_IF	(1 << 9)
     2.6  #define EFLAGS_DF	(1 << 10)
     2.7 -#define EFLAGS_VM	(1 << 17)
     2.8 +#define EFLAGS_IOPL (3 << 12)
     2.9 +#define EFLAGS_VM	((1 << 17) | EFLAGS_IOPL)
    2.10  #define EFLAGS_VIF	(1 << 19)
    2.11  #define EFLAGS_VIP	(1 << 20)
    2.12  
    2.13 @@ -109,6 +110,9 @@ struct tss {
    2.14  	unsigned short	_5;
    2.15  	unsigned short	_6;
    2.16  	unsigned short	iomap_base;
    2.17 +#ifdef	ENABLE_VME
    2.18 +	unsigned long	int_redir[8];
    2.19 +#endif
    2.20  	unsigned char	iomap[8192];
    2.21  };
    2.22  
    2.23 @@ -177,7 +181,6 @@ get_cr4(void)
    2.24          return rv;
    2.25  }
    2.26  
    2.27 -#ifdef TEST
    2.28  static inline void
    2.29  set_cr3(unsigned addr)
    2.30  {
    2.31 @@ -190,6 +193,7 @@ set_cr4(unsigned value)
    2.32  	__asm__ __volatile__("movl %0, %%cr4" : /* no outputs */ : "r"(value));
    2.33  }
    2.34  
    2.35 +#ifdef TEST
    2.36  static inline void
    2.37  breakpoint(void)
    2.38  {
     3.1 --- a/tools/firmware/vmxassist/setup.c	Thu Jul 14 07:39:18 2005 +0000
     3.2 +++ b/tools/firmware/vmxassist/setup.c	Thu Jul 14 08:00:23 2005 +0000
     3.3 @@ -121,7 +121,7 @@ void
     3.4  setup_gdt(void)
     3.5  {
     3.6  	/* setup task state segment */
     3.7 -	memset(&tss, 0, sizeof(0));
     3.8 +	memset(&tss, 0, sizeof(tss));
     3.9  	tss.ss0 = DATA_SELECTOR;
    3.10  	tss.esp0 = (unsigned) stack_top - 4*4;
    3.11  	tss.iomap_base = offsetof(struct tss, iomap);
    3.12 @@ -353,6 +353,9 @@ main()
    3.13  #endif
    3.14  	setup_gdt();
    3.15  	setup_idt();
    3.16 +#ifdef	ENABLE_VME
    3.17 +	set_cr4(get_cr4() | CR4_VME); 
    3.18 +#endif
    3.19  	setup_ctx();
    3.20  	setup_pic();
    3.21  	start_bios();