ia64/xen-unstable

changeset 5427:d44caae57112

bitkeeper revision 1.1708 (42a9b4dc79oJAGtbQvr8mTDofvBdxQ)

Merge bk://xen.bkbits.net/xeno-unstable.bk
into bkbits.net:/repos/x/xen-ia64/xeno-unstable-ia64.bk
author xen-ia64.adm@bkbits.net
date Fri Jun 10 15:42:20 2005 +0000 (2005-06-10)
parents 4e3360378112 957e3573240e
children da92dcde82ea
files .rootkeys Makefile linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/entry.S tools/ioemu/Makefile tools/ioemu/pc-bios/Makefile tools/ioemu/pc-bios/README tools/ioemu/pc-bios/bios.bin tools/ioemu/pc-bios/bios.diff tools/ioemu/pc-bios/linux_boot.S tools/ioemu/pc-bios/linux_boot.bin tools/ioemu/pc-bios/ppc_rom.bin tools/ioemu/pc-bios/proll.bin tools/ioemu/pc-bios/proll.patch tools/ioemu/pc-bios/vgabios-cirrus.bin tools/ioemu/pc-bios/vgabios.bin tools/python/xen/lowlevel/xs/xs.c tools/python/xen/lowlevel/xu/xu.c tools/xenstore/Makefile tools/xenstore/fake_libxc.c tools/xenstore/xenstored_core.c tools/xenstore/xenstored_core.h tools/xenstore/xenstored_domain.c tools/xenstore/xenstored_test.h tools/xenstore/xs.c tools/xenstore/xs_lib.c tools/xenstore/xs_lib.h tools/xenstore/xs_random.c tools/xenstore/xs_test.c xen/arch/ia64/vmx_init.c xen/arch/ia64/xenmem.c xen/arch/x86/domain.c xen/arch/x86/traps.c xen/arch/x86/vmx.c xen/arch/x86/vmx_io.c xen/arch/x86/vmx_platform.c xen/arch/x86/vmx_vmcs.c xen/arch/x86/x86_32/entry.S xen/arch/x86/x86_32/traps.c xen/arch/x86/x86_64/entry.S xen/include/asm-x86/vmx.h xen/include/asm-x86/vmx_vmcs.h xen/include/asm-x86/x86_32/asm_defns.h xen/include/public/arch-x86_64.h
line diff
     1.1 --- a/.rootkeys	Thu Jun 09 22:13:12 2005 +0000
     1.2 +++ b/.rootkeys	Fri Jun 10 15:42:20 2005 +0000
     1.3 @@ -707,17 +707,6 @@ 428d0d88Fcan7gQZ6axXOmokBDLe7g tools/ioe
     1.4  428d0d88lVaOC64YBZ1Wzt-WV4JaSw tools/ioemu/osdep.c
     1.5  428d0d885W7r27CDEJCW6Jlbxggc9g tools/ioemu/osdep.h
     1.6  428d0d88CiP9tVdIdLWAzOnCOSdafg tools/ioemu/path.c
     1.7 -428d0d88jzHltLAzyhV1lpFckzy8CA tools/ioemu/pc-bios/Makefile
     1.8 -428d0d889pv_iPNBFn6cNRzQfJMC3A tools/ioemu/pc-bios/README
     1.9 -428d0d88mhWW8SQFNfp-NaH3c8QQkg tools/ioemu/pc-bios/bios.bin
    1.10 -428d0d88LMSMDbTFG1-sS8LL90hExw tools/ioemu/pc-bios/bios.diff
    1.11 -428d0d89SHpdZE1S-ywjJCulIWs4Ag tools/ioemu/pc-bios/linux_boot.S
    1.12 -428d0d89hiL0UgU71ero86GEu1loaA tools/ioemu/pc-bios/linux_boot.bin
    1.13 -428d0d894MKpOb385vcoB_s_4q0QOA tools/ioemu/pc-bios/ppc_rom.bin
    1.14 -428d0d896uo6qr-ONYkpleolayT4zw tools/ioemu/pc-bios/proll.bin
    1.15 -428d0d893gsF8AcCadeYXcKM-aqssA tools/ioemu/pc-bios/proll.patch
    1.16 -428d0d89GgbrVx4Ov3Zg-SFX_0BRdw tools/ioemu/pc-bios/vgabios-cirrus.bin
    1.17 -428d0d89h9nqxPIgDpPMXZIWkdosNw tools/ioemu/pc-bios/vgabios.bin
    1.18  428d0d8908B65zMmhdGVME3jv7gpww tools/ioemu/qemu-binfmt-conf.sh
    1.19  428d0d89taY6NPlnIyOAMQd_Ww5qUw tools/ioemu/qemu-img.c
    1.20  428d0d89FY-g4UPH-ZW7t5ZCqvQVTQ tools/ioemu/readline.c
     2.1 --- a/Makefile	Thu Jun 09 22:13:12 2005 +0000
     2.2 +++ b/Makefile	Fri Jun 10 15:42:20 2005 +0000
     2.3 @@ -163,10 +163,13 @@ uninstall:
     2.4  	rm -rf $(D)/etc/init.d/xend*
     2.5  	rm -rf $(D)/usr/$(LIBDIR)/libxc* $(D)/usr/$(LIBDIR)/libxutil*
     2.6  	rm -rf $(D)/usr/$(LIBDIR)/python/xen $(D)/usr/include/xen
     2.7 +	rm -rf $(D)/usr/$(LIBDIR)/share/xen $(D)/usr/$(LIBDIR)/libxenstore*
     2.8 +	rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
     2.9  	rm -rf $(D)/usr/include/xcs_proto.h $(D)/usr/include/xc.h
    2.10 +	rm -rf $(D)/usr/include/xs_lib.h $(D)/usr/include/xs.h
    2.11  	rm -rf $(D)/usr/sbin/xcs $(D)/usr/sbin/xcsdump $(D)/usr/sbin/xen*
    2.12  	rm -rf $(D)/usr/sbin/netfix
    2.13 -	rm -rf $(D)/usr/sbin/xfrd $(D)/usr/sbin/xm $(D)/var/lib/xen
    2.14 +	rm -rf $(D)/usr/sbin/xfrd $(D)/usr/sbin/xm
    2.15  	rm -rf $(D)/usr/share/doc/xen  $(D)/usr/man/man*/xentrace*
    2.16  	rm -rf $(D)/usr/bin/xen* $(D)/usr/bin/miniterm
    2.17  	rm -rf $(D)/boot/*xen*
     3.1 --- a/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64	Thu Jun 09 22:13:12 2005 +0000
     3.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64	Fri Jun 10 15:42:20 2005 +0000
     3.3 @@ -701,7 +701,7 @@ CONFIG_LEGACY_PTY_COUNT=256
     3.4  # CONFIG_WATCHDOG is not set
     3.5  # CONFIG_HW_RANDOM is not set
     3.6  # CONFIG_NVRAM is not set
     3.7 -# CONFIG_RTC is not set
     3.8 +CONFIG_RTC=y
     3.9  # CONFIG_GEN_RTC is not set
    3.10  # CONFIG_DTLK is not set
    3.11  # CONFIG_R3964 is not set
     4.1 --- a/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/entry.S	Thu Jun 09 22:13:12 2005 +0000
     4.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/entry.S	Fri Jun 10 15:42:20 2005 +0000
     4.3 @@ -109,7 +109,6 @@ VGCF_IN_SYSCALL = (1<<8)
     4.4  #define preempt_stop
     4.5  #define retint_kernel retint_restore_args
     4.6  #endif	
     4.7 -	
     4.8  
     4.9  /*
    4.10   * C code is not supposed to know about undefined top of stack. Every time 
    4.11 @@ -118,7 +117,15 @@ VGCF_IN_SYSCALL = (1<<8)
    4.12   * RESTORE_TOP_OF_STACK syncs the syscall state after any possible ptregs
    4.13   * manipulation.
    4.14   */        	
    4.15 -		
    4.16 +
    4.17 +	/* %rsp:at FRAMEEND */ 
    4.18 +	.macro FIXUP_TOP_OF_STACK tmp
    4.19 +	movq    $__USER_CS,CS(%rsp)
    4.20 +	movq 	$-1,RCX(%rsp)
    4.21 +	.endm
    4.22 +
    4.23 +	.macro RESTORE_TOP_OF_STACK tmp,offset=0
    4.24 +	.endm
    4.25  
    4.26  	.macro FAKE_STACK_FRAME child_rip
    4.27  	/* push in order ss, rsp, eflags, cs, rip */
    4.28 @@ -209,6 +216,7 @@ rff_action:
    4.29  	je   int_ret_from_sys_call
    4.30  	testl $_TIF_IA32,threadinfo_flags(%rcx)
    4.31  	jnz  int_ret_from_sys_call
    4.32 +	RESTORE_TOP_OF_STACK %rdi,ARGOFFSET
    4.33  	jmp ret_from_sys_call
    4.34  rff_trace:
    4.35  	movq %rsp,%rdi
    4.36 @@ -311,6 +319,7 @@ 1:	movl $_TIF_NEED_RESCHED,%edi
    4.37  tracesys:			 
    4.38  	SAVE_REST
    4.39  	movq $-ENOSYS,RAX(%rsp)
    4.40 +	FIXUP_TOP_OF_STACK %rdi
    4.41  	movq %rsp,%rdi
    4.42  	call syscall_trace_enter
    4.43  	LOAD_ARGS ARGOFFSET  /* reload args from stack in case ptrace changed it */
    4.44 @@ -323,6 +332,7 @@ tracesys:
    4.45  1:	SAVE_REST
    4.46  	movq %rsp,%rdi
    4.47  	call syscall_trace_leave
    4.48 +	RESTORE_TOP_OF_STACK %rbx
    4.49  	RESTORE_REST
    4.50  	jmp ret_from_sys_call
    4.51  		
    4.52 @@ -421,7 +431,9 @@ ENTRY(ptregscall_common)
    4.53  	CFI_ADJUST_CFA_OFFSET	-8
    4.54  	SAVE_REST
    4.55  	movq %r11, %r15
    4.56 +	FIXUP_TOP_OF_STACK %r11
    4.57  	call *%rax
    4.58 +	RESTORE_TOP_OF_STACK %r11
    4.59  	movq %r15, %r11
    4.60  	RESTORE_REST
    4.61  	pushq %r11
    4.62 @@ -435,10 +447,12 @@ ENTRY(stub_execve)
    4.63  	CFI_ADJUST_CFA_OFFSET	-8
    4.64  	SAVE_REST
    4.65  	movq %r11, %r15
    4.66 +	FIXUP_TOP_OF_STACK %r11
    4.67  	call sys_execve
    4.68  	GET_THREAD_INFO(%rcx)
    4.69  	bt $TIF_IA32,threadinfo_flags(%rcx)
    4.70  	jc exec_32bit
    4.71 +	RESTORE_TOP_OF_STACK %r11
    4.72  	movq %r15, %r11
    4.73  	RESTORE_REST
    4.74  	push %r11
    4.75 @@ -460,6 +474,7 @@ ENTRY(stub_rt_sigreturn)
    4.76  	addq $8, %rsp		
    4.77  	SAVE_REST
    4.78  	movq %rsp,%rdi
    4.79 +	FIXUP_TOP_OF_STACK %r11
    4.80  	call sys_rt_sigreturn
    4.81  	movq %rax,RAX(%rsp) # fixme, this could be done at the higher layer
    4.82  	RESTORE_REST
     5.1 --- a/tools/ioemu/Makefile	Thu Jun 09 22:13:12 2005 +0000
     5.2 +++ b/tools/ioemu/Makefile	Fri Jun 10 15:42:20 2005 +0000
     5.3 @@ -51,23 +51,9 @@ common  de-ch  es     fo  fr-ca  hu     
     5.4  
     5.5  install: all 
     5.6  	mkdir -p "$(bindir)"
     5.7 -ifndef CONFIG_WIN32
     5.8 -#	install -m 755 -s $(TOOLS) "$(bindir)"
     5.9 -endif
    5.10  	mkdir -p "$(DESTDIR)/$(datadir)"
    5.11 -	install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
    5.12 -                       pc-bios/vgabios-cirrus.bin \
    5.13 -                       pc-bios/ppc_rom.bin \
    5.14 -                       pc-bios/proll.bin \
    5.15 -                       pc-bios/linux_boot.bin "$(DESTDIR)/$(datadir)"
    5.16 -	#mkdir -p "$(DESTDIR)/$(docdir)"
    5.17 -	#install -m 644 qemu-doc.html  qemu-tech.html "$(DESTDIR)/$(docdir)"
    5.18 -ifndef CONFIG_WIN32
    5.19 -	#mkdir -p "$(DESTDIR)/$(mandir)/man1"
    5.20 -	#install qemu.1 qemu-mkcow.1 "$(DESTDIR)/$(mandir)/man1"
    5.21  	mkdir -p "$(DESTDIR)/$(datadir)/keymaps"
    5.22  	install -m 644 $(addprefix keymaps/,$(KEYMAPS)) "$(DESTDIR)/$(datadir)/keymaps"
    5.23 -endif
    5.24  	for d in $(TARGET_DIRS); do \
    5.25  	$(MAKE) -C $$d $@ || exit 1 ; \
    5.26          done
    5.27 @@ -105,14 +91,6 @@ tarbin:
    5.28          $(DESTDIR)/$(bindir)/qemu-arm \
    5.29          $(DESTDIR)/$(bindir)/qemu-sparc \
    5.30          $(DESTDIR)/$(bindir)/qemu-ppc \
    5.31 -	$(DESTDIR)/$(datadir)/bios.bin \
    5.32 -	$(DESTDIR)/$(datadir)/vgabios.bin \
    5.33 -	$(DESTDIR)/$(datadir)/vgabios-cirrus.bin \
    5.34 -	$(DESTDIR)/$(datadir)/ppc_rom.bin \
    5.35 -	$(DESTDIR)/$(datadir)/proll.bin \
    5.36 -	$(DESTDIR)/$(datadir)/linux_boot.bin \
    5.37 -	$(DESTDIR)/$(docdir)/qemu-doc.html \
    5.38 -	$(DESTDIR)/$(docdir)/qemu-tech.html \
    5.39  	$(DESTDIR)/$(mandir)/man1/qemu.1 $(DESTDIR)/$(mandir)/man1/qemu-mkcow.1 )
    5.40  
    5.41  ifneq ($(wildcard .depend),)
     6.1 --- a/tools/ioemu/pc-bios/Makefile	Thu Jun 09 22:13:12 2005 +0000
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,24 +0,0 @@
     6.4 -#
     6.5 -# NOTE: only compilable with x86 cross compile tools
     6.6 -#
     6.7 -include ../config-host.mak
     6.8 -
     6.9 -DEFINES=
    6.10 -
    6.11 -TARGETS=
    6.12 -ifeq ($(ARCH),i386)
    6.13 -TARGETS+=linux_boot.bin
    6.14 -endif
    6.15 -
    6.16 -all: $(TARGETS)
    6.17 -
    6.18 -linux_boot.bin: linux_boot.o
    6.19 -	ld --oformat binary -Ttext 0 -o $@ $<
    6.20 -	chmod a-x $@
    6.21 -
    6.22 -%.o: %.S
    6.23 -	$(CC) $(DEFINES) -c -o $@ $<
    6.24 -
    6.25 -clean:
    6.26 -	rm -f $(TARGETS) *.o *~
    6.27 -
     7.1 --- a/tools/ioemu/pc-bios/README	Thu Jun 09 22:13:12 2005 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,13 +0,0 @@
     7.4 -- The PC BIOS comes from the Bochs project
     7.5 -  (http://bochs.sourceforge.net/). A patch from bios.diff was applied.
     7.6 -
     7.7 -- The VGA BIOS and the Cirrus VGA BIOS come from the LGPL VGA bios
     7.8 -  project (http://www.nongnu.org/vgabios/).
     7.9 -
    7.10 -- The PowerPC Open Hack'Ware Open Firmware Compatible BIOS is
    7.11 -  available at http://site.voila.fr/jmayer/OpenHackWare/index.htm.
    7.12 -
    7.13 -- Proll is a GPL'd boot PROM for Sparc JavaStations
    7.14 -  (http://people.redhat.com/zaitcev/linux/).
    7.15 -  Applying proll.patch allows circumventing some bugs and enables
    7.16 -  faster kernel load through a hack.
     8.1 Binary file tools/ioemu/pc-bios/bios.bin has changed
     9.1 --- a/tools/ioemu/pc-bios/bios.diff	Thu Jun 09 22:13:12 2005 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,162 +0,0 @@
     9.4 -Index: rombios.c
     9.5 -===================================================================
     9.6 -RCS file: /cvsroot/bochs/bochs/bios/rombios.c,v
     9.7 -retrieving revision 1.110
     9.8 -diff -u -w -r1.110 rombios.c
     9.9 ---- rombios.c	31 May 2004 13:11:27 -0000	1.110
    9.10 -+++ rombios.c	7 Oct 2004 21:23:50 -0000
    9.11 -@@ -137,6 +137,7 @@
    9.12 - #define DEBUG_INT16        0
    9.13 - #define DEBUG_INT1A        0
    9.14 - #define DEBUG_INT74        0
    9.15 -+#define DEBUG_APM          0
    9.16 - 
    9.17 - #define BX_CPU           3
    9.18 - #define BX_USE_PS2_MOUSE 1
    9.19 -@@ -145,6 +146,7 @@
    9.20 - #define BX_SUPPORT_FLOPPY 1
    9.21 - #define BX_FLOPPY_ON_CNT 37   // 2 seconds
    9.22 - #define BX_PCIBIOS       1
    9.23 -+#define BX_APM           1
    9.24 - 
    9.25 - #define BX_USE_ATADRV    1
    9.26 - #define BX_ELTORITO_BOOT 1
    9.27 -@@ -230,17 +232,6 @@
    9.28 -   out dx,ax
    9.29 - MEND
    9.30 - 
    9.31 --MACRO HALT2
    9.32 --  ;; the HALT macro is called with the line number of the HALT call.
    9.33 --  ;; The line number is then sent to the PANIC_PORT, causing Bochs/Plex
    9.34 --  ;; to print a BX_PANIC message.  This will normally halt the simulation
    9.35 --  ;; with a message such as "BIOS panic at rombios.c, line 4091".
    9.36 --  ;; However, users can choose to make panics non-fatal and continue.
    9.37 --  mov dx,#PANIC_PORT2
    9.38 --  mov ax,#?1
    9.39 --  out dx,ax
    9.40 --MEND
    9.41 --
    9.42 - MACRO JMP_AP
    9.43 -   db 0xea
    9.44 -   dw ?2
    9.45 -@@ -1543,15 +1534,12 @@
    9.46 -     }
    9.47 - 
    9.48 -   if (action & BIOS_PRINTF_HALT) {
    9.49 --    // freeze in a busy loop.  If I do a HLT instruction, then in versions
    9.50 --    // 1.3.pre1 and earlier, it will panic without ever updating the VGA
    9.51 --    // display, so the panic message will not be visible.  By waiting
    9.52 --    // forever, you are certain to see the panic message on screen.
    9.53 --    // After a few more versions have passed, we can turn this back into
    9.54 --    // a halt or something.
    9.55 --    // do {} while (1);
    9.56 -+    // freeze in a busy loop.  
    9.57 - ASM_START
    9.58 --    HALT2(__LINE__)
    9.59 -+    cli
    9.60 -+ halt2_loop:
    9.61 -+    hlt
    9.62 -+    jmp halt2_loop
    9.63 - ASM_END
    9.64 -     }
    9.65 - }
    9.66 -@@ -5412,8 +5400,8 @@
    9.67 -         case 0x03: SET_BL( 0x06 ); break;
    9.68 -         }
    9.69 - 
    9.70 --      DI = 0xefc7;
    9.71 --      ES = 0xf000;
    9.72 -+      DI = read_word(0x00, 0x1e*4); // INT vector 0x1E
    9.73 -+      ES = read_word(0x00, 0x1e*4+2);
    9.74 -       goto int13_success;
    9.75 -       break;
    9.76 - 
    9.77 -@@ -6984,8 +6972,8 @@
    9.78 -         }
    9.79 - 
    9.80 -       /* set es & di to point to 11 byte diskette param table in ROM */
    9.81 --      DI = 0xefc7;
    9.82 --      ES = 0xf000;
    9.83 -+      DI = read_word(0x00, 0x1e*4); // INT vector 0x1E
    9.84 -+      ES = read_word(0x00, 0x1e*4+2);
    9.85 -       CLEAR_CF(); // success
    9.86 -       /* disk status not changed upon success */
    9.87 -       return;
    9.88 -@@ -7880,7 +7868,7 @@
    9.89 -   mov  al, #0x02
    9.90 -   out  #0x0a, al   ;; clear DMA-1 channel 2 mask bit
    9.91 - 
    9.92 --  SET_INT_VECTOR(0x1E, #0xF000, #diskette_param_table)
    9.93 -+  SET_INT_VECTOR(0x1E, #0xF000, #diskette_param_table2)
    9.94 -   SET_INT_VECTOR(0x40, #0xF000, #int13_diskette)
    9.95 -   SET_INT_VECTOR(0x0E, #0xF000, #int0e_handler) ;; IRQ 6
    9.96 - 
    9.97 -@@ -8344,6 +8332,19 @@
    9.98 -   pop   ax
    9.99 -   iret
   9.100 - 
   9.101 -+
   9.102 -+;--------------------
   9.103 -+#if BX_APM
   9.104 -+use32 386
   9.105 -+#define APM_PROT32
   9.106 -+#include "apmbios.S"
   9.107 -+use16 386
   9.108 -+
   9.109 -+#define APM_REAL
   9.110 -+#include "apmbios.S"
   9.111 -+
   9.112 -+#endif
   9.113 -+
   9.114 - ;--------------------
   9.115 - #if BX_PCIBIOS
   9.116 - use32 386
   9.117 -@@ -9515,6 +9516,26 @@
   9.118 -   pop  ds
   9.119 -   iret
   9.120 - 
   9.121 -+diskette_param_table2:
   9.122 -+;;  New diskette parameter table adding 3 parameters from IBM
   9.123 -+;;  Since no provisions are made for multiple drive types, most
   9.124 -+;;  values in this table are ignored.  I set parameters for 1.44M
   9.125 -+;;  floppy here
   9.126 -+db  0xAF
   9.127 -+db  0x02 ;; head load time 0000001, DMA used
   9.128 -+db  0x25
   9.129 -+db  0x02
   9.130 -+db    18
   9.131 -+db  0x1B
   9.132 -+db  0xFF
   9.133 -+db  0x6C
   9.134 -+db  0xF6
   9.135 -+db  0x0F
   9.136 -+db  0x08
   9.137 -+db    79 ;; maximum track
   9.138 -+db     0 ;; data transfer rate
   9.139 -+db     4 ;; drive type in cmos
   9.140 -+
   9.141 - .org 0xf045 ; INT 10 Functions 0-Fh Entry Point
   9.142 -   HALT(__LINE__)
   9.143 -   iret
   9.144 -@@ -9560,6 +9581,10 @@
   9.145 - .org 0xf859 ; INT 15h System Services Entry Point
   9.146 - int15_handler:
   9.147 -   pushf
   9.148 -+#if BX_APM
   9.149 -+  cmp ah, #0x53
   9.150 -+  je apm_call
   9.151 -+#endif
   9.152 -   push  ds
   9.153 -   push  es
   9.154 -   pushad
   9.155 -@@ -9570,6 +9595,10 @@
   9.156 -   popf
   9.157 -   //JMPL(iret_modify_cf)
   9.158 -   jmp iret_modify_cf
   9.159 -+#if BX_APM
   9.160 -+apm_call:
   9.161 -+  jmp _apmreal_entry
   9.162 -+#endif
   9.163 - 
   9.164 - ;; Protected mode IDT descriptor
   9.165 - ;;
    10.1 --- a/tools/ioemu/pc-bios/linux_boot.S	Thu Jun 09 22:13:12 2005 +0000
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,29 +0,0 @@
    10.4 -/*
    10.5 - * QEMU Boot sector to launch a preloaded Linux kernel
    10.6 - * Copyright (c) 2004 Fabrice Bellard
    10.7 - */
    10.8 -
    10.9 -#define LOAD_SEG 0x9000
   10.10 -        
   10.11 -.code16	
   10.12 -.text
   10.13 -	.globl	_start
   10.14 -
   10.15 -_start:
   10.16 -        cli
   10.17 -        cld
   10.18 -        mov $LOAD_SEG, %ax
   10.19 -        mov %ax, %ds
   10.20 -        mov %ax, %es
   10.21 -        mov %ax, %fs
   10.22 -        mov %ax, %gs
   10.23 -        mov %ax, %ss
   10.24 -        mov $0x8ffe, %sp
   10.25 -        ljmp $LOAD_SEG + 0x20, $0
   10.26 -
   10.27 -1:              
   10.28 -        .fill 510 - (1b - _start), 1, 0
   10.29 -
   10.30 -        /* boot sector signature */
   10.31 -        .byte 0x55
   10.32 -        .byte 0xaa
    11.1 Binary file tools/ioemu/pc-bios/linux_boot.bin has changed
    12.1 Binary file tools/ioemu/pc-bios/ppc_rom.bin has changed
    13.1 Binary file tools/ioemu/pc-bios/proll.bin has changed
    14.1 --- a/tools/ioemu/pc-bios/proll.patch	Thu Jun 09 22:13:12 2005 +0000
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,50 +0,0 @@
    14.4 -diff -ru proll_18.orig/mrcoffee/main.c proll_18/mrcoffee/main.c
    14.5 ---- proll_18.orig/mrcoffee/main.c	2002-09-13 16:16:59.000000000 +0200
    14.6 -+++ proll_18/mrcoffee/main.c	2004-09-26 11:52:23.000000000 +0200
    14.7 -@@ -101,6 +101,7 @@
    14.8 - 	le_probe();
    14.9 - 	init_net();
   14.10 - 
   14.11 -+#ifdef ORIG
   14.12 - #if 0 /* RARP */
   14.13 - 	if (rarp() != 0) fatal();
   14.14 - 	/* printrarp(); */
   14.15 -@@ -117,13 +118,20 @@
   14.16 - 	xtoa(myipaddr, fname, 8);
   14.17 - 	if (load(boot_rec.bp_siaddr, fname) != 0) fatal();
   14.18 - #endif
   14.19 -+#endif
   14.20 - 
   14.21 - 	romvec = init_openprom(bb.nbanks, bb.bankv, hiphybas);
   14.22 - 
   14.23 - 	printk("Memory used: virt 0x%x:0x%x[%dK] iomap 0x%x:0x%x\n",
   14.24 - 	    PROLBASE, (int)cmem.curp, ((unsigned) cmem.curp - PROLBASE)/1024,
   14.25 - 	    (int)cio.start, (int)cio.curp);
   14.26 -+#ifdef ORIG
   14.27 - 	set_timeout(5);  while (!chk_timeout()) { }  /* P3: let me read */
   14.28 -+#else
   14.29 -+	printk("loading kernel:");
   14.30 -+	i = ld_bypass(0x20000000);
   14.31 -+	printk(" done, size %d\n", i);
   14.32 -+#endif
   14.33 - 
   14.34 - 	{
   14.35 - 		void (*entry)(void *, int) = (void (*)(void*, int)) LOADBASE;
   14.36 -diff -ru proll_18.orig/mrcoffee/openprom.c proll_18/mrcoffee/openprom.c
   14.37 ---- proll_18.orig/mrcoffee/openprom.c	2002-09-13 16:17:03.000000000 +0200
   14.38 -+++ proll_18/mrcoffee/openprom.c	2004-09-21 21:27:16.000000000 +0200
   14.39 -@@ -144,10 +144,14 @@
   14.40 - };
   14.41 - 
   14.42 - static int cpu_nctx = NCTX_SWIFT;
   14.43 -+static int cpu_cache_line_size = 0x20;
   14.44 -+static int cpu_cache_nlines = 0x200;
   14.45 - static struct property propv_cpu[] = {
   14.46 - 	{"name",	"STP1012PGA", sizeof("STP1012PGA") },
   14.47 - 	{"device_type",	"cpu", 4 },
   14.48 - 	{"mmu-nctx",	(char*)&cpu_nctx, sizeof(int)},
   14.49 -+	{"cache-line-size",	(char*)&cpu_cache_line_size, sizeof(int)},
   14.50 -+	{"cache-nlines",	(char*)&cpu_cache_nlines, sizeof(int)},
   14.51 - 	{NULL, NULL, -1}
   14.52 - };
   14.53 - 
    15.1 Binary file tools/ioemu/pc-bios/vgabios-cirrus.bin has changed
    16.1 Binary file tools/ioemu/pc-bios/vgabios.bin has changed
    17.1 --- a/tools/python/xen/lowlevel/xs/xs.c	Thu Jun 09 22:13:12 2005 +0000
    17.2 +++ b/tools/python/xen/lowlevel/xs/xs.c	Fri Jun 10 15:42:20 2005 +0000
    17.3 @@ -85,7 +85,7 @@ static PyObject *xspy_read(PyObject *sel
    17.4  
    17.5      struct xs_handle *xh = xshandle(self);
    17.6      char *xsval = NULL;
    17.7 -    int xsval_n = 0;
    17.8 +    unsigned int xsval_n = 0;
    17.9      PyObject *val = NULL;
   17.10  
   17.11      if (!xh)
   17.12 @@ -134,7 +134,7 @@ static PyObject *xspy_ls(PyObject *self,
   17.13      struct xs_handle *xh = xshandle(self);
   17.14      PyObject *val = NULL;
   17.15      char **xsval = NULL;
   17.16 -    int xsval_n = 0;
   17.17 +    unsigned int xsval_n = 0;
   17.18      int i;
   17.19  
   17.20      if (!xh)
   17.21 @@ -183,7 +183,7 @@ static PyObject *xspy_get_permissions(Py
   17.22      struct xs_handle *xh = xshandle(self);
   17.23      PyObject *val = NULL;
   17.24      struct xs_permissions *perms;
   17.25 -    int perms_n = 0;
   17.26 +    unsigned int perms_n = 0;
   17.27      int i;
   17.28  
   17.29      if (!xh)
    18.1 --- a/tools/python/xen/lowlevel/xu/xu.c	Thu Jun 09 22:13:12 2005 +0000
    18.2 +++ b/tools/python/xen/lowlevel/xu/xu.c	Fri Jun 10 15:42:20 2005 +0000
    18.3 @@ -908,7 +908,6 @@ static PyObject *xu_message_new(PyObject
    18.4          break;
    18.5      case TYPE(CMSG_MEM_REQUEST, CMSG_MEM_REQUEST_SET):
    18.6          P2C(mem_request_t, target, u32);
    18.7 -        P2C(mem_request_t, status, u32);
    18.8          break;
    18.9      case TYPE(CMSG_USBIF_FE, CMSG_USBIF_FE_INTERFACE_STATUS_CHANGED):
   18.10          P2C(usbif_fe_interface_status_changed_t, status, u32);
    19.1 --- a/tools/xenstore/Makefile	Thu Jun 09 22:13:12 2005 +0000
    19.2 +++ b/tools/xenstore/Makefile	Fri Jun 10 15:42:20 2005 +0000
    19.3 @@ -92,8 +92,11 @@ install: xenstored libxenstore.a
    19.4  	$(INSTALL_DIR) -p $(DESTDIR)/var/run/xenstored
    19.5  	$(INSTALL_DIR) -p $(DESTDIR)/var/lib/xenstored
    19.6  	$(INSTALL_DIR) -p $(DESTDIR)/usr/sbin
    19.7 +	$(INSTALL_DIR) -p $(DESTDIR)/usr/include
    19.8  	$(INSTALL_PROG) xenstored $(DESTDIR)/usr/sbin
    19.9  	$(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
   19.10  	$(INSTALL_DATA) libxenstore.a $(DESTDIR)/usr/$(LIBDIR)
   19.11 +	$(INSTALL_DATA) xs.h $(DESTDIR)/usr/include
   19.12 +	$(INSTALL_DATA) xs_lib.h $(DESTDIR)/usr/include
   19.13  
   19.14  -include $(PROG_DEP)
    20.1 --- a/tools/xenstore/fake_libxc.c	Thu Jun 09 22:13:12 2005 +0000
    20.2 +++ b/tools/xenstore/fake_libxc.c	Fri Jun 10 15:42:20 2005 +0000
    20.3 @@ -71,7 +71,7 @@ int xc_interface_open(void)
    20.4  		return fd;
    20.5  
    20.6  	memset(page, 0, sizeof(page));
    20.7 -	if (!write_all(fd, page, sizeof(page)))
    20.8 +	if (!xs_write_all(fd, page, sizeof(page)))
    20.9  		barf_perror("Failed to write /tmp/xcmap page");
   20.10  	
   20.11  	return fd;
    21.1 --- a/tools/xenstore/xenstored_core.c	Thu Jun 09 22:13:12 2005 +0000
    21.2 +++ b/tools/xenstore/xenstored_core.c	Fri Jun 10 15:42:20 2005 +0000
    21.3 @@ -81,7 +81,7 @@ bool test_write_all(int fd, void *conten
    21.4  		errno = ENOSPC;
    21.5  		return false;
    21.6  	}
    21.7 -	return write_all(fd, contents, len);
    21.8 +	return xs_write_all(fd, contents, len);
    21.9  }
   21.10  
   21.11  int test_mkdir(const char *dir, int perms);
   21.12 @@ -443,9 +443,9 @@ static struct xs_permissions *get_perms(
   21.13  	if (!strings)
   21.14  		return NULL;
   21.15  
   21.16 -	*num = count_strings(strings, size);
   21.17 +	*num = xs_count_strings(strings, size);
   21.18  	ret = talloc_array(node, struct xs_permissions, *num);
   21.19 -	if (!strings_to_perms(ret, *num, strings))
   21.20 +	if (!xs_strings_to_perms(ret, *num, strings))
   21.21  		corrupt(NULL, "Permissions corrupt for %s", node);
   21.22  
   21.23  	return ret;
   21.24 @@ -460,7 +460,7 @@ static char *perms_to_strings(const char
   21.25  	char buffer[MAX_STRLEN(domid_t) + 1];
   21.26  
   21.27  	for (*len = 0, i = 0; i < num; i++) {
   21.28 -		if (!perm_to_string(&perms[i], buffer))
   21.29 +		if (!xs_perm_to_string(&perms[i], buffer))
   21.30  			return NULL;
   21.31  
   21.32  		strings = talloc_realloc(node, strings, char,
   21.33 @@ -506,7 +506,7 @@ static char *tempfile(const char *path, 
   21.34  	if (!fd)
   21.35  		return NULL;
   21.36  	talloc_set_destructor(tmppath, destroy_path);
   21.37 -	if (!write_all(*fd, contents, len))
   21.38 +	if (!xs_write_all(*fd, contents, len))
   21.39  		return NULL;
   21.40  
   21.41  	return tmppath;
   21.42 @@ -617,7 +617,7 @@ bool check_node_perms(struct connection 
   21.43  		return false;
   21.44  	}
   21.45  
   21.46 -	if (!conn->write && (perm & XS_PERM_WRITE)) {
   21.47 +	if (!conn->can_write && (perm & XS_PERM_WRITE)) {
   21.48  		errno = EROFS;
   21.49  		return false;
   21.50  	}
   21.51 @@ -721,14 +721,14 @@ static bool new_directory(struct connect
   21.52  	permstr = perms_to_strings(dir, &perms, 1, &len);
   21.53  	fd = talloc_open(node_permfile(conn->transaction, node),
   21.54  			 O_WRONLY|O_CREAT|O_EXCL, 0640);
   21.55 -	if (!fd || !write_all(*fd, permstr, len))
   21.56 +	if (!fd || !xs_write_all(*fd, permstr, len))
   21.57  		return false;
   21.58  
   21.59  	if (data) {
   21.60  		char *datapath = node_datafile(conn->transaction, node);
   21.61  
   21.62  		fd = talloc_open(datapath, O_WRONLY|O_CREAT|O_EXCL, 0640);
   21.63 -		if (!fd || !write_all(*fd, data, datalen))
   21.64 +		if (!fd || !xs_write_all(*fd, data, datalen))
   21.65  			return false;
   21.66  	}
   21.67  
   21.68 @@ -878,7 +878,7 @@ static bool do_set_perms(struct connecti
   21.69  	char *node;
   21.70  	struct xs_permissions *perms;
   21.71  
   21.72 -	num = count_strings(in->buffer, in->used);
   21.73 +	num = xs_count_strings(in->buffer, in->used);
   21.74  	if (num < 2)
   21.75  		return send_error(conn, EINVAL);
   21.76  
   21.77 @@ -898,7 +898,7 @@ static bool do_set_perms(struct connecti
   21.78  		return send_error(conn, errno);
   21.79  
   21.80  	perms = talloc_array(node, struct xs_permissions, num);
   21.81 -	if (!strings_to_perms(perms, num, in->buffer))
   21.82 +	if (!xs_strings_to_perms(perms, num, in->buffer))
   21.83  		return send_error(conn, errno);
   21.84  
   21.85  	if (!set_perms(conn->transaction, node, perms, num))
   21.86 @@ -938,6 +938,12 @@ static bool process_message(struct conne
   21.87  		return do_set_perms(conn, in);
   21.88  
   21.89  	case XS_SHUTDOWN:
   21.90 +		/* FIXME: Implement gentle shutdown too. */
   21.91 +		/* Only tools can do this. */
   21.92 +		if (conn->id != 0)
   21.93 +			return send_error(conn, EACCES);
   21.94 +		if (!conn->can_write)
   21.95 +			return send_error(conn, EROFS);
   21.96  		send_ack(conn, XS_SHUTDOWN);
   21.97  		/* Everything hangs off auto-free context, freed at exit. */
   21.98  		exit(0);
   21.99 @@ -1137,6 +1143,7 @@ struct connection *new_connection(connwr
  21.100  	new->transaction = NULL;
  21.101  	new->write = write;
  21.102  	new->read = read;
  21.103 +	new->can_write = true;
  21.104  
  21.105  	talloc_set_fail_handler(out_of_mem, &talloc_fail);
  21.106  	if (setjmp(talloc_fail)) {
  21.107 @@ -1170,10 +1177,11 @@ static void accept_connection(int sock, 
  21.108  	if (fd < 0)
  21.109  		return;
  21.110  
  21.111 -	conn = new_connection(canwrite ? writefd : NULL, readfd);
  21.112 -	if (conn)
  21.113 +	conn = new_connection(writefd, readfd);
  21.114 +	if (conn) {
  21.115  		conn->fd = fd;
  21.116 -	else
  21.117 +		conn->can_write = canwrite;
  21.118 +	} else
  21.119  		close(fd);
  21.120  }
  21.121  
    22.1 --- a/tools/xenstore/xenstored_core.h	Thu Jun 09 22:13:12 2005 +0000
    22.2 +++ b/tools/xenstore/xenstored_core.h	Fri Jun 10 15:42:20 2005 +0000
    22.3 @@ -56,6 +56,9 @@ struct connection
    22.4  	/* Are we blocked waiting for a transaction to end?  Contains node. */
    22.5  	char *blocked;
    22.6  
    22.7 +	/* Is this a read-only connection? */
    22.8 +	bool can_write;
    22.9 +
   22.10  	/* Our current event.  If all used, we're waiting for ack. */
   22.11  	struct watch_event *event;
   22.12  
    23.1 --- a/tools/xenstore/xenstored_domain.c	Thu Jun 09 22:13:12 2005 +0000
    23.2 +++ b/tools/xenstore/xenstored_domain.c	Fri Jun 10 15:42:20 2005 +0000
    23.3 @@ -268,6 +268,9 @@ bool do_introduce(struct connection *con
    23.4  	if (get_strings(in, vec, ARRAY_SIZE(vec)) < ARRAY_SIZE(vec))
    23.5  		return send_error(conn, EINVAL);
    23.6  
    23.7 +	if (!conn->can_write)
    23.8 +		return send_error(conn, EROFS);
    23.9 +
   23.10  	/* Hang domain off "in" until we're finished. */
   23.11  	domain = talloc(in, struct domain);
   23.12  	domain->domid = atoi(vec[0]);
    24.1 --- a/tools/xenstore/xenstored_test.h	Thu Jun 09 22:13:12 2005 +0000
    24.2 +++ b/tools/xenstore/xenstored_test.h	Fri Jun 10 15:42:20 2005 +0000
    24.3 @@ -21,7 +21,7 @@
    24.4  
    24.5  #ifdef TESTING
    24.6  bool test_write_all(int fd, void *contents, unsigned int len);
    24.7 -#define write_all test_write_all
    24.8 +#define xs_write_all test_write_all
    24.9  
   24.10  int test_mkdir(const char *dir, int perms);
   24.11  #define mkdir test_mkdir
    25.1 --- a/tools/xenstore/xs.c	Thu Jun 09 22:13:12 2005 +0000
    25.2 +++ b/tools/xenstore/xs.c	Fri Jun 10 15:42:20 2005 +0000
    25.3 @@ -118,7 +118,7 @@ static bool read_all(int fd, void *data,
    25.4  
    25.5  #ifdef XSTEST
    25.6  #define read_all read_all_choice
    25.7 -#define write_all write_all_choice
    25.8 +#define xs_write_all write_all_choice
    25.9  #endif
   25.10  
   25.11  static int get_error(const char *errorstring)
   25.12 @@ -179,11 +179,11 @@ static void *xs_talkv(struct xs_handle *
   25.13  	ignorepipe.sa_flags = 0;
   25.14  	sigaction(SIGPIPE, &ignorepipe, &oldact);
   25.15  
   25.16 -	if (!write_all(h->fd, &msg, sizeof(msg)))
   25.17 +	if (!xs_write_all(h->fd, &msg, sizeof(msg)))
   25.18  		goto fail;
   25.19  
   25.20  	for (i = 0; i < num_vecs; i++)
   25.21 -		if (!write_all(h->fd, iovec[i].iov_base, iovec[i].iov_len))
   25.22 +		if (!xs_write_all(h->fd, iovec[i].iov_base, iovec[i].iov_len))
   25.23  			goto fail;
   25.24  
   25.25  	/* Watches can have fired before reply comes: daemon detects
   25.26 @@ -253,7 +253,7 @@ char **xs_directory(struct xs_handle *h,
   25.27  		return NULL;
   25.28  
   25.29  	/* Count the strings. */
   25.30 -	*num = count_strings(strings, len);
   25.31 +	*num = xs_count_strings(strings, len);
   25.32  
   25.33  	/* Transfer to one big alloc for easy freeing. */
   25.34  	ret = malloc(*num * sizeof(char *) + len);
   25.35 @@ -342,7 +342,7 @@ struct xs_permissions *xs_get_permission
   25.36  		return NULL;
   25.37  
   25.38  	/* Count the strings: each one perms then domid. */
   25.39 -	*num = count_strings(strings, len);
   25.40 +	*num = xs_count_strings(strings, len);
   25.41  
   25.42  	/* Transfer to one big alloc for easy freeing. */
   25.43  	ret = malloc(*num * sizeof(struct xs_permissions));
   25.44 @@ -351,7 +351,7 @@ struct xs_permissions *xs_get_permission
   25.45  		return NULL;
   25.46  	}
   25.47  
   25.48 -	if (!strings_to_perms(ret, *num, strings)) {
   25.49 +	if (!xs_strings_to_perms(ret, *num, strings)) {
   25.50  		free_no_errno(ret);
   25.51  		ret = NULL;
   25.52  	}
   25.53 @@ -376,7 +376,7 @@ bool xs_set_permissions(struct xs_handle
   25.54  	for (i = 0; i < num_perms; i++) {
   25.55  		char buffer[MAX_STRLEN(domid_t)+1];
   25.56  
   25.57 -		if (!perm_to_string(&perms[i], buffer))
   25.58 +		if (!xs_perm_to_string(&perms[i], buffer))
   25.59  			goto unwind;
   25.60  
   25.61  		iov[i+1].iov_base = strdup(buffer);
    26.1 --- a/tools/xenstore/xs_lib.c	Thu Jun 09 22:13:12 2005 +0000
    26.2 +++ b/tools/xenstore/xs_lib.c	Fri Jun 10 15:42:20 2005 +0000
    26.3 @@ -48,7 +48,7 @@ const char *xs_daemon_transactions(void)
    26.4  }
    26.5  
    26.6  /* Simple routines for writing to sockets, etc. */
    26.7 -bool write_all(int fd, const void *data, unsigned int len)
    26.8 +bool xs_write_all(int fd, const void *data, unsigned int len)
    26.9  {
   26.10  	while (len) {
   26.11  		int done;
   26.12 @@ -66,7 +66,7 @@ bool write_all(int fd, const void *data,
   26.13  }
   26.14  
   26.15  /* Convert strings to permissions.  False if a problem. */
   26.16 -bool strings_to_perms(struct xs_permissions *perms, unsigned int num,
   26.17 +bool xs_strings_to_perms(struct xs_permissions *perms, unsigned int num,
   26.18  		      const char *strings)
   26.19  {
   26.20  	const char *p;
   26.21 @@ -104,7 +104,7 @@ bool strings_to_perms(struct xs_permissi
   26.22  }
   26.23  
   26.24  /* Convert permissions to a string (up to len MAX_STRLEN(domid_t)+1). */
   26.25 -bool perm_to_string(const struct xs_permissions *perm, char *buffer)
   26.26 +bool xs_perm_to_string(const struct xs_permissions *perm, char *buffer)
   26.27  {
   26.28  	switch (perm->perms) {
   26.29  	case XS_PERM_WRITE:
   26.30 @@ -128,7 +128,7 @@ bool perm_to_string(const struct xs_perm
   26.31  }
   26.32  
   26.33  /* Given a string and a length, count how many strings (nul terms). */
   26.34 -unsigned int count_strings(const char *strings, unsigned int len)
   26.35 +unsigned int xs_count_strings(const char *strings, unsigned int len)
   26.36  {
   26.37  	unsigned int num;
   26.38  	const char *p;
    27.1 --- a/tools/xenstore/xs_lib.h	Thu Jun 09 22:13:12 2005 +0000
    27.2 +++ b/tools/xenstore/xs_lib.h	Fri Jun 10 15:42:20 2005 +0000
    27.3 @@ -48,16 +48,16 @@ const char *xs_daemon_store(void);
    27.4  const char *xs_daemon_transactions(void);
    27.5  
    27.6  /* Simple write function: loops for you. */
    27.7 -bool write_all(int fd, const void *data, unsigned int len);
    27.8 +bool xs_write_all(int fd, const void *data, unsigned int len);
    27.9  
   27.10  /* Convert strings to permissions.  False if a problem. */
   27.11 -bool strings_to_perms(struct xs_permissions *perms, unsigned int num,
   27.12 +bool xs_strings_to_perms(struct xs_permissions *perms, unsigned int num,
   27.13  		      const char *strings);
   27.14  
   27.15  /* Convert permissions to a string (up to len MAX_STRLEN(domid_t)+1). */
   27.16 -bool perm_to_string(const struct xs_permissions *perm, char *buffer);
   27.17 +bool xs_perm_to_string(const struct xs_permissions *perm, char *buffer);
   27.18  
   27.19  /* Given a string and a length, count how many strings (nul terms). */
   27.20 -unsigned int count_strings(const char *strings, unsigned int len);
   27.21 +unsigned int xs_count_strings(const char *strings, unsigned int len);
   27.22  
   27.23  #endif /* _XS_LIB_H */
    28.1 --- a/tools/xenstore/xs_random.c	Thu Jun 09 22:13:12 2005 +0000
    28.2 +++ b/tools/xenstore/xs_random.c	Fri Jun 10 15:42:20 2005 +0000
    28.3 @@ -223,10 +223,10 @@ static struct xs_permissions *file_get_p
    28.4  		release_file(perms, size);
    28.5  		return ret;
    28.6  	}
    28.7 -	*num = count_strings(perms, size);
    28.8 +	*num = xs_count_strings(perms, size);
    28.9  
   28.10  	ret = new_array(struct xs_permissions, *num);
   28.11 -	if (!strings_to_perms(ret, *num, perms))
   28.12 +	if (!xs_strings_to_perms(ret, *num, perms))
   28.13  		barf("Reading permissions from %s", permfile);
   28.14  	release_file(perms, size);
   28.15  	return ret;
   28.16 @@ -267,7 +267,7 @@ static bool file_set_perms(struct file_o
   28.17  	for (i = 0; i < num; i++) {
   28.18  		char buffer[100];
   28.19  
   28.20 -		if (!perm_to_string(&perms[i], buffer)) {
   28.21 +		if (!xs_perm_to_string(&perms[i], buffer)) {
   28.22  			int saved_errno = errno;
   28.23  			close(fd);
   28.24  			errno = saved_errno;
   28.25 @@ -536,7 +536,7 @@ static char *dump_dir(struct ops *ops,
   28.26  		ret = talloc_asprintf_append(ret, "%s%s: ", spacing, dir[i]);
   28.27  		for (j = 0; j < numperms; j++) {
   28.28  			char buffer[100];
   28.29 -			if (!perm_to_string(&perms[j], buffer))
   28.30 +			if (!xs_perm_to_string(&perms[j], buffer))
   28.31  				barf("perm to string");
   28.32  			ret = talloc_asprintf_append(ret, "%s ", buffer);
   28.33  		}
    29.1 --- a/tools/xenstore/xs_test.c	Thu Jun 09 22:13:12 2005 +0000
    29.2 +++ b/tools/xenstore/xs_test.c	Fri Jun 10 15:42:20 2005 +0000
    29.3 @@ -153,7 +153,7 @@ static bool write_all_choice(int fd, con
    29.4  {
    29.5  	if (fd == -2)
    29.6  		return write_all_shmem(fd, data, len);
    29.7 -	return write_all(fd, data, len);
    29.8 +	return xs_write_all(fd, data, len);
    29.9  }
   29.10  
   29.11  /* We want access to internal functions. */
   29.12 @@ -176,11 +176,11 @@ static void __attribute__((noreturn)) us
   29.13  	     "  watch <path> <prio>\n"
   29.14  	     "  waitwatch\n"
   29.15  	     "  ackwatch\n"
   29.16 -	     "  unwatch <path>\n"
   29.17 +	     "  unwatch <path> <token>\n"
   29.18  	     "  close\n"
   29.19  	     "  start <node>\n"
   29.20  	     "  abort\n"
   29.21 -	     "  introduce <domid> <mfn> <eventchn>\n"
   29.22 +	     "  introduce <domid> <mfn> <eventchn> <path>\n"
   29.23  	     "  commit\n"
   29.24  	     "  sleep <seconds>\n"
   29.25  	     "  dump\n");
   29.26 @@ -491,7 +491,7 @@ static void dump_dir(unsigned int handle
   29.27  		printf("%s%s: ", spacing, dir[i]);
   29.28  		for (j = 0; j < numperms; j++) {
   29.29  			char buffer[100];
   29.30 -			if (!perm_to_string(&perms[j], buffer))
   29.31 +			if (!xs_perm_to_string(&perms[j], buffer))
   29.32  				barf("perm to string");
   29.33  			printf("%s ", buffer);
   29.34  		}
    30.1 --- a/xen/arch/ia64/vmx_init.c	Thu Jun 09 22:13:12 2005 +0000
    30.2 +++ b/xen/arch/ia64/vmx_init.c	Fri Jun 10 15:42:20 2005 +0000
    30.3 @@ -41,6 +41,7 @@
    30.4  #include <public/arch-ia64.h>
    30.5  #include <asm/vmx_phy_mode.h>
    30.6  #include <asm/vmx.h>
    30.7 +#include <xen/mm.h>
    30.8  
    30.9  /* Global flag to identify whether Intel vmx feature is on */
   30.10  u32 vmx_enabled = 0;
    31.1 --- a/xen/arch/ia64/xenmem.c	Thu Jun 09 22:13:12 2005 +0000
    31.2 +++ b/xen/arch/ia64/xenmem.c	Fri Jun 10 15:42:20 2005 +0000
    31.3 @@ -11,7 +11,7 @@
    31.4  
    31.5  #include <linux/config.h>
    31.6  #include <asm/pgtable.h>
    31.7 -#include <asm/mm.h>
    31.8 +#include <xen/mm.h>
    31.9  
   31.10  extern struct page *zero_page_memmap_ptr;
   31.11  struct pfn_info *frame_table;
    32.1 --- a/xen/arch/x86/domain.c	Thu Jun 09 22:13:12 2005 +0000
    32.2 +++ b/xen/arch/x86/domain.c	Fri Jun 10 15:42:20 2005 +0000
    32.3 @@ -414,7 +414,7 @@ int arch_set_info_guest(
    32.4          /* Ensure real hardware interrupts are enabled. */
    32.5          v->arch.guest_context.user_regs.eflags |= EF_IE;
    32.6      } else {
    32.7 -        __vmwrite(GUEST_EFLAGS, v->arch.guest_context.user_regs.eflags);
    32.8 +        __vmwrite(GUEST_RFLAGS, v->arch.guest_context.user_regs.eflags);
    32.9          if (v->arch.guest_context.user_regs.eflags & EF_TF)
   32.10                  __vm_set_bit(EXCEPTION_BITMAP, EXCEPTION_BITMAP_DB);
   32.11          else 
    33.1 --- a/xen/arch/x86/traps.c	Thu Jun 09 22:13:12 2005 +0000
    33.2 +++ b/xen/arch/x86/traps.c	Fri Jun 10 15:42:20 2005 +0000
    33.3 @@ -423,6 +423,7 @@ asmlinkage int do_page_fault(struct cpu_
    33.4          }
    33.5  
    33.6          if ( (addr < HYPERVISOR_VIRT_START) &&
    33.7 +             KERNEL_MODE(v, regs) &&
    33.8               ((regs->error_code & 3) == 3) && /* write-protection fault */
    33.9               ptwr_do_page_fault(d, addr) )
   33.10          {
    34.1 --- a/xen/arch/x86/vmx.c	Thu Jun 09 22:13:12 2005 +0000
    34.2 +++ b/xen/arch/x86/vmx.c	Fri Jun 10 15:42:20 2005 +0000
    34.3 @@ -114,8 +114,8 @@ static void inline __update_guest_eip(un
    34.4  {
    34.5      unsigned long current_eip;
    34.6  
    34.7 -    __vmread(GUEST_EIP, &current_eip);
    34.8 -    __vmwrite(GUEST_EIP, current_eip + inst_len);
    34.9 +    __vmread(GUEST_RIP, &current_eip);
   34.10 +    __vmwrite(GUEST_RIP, current_eip + inst_len);
   34.11  }
   34.12  
   34.13  
   34.14 @@ -128,7 +128,7 @@ static int vmx_do_page_fault(unsigned lo
   34.15  
   34.16  #if VMX_DEBUG
   34.17      {
   34.18 -        __vmread(GUEST_EIP, &eip);
   34.19 +        __vmread(GUEST_RIP, &eip);
   34.20          VMX_DBG_LOG(DBG_LEVEL_VMMU, 
   34.21                  "vmx_do_page_fault = 0x%lx, eip = %lx, error_code = %lx",
   34.22                  va, eip, (unsigned long)regs->error_code);
   34.23 @@ -152,7 +152,7 @@ static int vmx_do_page_fault(unsigned lo
   34.24  #if 0
   34.25      if ( !result )
   34.26      {
   34.27 -        __vmread(GUEST_EIP, &eip);
   34.28 +        __vmread(GUEST_RIP, &eip);
   34.29          printk("vmx pgfault to guest va=%p eip=%p\n", va, eip);
   34.30      }
   34.31  #endif
   34.32 @@ -180,7 +180,7 @@ static void vmx_do_general_protection_fa
   34.33      unsigned long eip, error_code;
   34.34      unsigned long intr_fields;
   34.35  
   34.36 -    __vmread(GUEST_EIP, &eip);
   34.37 +    __vmread(GUEST_RIP, &eip);
   34.38      __vmread(VM_EXIT_INTR_ERROR_CODE, &error_code);
   34.39  
   34.40      VMX_DBG_LOG(DBG_LEVEL_1,
   34.41 @@ -207,7 +207,7 @@ static void vmx_vmexit_do_cpuid(unsigned
   34.42      unsigned int eax, ebx, ecx, edx;
   34.43      unsigned long eip;
   34.44  
   34.45 -    __vmread(GUEST_EIP, &eip);
   34.46 +    __vmread(GUEST_RIP, &eip);
   34.47  
   34.48      VMX_DBG_LOG(DBG_LEVEL_1, 
   34.49                  "do_cpuid: (eax) %lx, (ebx) %lx, (ecx) %lx, (edx) %lx,"
   34.50 @@ -245,7 +245,7 @@ static void vmx_dr_access (unsigned long
   34.51      struct vcpu *v = current;
   34.52      unsigned long eip;
   34.53  
   34.54 -    __vmread(GUEST_EIP, &eip);
   34.55 +    __vmread(GUEST_RIP, &eip);
   34.56  
   34.57      reg = exit_qualification & DEBUG_REG_ACCESS_NUM;
   34.58  
   34.59 @@ -274,7 +274,7 @@ static void vmx_dr_access (unsigned long
   34.60              v->arch.guest_context.debugreg[reg] = *reg_p; 
   34.61          else {
   34.62              unsigned long value;
   34.63 -            __vmread(GUEST_ESP, &value);
   34.64 +            __vmread(GUEST_RSP, &value);
   34.65              v->arch.guest_context.debugreg[reg] = value;
   34.66          }
   34.67          break;
   34.68 @@ -282,7 +282,7 @@ static void vmx_dr_access (unsigned long
   34.69          if (reg != REG_ESP)
   34.70              *reg_p = v->arch.guest_context.debugreg[reg];
   34.71          else {
   34.72 -            __vmwrite(GUEST_ESP, v->arch.guest_context.debugreg[reg]);
   34.73 +            __vmwrite(GUEST_RSP, v->arch.guest_context.debugreg[reg]);
   34.74          }
   34.75          break;
   34.76      }
   34.77 @@ -297,7 +297,7 @@ static void vmx_vmexit_do_invlpg(unsigne
   34.78      unsigned long eip;
   34.79      struct vcpu *v = current;
   34.80  
   34.81 -    __vmread(GUEST_EIP, &eip);
   34.82 +    __vmread(GUEST_RIP, &eip);
   34.83  
   34.84      VMX_DBG_LOG(DBG_LEVEL_VMMU, "vmx_vmexit_do_invlpg: eip=%lx, va=%lx",
   34.85                  eip, va);
   34.86 @@ -368,9 +368,9 @@ static void vmx_io_instruction(struct cp
   34.87      unsigned long eip, cs, eflags;
   34.88      int vm86;
   34.89  
   34.90 -    __vmread(GUEST_EIP, &eip);
   34.91 +    __vmread(GUEST_RIP, &eip);
   34.92      __vmread(GUEST_CS_SELECTOR, &cs);
   34.93 -    __vmread(GUEST_EFLAGS, &eflags);
   34.94 +    __vmread(GUEST_RFLAGS, &eflags);
   34.95      vm86 = eflags & X86_EFLAGS_VM ? 1 : 0;
   34.96  
   34.97      VMX_DBG_LOG(DBG_LEVEL_1, 
   34.98 @@ -495,10 +495,10 @@ vmx_world_save(struct vcpu *d, struct vm
   34.99      int error = 0;
  34.100  
  34.101      error |= __vmread(INSTRUCTION_LEN, &inst_len);
  34.102 -    error |= __vmread(GUEST_EIP, &c->eip);
  34.103 +    error |= __vmread(GUEST_RIP, &c->eip);
  34.104      c->eip += inst_len; /* skip transition instruction */
  34.105 -    error |= __vmread(GUEST_ESP, &c->esp);
  34.106 -    error |= __vmread(GUEST_EFLAGS, &c->eflags);
  34.107 +    error |= __vmread(GUEST_RSP, &c->esp);
  34.108 +    error |= __vmread(GUEST_RFLAGS, &c->eflags);
  34.109  
  34.110      error |= __vmread(CR0_READ_SHADOW, &c->cr0);
  34.111      c->cr3 = d->arch.arch_vmx.cpu_cr3;
  34.112 @@ -559,9 +559,9 @@ vmx_world_restore(struct vcpu *d, struct
  34.113      unsigned long mfn, old_cr4;
  34.114      int error = 0;
  34.115  
  34.116 -    error |= __vmwrite(GUEST_EIP, c->eip);
  34.117 -    error |= __vmwrite(GUEST_ESP, c->esp);
  34.118 -    error |= __vmwrite(GUEST_EFLAGS, c->eflags);
  34.119 +    error |= __vmwrite(GUEST_RIP, c->eip);
  34.120 +    error |= __vmwrite(GUEST_RSP, c->esp);
  34.121 +    error |= __vmwrite(GUEST_RFLAGS, c->eflags);
  34.122  
  34.123      error |= __vmwrite(CR0_READ_SHADOW, c->cr0);
  34.124  
  34.125 @@ -783,25 +783,25 @@ static int vmx_set_cr0(unsigned long val
  34.126       * a partition disables the CR0.PE bit.
  34.127       */
  34.128      if ((value & X86_CR0_PE) == 0) {
  34.129 -	__vmread(GUEST_EIP, &eip);
  34.130 +	__vmread(GUEST_RIP, &eip);
  34.131  	VMX_DBG_LOG(DBG_LEVEL_1,
  34.132  	    "Disabling CR0.PE at %%eip 0x%lx\n", eip);
  34.133  	if (vmx_assist(d, VMX_ASSIST_INVOKE)) {
  34.134  	    set_bit(VMX_CPU_STATE_ASSIST_ENABLED, &d->arch.arch_vmx.cpu_state);
  34.135 -	    __vmread(GUEST_EIP, &eip);
  34.136 +	    __vmread(GUEST_RIP, &eip);
  34.137  	    VMX_DBG_LOG(DBG_LEVEL_1,
  34.138  		"Transfering control to vmxassist %%eip 0x%lx\n", eip);
  34.139  	    return 0; /* do not update eip! */
  34.140  	}
  34.141      } else if (test_bit(VMX_CPU_STATE_ASSIST_ENABLED,
  34.142  					&d->arch.arch_vmx.cpu_state)) {
  34.143 -	__vmread(GUEST_EIP, &eip);
  34.144 +	__vmread(GUEST_RIP, &eip);
  34.145  	VMX_DBG_LOG(DBG_LEVEL_1,
  34.146  	    "Enabling CR0.PE at %%eip 0x%lx\n", eip);
  34.147  	if (vmx_assist(d, VMX_ASSIST_RESTORE)) {
  34.148  	    clear_bit(VMX_CPU_STATE_ASSIST_ENABLED,
  34.149  					&d->arch.arch_vmx.cpu_state);
  34.150 -	    __vmread(GUEST_EIP, &eip);
  34.151 +	    __vmread(GUEST_RIP, &eip);
  34.152  	    VMX_DBG_LOG(DBG_LEVEL_1,
  34.153  		"Restoring to %%eip 0x%lx\n", eip);
  34.154  	    return 0; /* do not update eip! */
  34.155 @@ -832,7 +832,7 @@ static int mov_to_cr(int gp, int cr, str
  34.156          CASE_GET_REG(ESI, esi);
  34.157          CASE_GET_REG(EDI, edi);
  34.158      case REG_ESP:
  34.159 -        __vmread(GUEST_ESP, &value);
  34.160 +        __vmread(GUEST_RSP, &value);
  34.161          break;
  34.162      default:
  34.163          printk("invalid gp: %d\n", gp);
  34.164 @@ -953,7 +953,7 @@ static void mov_from_cr(int cr, int gp, 
  34.165          CASE_SET_REG(ESI, esi);
  34.166          CASE_SET_REG(EDI, edi);
  34.167      case REG_ESP:
  34.168 -        __vmwrite(GUEST_ESP, value);
  34.169 +        __vmwrite(GUEST_RSP, value);
  34.170          regs->esp = value;
  34.171          break;
  34.172      default:
  34.173 @@ -1025,7 +1025,7 @@ static inline void vmx_vmexit_do_hlt(voi
  34.174  {
  34.175  #if VMX_DEBUG
  34.176      unsigned long eip;
  34.177 -    __vmread(GUEST_EIP, &eip);
  34.178 +    __vmread(GUEST_RIP, &eip);
  34.179  #endif
  34.180      VMX_DBG_LOG(DBG_LEVEL_1, "vmx_vmexit_do_hlt:eip=%lx", eip);
  34.181      raise_softirq(SCHEDULE_SOFTIRQ);
  34.182 @@ -1035,7 +1035,7 @@ static inline void vmx_vmexit_do_mwait(v
  34.183  {
  34.184  #if VMX_DEBUG
  34.185      unsigned long eip;
  34.186 -    __vmread(GUEST_EIP, &eip);
  34.187 +    __vmread(GUEST_RIP, &eip);
  34.188  #endif
  34.189      VMX_DBG_LOG(DBG_LEVEL_1, "vmx_vmexit_do_mwait:eip=%lx", eip);
  34.190      raise_softirq(SCHEDULE_SOFTIRQ);
  34.191 @@ -1064,10 +1064,10 @@ static void vmx_print_line(const char c,
  34.192  void save_vmx_cpu_user_regs(struct cpu_user_regs *ctxt)
  34.193  {
  34.194      __vmread(GUEST_SS_SELECTOR, &ctxt->ss);
  34.195 -    __vmread(GUEST_ESP, &ctxt->esp);
  34.196 -    __vmread(GUEST_EFLAGS, &ctxt->eflags);
  34.197 +    __vmread(GUEST_RSP, &ctxt->esp);
  34.198 +    __vmread(GUEST_RFLAGS, &ctxt->eflags);
  34.199      __vmread(GUEST_CS_SELECTOR, &ctxt->cs);
  34.200 -    __vmread(GUEST_EIP, &ctxt->eip);
  34.201 +    __vmread(GUEST_RIP, &ctxt->eip);
  34.202  
  34.203      __vmread(GUEST_GS_SELECTOR, &ctxt->gs);
  34.204      __vmread(GUEST_FS_SELECTOR, &ctxt->fs);
  34.205 @@ -1079,10 +1079,10 @@ void save_vmx_cpu_user_regs(struct cpu_u
  34.206  void save_cpu_user_regs(struct cpu_user_regs *regs)
  34.207  {
  34.208      __vmread(GUEST_SS_SELECTOR, &regs->xss);
  34.209 -    __vmread(GUEST_ESP, &regs->esp);
  34.210 -    __vmread(GUEST_EFLAGS, &regs->eflags);
  34.211 +    __vmread(GUEST_RSP, &regs->esp);
  34.212 +    __vmread(GUEST_RFLAGS, &regs->eflags);
  34.213      __vmread(GUEST_CS_SELECTOR, &regs->xcs);
  34.214 -    __vmread(GUEST_EIP, &regs->eip);
  34.215 +    __vmread(GUEST_RIP, &regs->eip);
  34.216  
  34.217      __vmread(GUEST_GS_SELECTOR, &regs->xgs);
  34.218      __vmread(GUEST_FS_SELECTOR, &regs->xfs);
  34.219 @@ -1093,10 +1093,10 @@ void save_cpu_user_regs(struct cpu_user_
  34.220  void restore_cpu_user_regs(struct cpu_user_regs *regs)
  34.221  {
  34.222      __vmwrite(GUEST_SS_SELECTOR, regs->xss);
  34.223 -    __vmwrite(GUEST_ESP, regs->esp);
  34.224 -    __vmwrite(GUEST_EFLAGS, regs->eflags);
  34.225 +    __vmwrite(GUEST_RSP, regs->esp);
  34.226 +    __vmwrite(GUEST_RFLAGS, regs->eflags);
  34.227      __vmwrite(GUEST_CS_SELECTOR, regs->xcs);
  34.228 -    __vmwrite(GUEST_EIP, regs->eip);
  34.229 +    __vmwrite(GUEST_RIP, regs->eip);
  34.230  
  34.231      __vmwrite(GUEST_GS_SELECTOR, regs->xgs);
  34.232      __vmwrite(GUEST_FS_SELECTOR, regs->xfs);
  34.233 @@ -1142,7 +1142,7 @@ asmlinkage void vmx_vmexit_handler(struc
  34.234          return;
  34.235      }
  34.236  
  34.237 -    __vmread(GUEST_EIP, &eip);
  34.238 +    __vmread(GUEST_RIP, &eip);
  34.239      TRACE_3D(TRC_VMX_VMEXIT, v->domain->domain_id, eip, exit_reason);
  34.240  
  34.241      switch (exit_reason) {
  34.242 @@ -1296,7 +1296,7 @@ asmlinkage void vmx_vmexit_handler(struc
  34.243      }
  34.244      case EXIT_REASON_VMCALL:
  34.245          __get_instruction_length(inst_len);
  34.246 -        __vmread(GUEST_EIP, &eip);
  34.247 +        __vmread(GUEST_RIP, &eip);
  34.248          __vmread(EXIT_QUALIFICATION, &exit_qualification);
  34.249  
  34.250          vmx_print_line(regs.eax, v); /* provides the current domain */
  34.251 @@ -1304,7 +1304,7 @@ asmlinkage void vmx_vmexit_handler(struc
  34.252          break;
  34.253      case EXIT_REASON_CR_ACCESS:
  34.254      {
  34.255 -        __vmread(GUEST_EIP, &eip);
  34.256 +        __vmread(GUEST_RIP, &eip);
  34.257          __get_instruction_length(inst_len);
  34.258          __vmread(EXIT_QUALIFICATION, &exit_qualification);
  34.259  
  34.260 @@ -1331,7 +1331,7 @@ asmlinkage void vmx_vmexit_handler(struc
  34.261          __update_guest_eip(inst_len);
  34.262          break;
  34.263      case EXIT_REASON_MSR_WRITE:
  34.264 -        __vmread(GUEST_EIP, &eip);
  34.265 +        __vmread(GUEST_RIP, &eip);
  34.266          VMX_DBG_LOG(DBG_LEVEL_1, "MSR_WRITE: eip=%lx, eax=%lx, edx=%lx",
  34.267                  eip, (unsigned long)regs.eax, (unsigned long)regs.edx);
  34.268          /* just ignore this point */
    35.1 --- a/xen/arch/x86/vmx_io.c	Thu Jun 09 22:13:12 2005 +0000
    35.2 +++ b/xen/arch/x86/vmx_io.c	Fri Jun 10 15:42:20 2005 +0000
    35.3 @@ -42,10 +42,10 @@ static void load_cpu_user_regs(struct cp
    35.4       * Write the guest register value into VMCS
    35.5       */
    35.6      __vmwrite(GUEST_SS_SELECTOR, regs->ss);
    35.7 -    __vmwrite(GUEST_ESP, regs->esp);
    35.8 -    __vmwrite(GUEST_EFLAGS, regs->eflags);
    35.9 +    __vmwrite(GUEST_RSP, regs->esp);
   35.10 +    __vmwrite(GUEST_RFLAGS, regs->eflags);
   35.11      __vmwrite(GUEST_CS_SELECTOR, regs->cs);
   35.12 -    __vmwrite(GUEST_EIP, regs->eip);
   35.13 +    __vmwrite(GUEST_RIP, regs->eip);
   35.14  }
   35.15  
   35.16  static void set_reg_value (int size, int index, int seg, struct cpu_user_regs *regs, long value)
   35.17 @@ -439,7 +439,7 @@ void vmx_intr_assist(struct vcpu *d)
   35.18          return;
   35.19      }
   35.20  
   35.21 -    __vmread(GUEST_EFLAGS, &eflags);
   35.22 +    __vmread(GUEST_RFLAGS, &eflags);
   35.23      if (irq_masked(eflags)) {
   35.24          VMX_DBG_LOG(DBG_LEVEL_1, "guesting pending: %x, eflags: %lx",
   35.25                      highest_vector, eflags);
   35.26 @@ -479,7 +479,7 @@ void vmx_do_resume(struct vcpu *d)
   35.27          __vmwrite(GUEST_CR3, pagetable_get_paddr(d->domain->arch.phys_table));
   35.28  
   35.29      __vmwrite(HOST_CR3, pagetable_get_paddr(d->arch.monitor_table));
   35.30 -    __vmwrite(HOST_ESP, (unsigned long)get_stack_bottom());
   35.31 +    __vmwrite(HOST_RSP, (unsigned long)get_stack_bottom());
   35.32  
   35.33      if (event_pending(d)) {
   35.34          vmx_check_events(d);
    36.1 --- a/xen/arch/x86/vmx_platform.c	Thu Jun 09 22:13:12 2005 +0000
    36.2 +++ b/xen/arch/x86/vmx_platform.c	Fri Jun 10 15:42:20 2005 +0000
    36.3 @@ -52,12 +52,12 @@ static long get_reg_value(int size, int 
    36.4  void store_cpu_user_regs(struct cpu_user_regs *regs)
    36.5  {
    36.6      __vmread(GUEST_SS_SELECTOR, &regs->ss);
    36.7 -    __vmread(GUEST_ESP, &regs->esp);
    36.8 -    __vmread(GUEST_EFLAGS, &regs->eflags);
    36.9 +    __vmread(GUEST_RSP, &regs->esp);
   36.10 +    __vmread(GUEST_RFLAGS, &regs->eflags);
   36.11      __vmread(GUEST_CS_SELECTOR, &regs->cs);
   36.12      __vmread(GUEST_DS_SELECTOR, &regs->ds);
   36.13      __vmread(GUEST_ES_SELECTOR, &regs->es);
   36.14 -    __vmread(GUEST_EIP, &regs->eip);
   36.15 +    __vmread(GUEST_RIP, &regs->eip);
   36.16  }
   36.17  
   36.18  static long get_reg_value(int size, int index, int seg, struct cpu_user_regs *regs)
   36.19 @@ -238,7 +238,7 @@ static int vmx_decode(const unsigned cha
   36.20      unsigned long eflags;
   36.21      int index, vm86 = 0;
   36.22  
   36.23 -    __vmread(GUEST_EFLAGS, &eflags);
   36.24 +    __vmread(GUEST_RFLAGS, &eflags);
   36.25      if (eflags & X86_EFLAGS_VM)
   36.26  	vm86 = 1;
   36.27  
   36.28 @@ -551,10 +551,10 @@ void handle_mmio(unsigned long va, unsig
   36.29      mpci_p = &current->arch.arch_vmx.vmx_platform.mpci;
   36.30      inst_decoder_regs = mpci_p->inst_decoder_regs;
   36.31  
   36.32 -    __vmread(GUEST_EIP, &eip);
   36.33 +    __vmread(GUEST_RIP, &eip);
   36.34      __vmread(INSTRUCTION_LEN, &inst_len);
   36.35  
   36.36 -    __vmread(GUEST_EFLAGS, &eflags);
   36.37 +    __vmread(GUEST_RFLAGS, &eflags);
   36.38      vm86 = eflags & X86_EFLAGS_VM;
   36.39  
   36.40      if (vm86) {
   36.41 @@ -583,7 +583,7 @@ void handle_mmio(unsigned long va, unsig
   36.42      if (vmx_decode(check_prefix(inst, &mmio_inst), &mmio_inst) == DECODE_failure)
   36.43          domain_crash_synchronous();
   36.44  
   36.45 -    __vmwrite(GUEST_EIP, eip + inst_len);
   36.46 +    __vmwrite(GUEST_RIP, eip + inst_len);
   36.47      store_cpu_user_regs(inst_decoder_regs);
   36.48  
   36.49      // Only handle "mov" and "movs" instructions!
    37.1 --- a/xen/arch/x86/vmx_vmcs.c	Thu Jun 09 22:13:12 2005 +0000
    37.2 +++ b/xen/arch/x86/vmx_vmcs.c	Fri Jun 10 15:42:20 2005 +0000
    37.3 @@ -199,7 +199,7 @@ void vmx_do_launch(struct vcpu *v)
    37.4  
    37.5      __vmwrite(GUEST_CR3, pagetable_get_paddr(v->arch.guest_table));
    37.6      __vmwrite(HOST_CR3, pagetable_get_paddr(v->arch.monitor_table));
    37.7 -    __vmwrite(HOST_ESP, (unsigned long)get_stack_bottom());
    37.8 +    __vmwrite(HOST_RSP, (unsigned long)get_stack_bottom());
    37.9  
   37.10      v->arch.schedule_tail = arch_vmx_do_resume;
   37.11  }
   37.12 @@ -308,19 +308,19 @@ construct_init_vmcs_guest(struct cpu_use
   37.13      error |= __vmwrite(GUEST_GS_BASE, host_env->ds_base);
   37.14      error |= __vmwrite(GUEST_IDTR_BASE, host_env->idtr_base);
   37.15  
   37.16 -    error |= __vmwrite(GUEST_ESP, regs->esp);
   37.17 -    error |= __vmwrite(GUEST_EIP, regs->eip);
   37.18 +    error |= __vmwrite(GUEST_RSP, regs->esp);
   37.19 +    error |= __vmwrite(GUEST_RIP, regs->eip);
   37.20  
   37.21      eflags = regs->eflags & ~VMCS_EFLAGS_RESERVED_0; /* clear 0s */
   37.22      eflags |= VMCS_EFLAGS_RESERVED_1; /* set 1s */
   37.23  
   37.24 -    error |= __vmwrite(GUEST_EFLAGS, eflags);
   37.25 +    error |= __vmwrite(GUEST_RFLAGS, eflags);
   37.26  
   37.27      error |= __vmwrite(GUEST_INTERRUPTIBILITY_INFO, 0);
   37.28      __asm__ __volatile__ ("mov %%dr7, %0\n" : "=r" (dr7));
   37.29      error |= __vmwrite(GUEST_DR7, dr7);
   37.30 -    error |= __vmwrite(GUEST_VMCS0, 0xffffffff);
   37.31 -    error |= __vmwrite(GUEST_VMCS1, 0xffffffff);
   37.32 +    error |= __vmwrite(VMCS_LINK_POINTER, 0xffffffff);
   37.33 +    error |= __vmwrite(VMCS_LINK_POINTER_HIGH, 0xffffffff);
   37.34  
   37.35      return error;
   37.36  }
   37.37 @@ -362,7 +362,7 @@ static inline int construct_vmcs_host(st
   37.38      __asm__ __volatile__ ("mov %%cr4,%0" : "=r" (crn) : ); 
   37.39      host_env->cr4 = crn;
   37.40      error |= __vmwrite(HOST_CR4, crn);
   37.41 -    error |= __vmwrite(HOST_EIP, (unsigned long) vmx_asm_vmexit_handler);
   37.42 +    error |= __vmwrite(HOST_RIP, (unsigned long) vmx_asm_vmexit_handler);
   37.43  
   37.44      return error;
   37.45  }
    38.1 --- a/xen/arch/x86/x86_32/entry.S	Thu Jun 09 22:13:12 2005 +0000
    38.2 +++ b/xen/arch/x86/x86_32/entry.S	Fri Jun 10 15:42:20 2005 +0000
    38.3 @@ -176,10 +176,10 @@ vmx_process_softirqs:
    38.4  restore_all_guest:
    38.5          testl $X86_EFLAGS_VM,UREGS_eflags(%esp)
    38.6          jnz  restore_all_vm86
    38.7 -FLT1:   movl UREGS_ds(%esp),%ds
    38.8 -FLT2:   movl UREGS_es(%esp),%es
    38.9 -FLT3:   movl UREGS_fs(%esp),%fs
   38.10 -FLT4:   movl UREGS_gs(%esp),%gs
   38.11 +FLT1:   mov UREGS_ds(%esp),%ds
   38.12 +FLT2:   mov UREGS_es(%esp),%es
   38.13 +FLT3:   mov UREGS_fs(%esp),%fs
   38.14 +FLT4:   mov UREGS_gs(%esp),%gs
   38.15  restore_all_vm86:
   38.16          popl %ebx
   38.17          popl %ecx
   38.18 @@ -306,7 +306,7 @@ create_bounce_frame:
   38.19          testl $(2|X86_EFLAGS_VM),%ecx
   38.20          jz   ring1 /* jump if returning to an existing ring-1 activation */
   38.21          movl VCPU_kernel_sp(%ebx),%esi
   38.22 -FLT6:   movl VCPU_kernel_ss(%ebx),%gs
   38.23 +FLT6:   mov VCPU_kernel_ss(%ebx),%gs
   38.24          testl $X86_EFLAGS_VM,UREGS_eflags+4(%esp)
   38.25          jz   nvm86_1
   38.26          subl $16,%esi       /* push ES/DS/FS/GS (VM86 stack frame) */
   38.27 @@ -326,7 +326,7 @@ FLT12:  movl %eax,%gs:4(%esi)
   38.28          jmp 1f
   38.29  ring1:  /* obtain ss/esp from oldss/oldesp -- a ring-1 activation exists */
   38.30          movl UREGS_esp+4(%esp),%esi
   38.31 -FLT13:  movl UREGS_ss+4(%esp),%gs 
   38.32 +FLT13:  mov UREGS_ss+4(%esp),%gs 
   38.33  1:      /* Construct a stack frame: EFLAGS, CS/EIP */
   38.34          movb TRAPBOUNCE_flags(%edx),%cl
   38.35          subl $12,%esi
   38.36 @@ -383,7 +383,7 @@ 2:      testl $X86_EFLAGS_VM,UREGS_eflag
   38.37  nvm86_3:/* Rewrite our stack frame and return to ring 1. */
   38.38          /* IA32 Ref. Vol. 3: TF, VM, RF and NT flags are cleared on trap. */
   38.39          andl $0xfffcbeff,UREGS_eflags+4(%esp)
   38.40 -        movl %gs,UREGS_ss+4(%esp)
   38.41 +        mov %gs,UREGS_ss+4(%esp)
   38.42          movl %esi,UREGS_esp+4(%esp)
   38.43          movzwl TRAPBOUNCE_cs(%edx),%eax
   38.44          movl %eax,UREGS_cs+4(%esp)
   38.45 @@ -670,7 +670,7 @@ do_switch_vm86:
   38.46  
   38.47          # GS:ESI == Ring-1 stack activation
   38.48          movl UREGS_esp(%esp),%esi
   38.49 -VFLT1:  movl UREGS_ss(%esp),%gs
   38.50 +VFLT1:  mov UREGS_ss(%esp),%gs
   38.51  
   38.52          # ES:EDI == Ring-0 stack activation
   38.53          leal UREGS_eip(%esp),%edi
    39.1 --- a/xen/arch/x86/x86_32/traps.c	Thu Jun 09 22:13:12 2005 +0000
    39.2 +++ b/xen/arch/x86/x86_32/traps.c	Fri Jun 10 15:42:20 2005 +0000
    39.3 @@ -21,9 +21,9 @@ void show_registers(struct cpu_user_regs
    39.4  
    39.5      if ( VMX_DOMAIN(current) && (regs->eflags == 0) )
    39.6      {
    39.7 -        __vmread(GUEST_EIP, &eip);
    39.8 -        __vmread(GUEST_ESP, &esp);
    39.9 -        __vmread(GUEST_EFLAGS, &eflags);
   39.10 +        __vmread(GUEST_RIP, &eip);
   39.11 +        __vmread(GUEST_RSP, &esp);
   39.12 +        __vmread(GUEST_RFLAGS, &eflags);
   39.13          __vmread(GUEST_SS_SELECTOR, &ss);
   39.14          __vmread(GUEST_DS_SELECTOR, &ds);
   39.15          __vmread(GUEST_ES_SELECTOR, &es);
    40.1 --- a/xen/arch/x86/x86_64/entry.S	Thu Jun 09 22:13:12 2005 +0000
    40.2 +++ b/xen/arch/x86/x86_64/entry.S	Fri Jun 10 15:42:20 2005 +0000
    40.3 @@ -19,15 +19,16 @@
    40.4          movq (reg),reg;
    40.5  
    40.6          ALIGN
    40.7 -/* %rbx: struct vcpu, interrupts disabled */
    40.8 +/* %rbx: struct vcpu */
    40.9  switch_to_kernel:
   40.10          leaq  VCPU_trap_bounce(%rbx),%rdx
   40.11          movq  VCPU_syscall_addr(%rbx),%rax
   40.12          movq  %rax,TRAPBOUNCE_eip(%rdx)
   40.13          movw  $0,TRAPBOUNCE_flags(%rdx)
   40.14          call  create_bounce_frame
   40.15 +        jmp   test_all_events
   40.16  
   40.17 -/* %rbx: struct vcpu */
   40.18 +/* %rbx: struct vcpu, interrupts disabled */
   40.19  restore_all_guest:
   40.20          RESTORE_ALL
   40.21          testw $TRAP_syscall,4(%rsp)
   40.22 @@ -38,7 +39,6 @@ restore_all_guest:
   40.23          popq  %r11                    # CS
   40.24          cmpw  $__GUEST_CS32,%r11
   40.25          popq  %r11                    # RFLAGS
   40.26 -        cli                           # No interrupts after stack switch
   40.27          popq  %rsp                    # RSP
   40.28          je    1f
   40.29          sysretq
   40.30 @@ -107,6 +107,7 @@ restore_all_xen:
   40.31   */
   40.32          ALIGN
   40.33  ENTRY(syscall_enter)
   40.34 +        sti
   40.35          movl  $__GUEST_SS,24(%rsp)
   40.36          pushq %rcx
   40.37          pushq $0
   40.38 @@ -117,7 +118,6 @@ ENTRY(syscall_enter)
   40.39          jz    switch_to_kernel
   40.40  
   40.41  /*hypercall:*/
   40.42 -        sti
   40.43          movq  %r10,%rcx
   40.44          andq  $(NR_hypercalls-1),%rax
   40.45          leaq  hypercall_table(%rip),%r10
   40.46 @@ -316,7 +316,7 @@ FLT4:   movq  %rax,16(%rsi)             
   40.47          testb $TBF_INTERRUPT,%cl
   40.48          setnz VCPUINFO_upcall_mask(%rax)# TBF_INTERRUPT -> clear upcall mask
   40.49          popq  %rax
   40.50 -        shll  $16,%eax                  # Bits 16-23: saved_upcall_mask
   40.51 +        shlq  $32,%rax                  # Bits 32-39: saved_upcall_mask
   40.52          movw  UREGS_cs+8(%rsp),%ax      # Bits  0-15: CS
   40.53  FLT5:   movq  %rax,8(%rsi)              # CS/saved_upcall_mask
   40.54          movq  UREGS_rip+8(%rsp),%rax
    41.1 --- a/xen/include/asm-x86/vmx.h	Thu Jun 09 22:13:12 2005 +0000
    41.2 +++ b/xen/include/asm-x86/vmx.h	Fri Jun 10 15:42:20 2005 +0000
    41.3 @@ -41,11 +41,36 @@ extern unsigned int cpu_rev;
    41.4   * Need fill bits for SENTER
    41.5   */
    41.6  
    41.7 -#define MONITOR_PIN_BASED_EXEC_CONTROLS         0x0000001f      
    41.8 -#define MONITOR_CPU_BASED_EXEC_CONTROLS         0x0581e7f2
    41.9 -#define MONITOR_VM_EXIT_CONTROLS                0x0003edff
   41.10 -#define MONITOR_VM_ENTRY_CONTROLS               0x000011ff
   41.11 +#define MONITOR_PIN_BASED_EXEC_CONTROLS_RESERVED_VALUE         0x00000016
   41.12 +
   41.13 +#define MONITOR_PIN_BASED_EXEC_CONTROLS       \
   41.14 +    MONITOR_PIN_BASED_EXEC_CONTROLS_RESERVED_VALUE |   \
   41.15 +    PIN_BASED_EXT_INTR_MASK |   \
   41.16 +    PIN_BASED_NMI_EXITING
   41.17 +
   41.18 +#define MONITOR_CPU_BASED_EXEC_CONTROLS_RESERVED_VALUE         0x0401e172
   41.19  
   41.20 +#define MONITOR_CPU_BASED_EXEC_CONTROLS \
   41.21 +    MONITOR_CPU_BASED_EXEC_CONTROLS_RESERVED_VALUE |    \
   41.22 +    CPU_BASED_HLT_EXITING | \
   41.23 +    CPU_BASED_INVDPG_EXITING | \
   41.24 +    CPU_BASED_MWAIT_EXITING | \
   41.25 +    CPU_BASED_MOV_DR_EXITING | \
   41.26 +    CPU_BASED_UNCOND_IO_EXITING | \
   41.27 +    CPU_BASED_CR8_LOAD_EXITING | \
   41.28 +    CPU_BASED_CR8_STORE_EXITING
   41.29 +
   41.30 +#define MONITOR_VM_EXIT_CONTROLS_RESERVED_VALUE                0x0003edff
   41.31 +
   41.32 +#define VM_EXIT_CONTROLS_IA_32E_MODE		0x00000200
   41.33 +
   41.34 +#define MONITOR_VM_EXIT_CONTROLS                \
   41.35 +    MONITOR_VM_EXIT_CONTROLS_RESERVED_VALUE |\
   41.36 +    VM_EXIT_ACK_INTR_ON_EXIT
   41.37 +
   41.38 +#define VM_ENTRY_CONTROLS_RESERVED_VALUE        0x000011ff
   41.39 +#define VM_ENTRY_CONTROLS_IA_32E_MODE           0x00000200
   41.40 +#define MONITOR_VM_ENTRY_CONTROLS       VM_ENTRY_CONTROLS_RESERVED_VALUE 
   41.41  /*
   41.42   * Exit Reasons
   41.43   */
   41.44 @@ -91,7 +116,8 @@ extern unsigned int cpu_rev;
   41.45  #define TYPE_MOV_FROM_CR                (1 << 4)
   41.46  #define TYPE_CLTS                       (2 << 4)
   41.47  #define	TYPE_LMSW			(3 << 4)
   41.48 -#define CONTROL_REG_ACCESS_REG          0x700   /* 10:8, general purpose register */
   41.49 +#define CONTROL_REG_ACCESS_REG          0xf00   /* 10:8, general purpose register */
   41.50 +#define	LMSW_SOURCE_DATA		(0xFFFF << 16) /* 16:31 lmsw source */
   41.51  #define REG_EAX                         (0 << 8) 
   41.52  #define REG_ECX                         (1 << 8) 
   41.53  #define REG_EDX                         (2 << 8) 
   41.54 @@ -100,7 +126,14 @@ extern unsigned int cpu_rev;
   41.55  #define REG_EBP                         (5 << 8) 
   41.56  #define REG_ESI                         (6 << 8) 
   41.57  #define REG_EDI                         (7 << 8) 
   41.58 -#define	LMSW_SOURCE_DATA		(0xFFFF << 16) /* 16:31 lmsw source */
   41.59 +#define REG_R8                         (8 << 8)
   41.60 +#define REG_R9                         (9 << 8)
   41.61 +#define REG_R10                        (10 << 8)
   41.62 +#define REG_R11                        (11 << 8)
   41.63 +#define REG_R12                        (12 << 8)
   41.64 +#define REG_R13                        (13 << 8)
   41.65 +#define REG_R14                        (14 << 8)
   41.66 +#define REG_R15                        (15 << 8)
   41.67  
   41.68  /*
   41.69   * Exit Qualifications for MOV for Debug Register Access
   41.70 @@ -109,7 +142,7 @@ extern unsigned int cpu_rev;
   41.71  #define DEBUG_REG_ACCESS_TYPE           0x10    /* 4, direction of access */
   41.72  #define TYPE_MOV_TO_DR                  (0 << 4) 
   41.73  #define TYPE_MOV_FROM_DR                (1 << 4)
   41.74 -#define DEBUG_REG_ACCESS_REG            0x700   /* 11:8, general purpose register */
   41.75 +#define DEBUG_REG_ACCESS_REG            0xf00   /* 11:8, general purpose register */
   41.76   
   41.77  #define EXCEPTION_BITMAP_DE     (1 << 0)        /* Divide Error */
   41.78  #define EXCEPTION_BITMAP_DB     (1 << 1)        /* Debug */
    42.1 --- a/xen/include/asm-x86/vmx_vmcs.h	Thu Jun 09 22:13:12 2005 +0000
    42.2 +++ b/xen/include/asm-x86/vmx_vmcs.h	Fri Jun 10 15:42:20 2005 +0000
    42.3 @@ -29,11 +29,36 @@ extern void stop_vmx(void);
    42.4  
    42.5  void vmx_enter_scheduler(void);
    42.6  
    42.7 -#define	VMX_CPU_STATE_ASSIST_ENABLED	1
    42.8 +enum {
    42.9 +    VMX_CPU_STATE_PG_ENABLED=0,
   42.10 +    VMX_CPU_STATE_PAE_ENABLED,
   42.11 +    VMX_CPU_STATE_LME_ENABLED,
   42.12 +    VMX_CPU_STATE_LMA_ENABLED,
   42.13 +    VMX_CPU_STATE_ASSIST_ENABLED,
   42.14 +};
   42.15 +
   42.16 +#define VMX_LONG_GUEST(ed)    \
   42.17 +  (test_bit(VMX_CPU_STATE_LMA_ENABLED, &ed->arch.arch_vmx.cpu_state))
   42.18  
   42.19  struct vmcs_struct {
   42.20      u32 vmcs_revision_id;
   42.21 -    unsigned char data [0x1000 - sizeof (u32)];
   42.22 +    unsigned char data [0]; /* vmcs size is read from MSR */
   42.23 +};
   42.24 +
   42.25 +enum { 
   42.26 +    VMX_INDEX_MSR_LSTAR = 0,
   42.27 +    VMX_INDEX_MSR_STAR,
   42.28 +    VMX_INDEX_MSR_CSTAR,
   42.29 +    VMX_INDEX_MSR_SYSCALL_MASK,
   42.30 +    VMX_INDEX_MSR_EFER,
   42.31 +
   42.32 +    VMX_MSR_COUNT,
   42.33 +};
   42.34 +
   42.35 +struct msr_state{
   42.36 +    unsigned long flags;
   42.37 +    unsigned long msr_items[VMX_MSR_COUNT];
   42.38 +    unsigned long shadow_gs;
   42.39  };
   42.40  
   42.41  struct arch_vmx_struct {
   42.42 @@ -42,6 +67,7 @@ struct arch_vmx_struct {
   42.43      unsigned long           cpu_cr2; /* save CR2 */
   42.44      unsigned long           cpu_cr3;
   42.45      unsigned long           cpu_state;
   42.46 +    struct msr_state        msr_content;
   42.47      struct virutal_platform_def     vmx_platform; 
   42.48  };
   42.49  
   42.50 @@ -69,11 +95,34 @@ int  construct_vmcs(struct arch_vmx_stru
   42.51  #define VMCS_USE_HOST_ENV       1
   42.52  #define VMCS_USE_SEPARATE_ENV   0
   42.53  
   42.54 +/* this works for both 32bit & 64bit eflags filteration done in construct_init_vmcs_guest() */
   42.55  #define VMCS_EFLAGS_RESERVED_0          0xffc08028 /* bitmap for 0 */
   42.56  #define VMCS_EFLAGS_RESERVED_1          0x00000002 /* bitmap for 1 */
   42.57  
   42.58  extern int vmcs_version;
   42.59  
   42.60 +#define CPU_BASED_VIRTUAL_INTR_PENDING  0x00000004
   42.61 +#define CPU_BASED_USE_TSC_OFFSETING     0x00000008
   42.62 +#define CPU_BASED_HLT_EXITING           0x00000080
   42.63 +#define CPU_BASED_INVDPG_EXITING        0x00000200
   42.64 +#define CPU_BASED_MWAIT_EXITING         0x00000400
   42.65 +#define CPU_BASED_RDPMC_EXITING         0x00000800
   42.66 +#define CPU_BASED_RDTSC_EXITING         0x00001000
   42.67 +#define CPU_BASED_CR8_LOAD_EXITING      0x00080000
   42.68 +#define CPU_BASED_CR8_STORE_EXITING     0x00100000
   42.69 +#define CPU_BASED_TPR_SHADOW            0x00200000
   42.70 +#define CPU_BASED_MOV_DR_EXITING        0x00800000
   42.71 +#define CPU_BASED_UNCOND_IO_EXITING     0x01000000
   42.72 +#define CPU_BASED_ACTIVATE_IO_BITMAP    0x02000000
   42.73 +#define CPU_BASED_MONITOR_EXITING       0x20000000
   42.74 +#define CPU_BASED_PAUSE_EXITING         0x40000000
   42.75 +#define PIN_BASED_EXT_INTR_MASK 0x1
   42.76 +#define PIN_BASED_NMI_EXITING   0x8
   42.77 +
   42.78 +#define VM_EXIT_ACK_INTR_ON_EXIT        0x00008000
   42.79 +#define VM_EXIT_HOST_ADD_SPACE_SIZE     0x00000200
   42.80 +
   42.81 +
   42.82  /* VMCS Encordings */
   42.83  enum vmcs_field {
   42.84      GUEST_ES_SELECTOR               = 0x00000800,
   42.85 @@ -92,14 +141,23 @@ enum vmcs_field {
   42.86      HOST_GS_SELECTOR                = 0x00000c0a,
   42.87      HOST_TR_SELECTOR                = 0x00000c0c,
   42.88      IO_BITMAP_A                     = 0x00002000, 
   42.89 +    IO_BITMAP_A_HIGH                = 0x00002001, 
   42.90      IO_BITMAP_B                     = 0x00002002, 
   42.91 +    IO_BITMAP_B_HIGH                = 0x00002003, 
   42.92      VM_EXIT_MSR_STORE_ADDR          = 0x00002006,
   42.93 +    VM_EXIT_MSR_STORE_ADDR_HIGH     = 0x00002007,
   42.94      VM_EXIT_MSR_LOAD_ADDR           = 0x00002008,
   42.95 +    VM_EXIT_MSR_LOAD_ADDR_HIGH      = 0x00002009,
   42.96      VM_ENTRY_MSR_LOAD_ADDR          = 0x0000200a,
   42.97 +    VM_ENTRY_MSR_LOAD_ADDR_HIGH     = 0x0000200b,
   42.98      TSC_OFFSET                      = 0x00002010,
   42.99 -    GUEST_VMCS0                     = 0x00002800,
  42.100 -    GUEST_VMCS1                     = 0x00002801,
  42.101 +    TSC_OFFSET_HIGH                 = 0x00002011,
  42.102 +    VIRTUAL_APIC_PAGE_ADDR          = 0x00002012,
  42.103 +    VIRTUAL_APIC_PAGE_ADDR_HIGH     = 0x00002013,
  42.104 +    VMCS_LINK_POINTER               = 0x00002800,
  42.105 +    VMCS_LINK_POINTER_HIGH          = 0x00002801,
  42.106      GUEST_IA32_DEBUGCTL             = 0x00002802,
  42.107 +    GUEST_IA32_DEBUGCTL_HIGH        = 0x00002803,
  42.108      PIN_BASED_VM_EXEC_CONTROL       = 0x00004000,
  42.109      CPU_BASED_VM_EXEC_CONTROL       = 0x00004002,   
  42.110      EXCEPTION_BITMAP                = 0x00004004,
  42.111 @@ -113,12 +171,17 @@ enum vmcs_field {
  42.112      VM_ENTRY_MSR_LOAD_COUNT         = 0x00004014,
  42.113      VM_ENTRY_INTR_INFO_FIELD        = 0x00004016,
  42.114      VM_ENTRY_EXCEPTION_ERROR_CODE   = 0x00004018,
  42.115 +    VM_ENTRY_INSTRUCTION_LENGTH     = 0x0000401a,
  42.116 +    TPR_THRESHOLD                   = 0x0000401c,
  42.117 +    SECONDARY_VM_EXEC_CONTROL       = 0x0000401e,
  42.118 +    VM_INSTRUCTION_ERROR            = 0x00004400,
  42.119      VM_EXIT_REASON                  = 0x00004402,
  42.120      VM_EXIT_INTR_INFO               = 0x00004404,   
  42.121      VM_EXIT_INTR_ERROR_CODE         = 0x00004406,
  42.122      IDT_VECTORING_INFO_FIELD        = 0x00004408,
  42.123      IDT_VECTORING_ERROR_CODE        = 0x0000440a,
  42.124      INSTRUCTION_LEN                 = 0x0000440c,
  42.125 +    VMX_INSTRUCTION_INFO            = 0x0000440e,
  42.126      GUEST_ES_LIMIT                  = 0x00004800,
  42.127      GUEST_CS_LIMIT                  = 0x00004802,
  42.128      GUEST_SS_LIMIT                  = 0x00004804,
  42.129 @@ -138,14 +201,18 @@ enum vmcs_field {
  42.130      GUEST_LDTR_AR_BYTES             = 0x00004820,
  42.131      GUEST_TR_AR_BYTES               = 0x00004822,
  42.132      GUEST_INTERRUPTIBILITY_INFO     = 0x00004824,
  42.133 +    GUEST_SYSENTER_CS               = 0x0000482A,
  42.134 +    HOST_IA32_SYSENTER_CS           = 0x00004c00,
  42.135      CR0_GUEST_HOST_MASK             = 0x00006000,
  42.136      CR4_GUEST_HOST_MASK             = 0x00006002,
  42.137      CR0_READ_SHADOW                 = 0x00006004,
  42.138      CR4_READ_SHADOW                 = 0x00006006,
  42.139 -    CR3_TARGET_VALUES               = 0x00006008, 
  42.140 -    CR3_GUEST_HOST_MASK             = 0x00006208,
  42.141 +    CR3_TARGET_VALUE0               = 0x00006008, 
  42.142 +    CR3_TARGET_VALUE1               = 0x0000600a, 
  42.143 +    CR3_TARGET_VALUE2               = 0x0000600c, 
  42.144 +    CR3_TARGET_VALUE3               = 0x0000600e, 
  42.145      EXIT_QUALIFICATION              = 0x00006400,
  42.146 -    GUEST_LINEAR_ADDRESS	    = 0x0000640A,
  42.147 +    GUEST_LINEAR_ADDRESS            = 0x0000640a,
  42.148      GUEST_CR0                       = 0x00006800,
  42.149      GUEST_CR3                       = 0x00006802,
  42.150      GUEST_CR4                       = 0x00006804,
  42.151 @@ -160,10 +227,12 @@ enum vmcs_field {
  42.152      GUEST_GDTR_BASE                 = 0x00006816,    
  42.153      GUEST_IDTR_BASE                 = 0x00006818,
  42.154      GUEST_DR7                       = 0x0000681a,
  42.155 -    GUEST_ESP                       = 0x0000681c,
  42.156 -    GUEST_EIP                       = 0x0000681e,
  42.157 -    GUEST_EFLAGS                    = 0x00006820,
  42.158 +    GUEST_RSP                       = 0x0000681c,
  42.159 +    GUEST_RIP                       = 0x0000681e,
  42.160 +    GUEST_RFLAGS                    = 0x00006820,
  42.161      GUEST_PENDING_DBG_EXCEPTIONS    = 0x00006822,
  42.162 +    GUEST_SYSENTER_ESP              = 0x00006824,
  42.163 +    GUEST_SYSENTER_EIP              = 0x00006826,
  42.164      HOST_CR0                        = 0x00006c00,
  42.165      HOST_CR3                        = 0x00006c02,
  42.166      HOST_CR4                        = 0x00006c04,
  42.167 @@ -172,8 +241,10 @@ enum vmcs_field {
  42.168      HOST_TR_BASE                    = 0x00006c0a,
  42.169      HOST_GDTR_BASE                  = 0x00006c0c,
  42.170      HOST_IDTR_BASE                  = 0x00006c0e,
  42.171 -    HOST_ESP                        = 0x00006c14,
  42.172 -    HOST_EIP                        = 0x00006c16,
  42.173 +    HOST_IA32_SYSENTER_ESP          = 0x00006c10,
  42.174 +    HOST_IA32_SYSENTER_EIP          = 0x00006c12,
  42.175 +    HOST_RSP                        = 0x00006c14,
  42.176 +    HOST_RIP                        = 0x00006c16,
  42.177  };
  42.178  
  42.179  #define VMX_DEBUG 1
    43.1 --- a/xen/include/asm-x86/x86_32/asm_defns.h	Thu Jun 09 22:13:12 2005 +0000
    43.2 +++ b/xen/include/asm-x86/x86_32/asm_defns.h	Fri Jun 10 15:42:20 2005 +0000
    43.3 @@ -19,10 +19,10 @@
    43.4          "jmp 3f;"                                                       \
    43.5          "2:testb $3,"STR(UREGS_cs)"(%esp);"                             \
    43.6          "jz 1f;"                                                        \
    43.7 -        "movl %ds,"STR(UREGS_ds)"(%esp);"                               \
    43.8 -        "movl %es,"STR(UREGS_es)"(%esp);"                               \
    43.9 -        "movl %fs,"STR(UREGS_fs)"(%esp);"                               \
   43.10 -        "movl %gs,"STR(UREGS_gs)"(%esp);"                               \
   43.11 +        "mov %ds,"STR(UREGS_ds)"(%esp);"                                \
   43.12 +        "mov %es,"STR(UREGS_es)"(%esp);"                                \
   43.13 +        "mov %fs,"STR(UREGS_fs)"(%esp);"                                \
   43.14 +        "mov %gs,"STR(UREGS_gs)"(%esp);"                                \
   43.15          "3:"
   43.16  
   43.17  #define SAVE_ALL_NOSEGREGS(_reg)                \
   43.18 @@ -31,8 +31,8 @@
   43.19  
   43.20  #define SET_XEN_SEGMENTS(_reg)                                  \
   43.21          "movl $("STR(__HYPERVISOR_DS)"),%e"STR(_reg)"x;"        \
   43.22 -        "movl %e"STR(_reg)"x,%ds;"                              \
   43.23 -        "movl %e"STR(_reg)"x,%es;"
   43.24 +        "mov %e"STR(_reg)"x,%ds;"                              \
   43.25 +        "mov %e"STR(_reg)"x,%es;"
   43.26  
   43.27  #define SAVE_ALL(_reg)                          \
   43.28          __SAVE_ALL_PRE                          \
   43.29 @@ -56,10 +56,10 @@
   43.30          jmp 3f;                                         \
   43.31          2:testb $3,UREGS_cs(%esp);                      \
   43.32          jz 1f;                                          \
   43.33 -        movl %ds,UREGS_ds(%esp);                        \
   43.34 -        movl %es,UREGS_es(%esp);                        \
   43.35 -        movl %fs,UREGS_fs(%esp);                        \
   43.36 -        movl %gs,UREGS_gs(%esp);                        \
   43.37 +        mov %ds,UREGS_ds(%esp);                         \
   43.38 +        mov %es,UREGS_es(%esp);                         \
   43.39 +        mov %fs,UREGS_fs(%esp);                         \
   43.40 +        mov %gs,UREGS_gs(%esp);                         \
   43.41          3:
   43.42  
   43.43  #define SAVE_ALL_NOSEGREGS(_reg)                \
   43.44 @@ -68,8 +68,8 @@
   43.45  
   43.46  #define SET_XEN_SEGMENTS(_reg)                          \
   43.47          movl $(__HYPERVISOR_DS),%e ## _reg ## x;        \
   43.48 -        movl %e ## _reg ## x,%ds;                       \
   43.49 -        movl %e ## _reg ## x,%es;
   43.50 +        mov %e ## _reg ## x,%ds;                        \
   43.51 +        mov %e ## _reg ## x,%es;
   43.52  
   43.53  #define SAVE_ALL(_reg)                          \
   43.54          __SAVE_ALL_PRE                          \
    44.1 --- a/xen/include/public/arch-x86_64.h	Thu Jun 09 22:13:12 2005 +0000
    44.2 +++ b/xen/include/public/arch-x86_64.h	Fri Jun 10 15:42:20 2005 +0000
    44.3 @@ -153,16 +153,16 @@ typedef struct cpu_user_regs {
    44.4      u32 error_code;    /* private */
    44.5      u32 entry_vector;  /* private */
    44.6      union { u64 rip, eip; };
    44.7 -    u16 cs;
    44.8 +    u16 cs, _pad0[1];
    44.9      u8  saved_upcall_mask;
   44.10 -    u8  _pad0[5];
   44.11 +    u8  _pad1[3];
   44.12      union { u64 rflags, eflags; };
   44.13      union { u64 rsp, esp; };
   44.14 -    u16 ss, _pad1[3];
   44.15 -    u16 es, _pad2[3];
   44.16 -    u16 ds, _pad3[3];
   44.17 -    u16 fs, _pad4[3]; /* Non-zero => takes precedence over fs_base.      */
   44.18 -    u16 gs, _pad5[3]; /* Non-zero => takes precedence over gs_base_user. */
   44.19 +    u16 ss, _pad2[3];
   44.20 +    u16 es, _pad3[3];
   44.21 +    u16 ds, _pad4[3];
   44.22 +    u16 fs, _pad5[3]; /* Non-zero => takes precedence over fs_base.      */
   44.23 +    u16 gs, _pad6[3]; /* Non-zero => takes precedence over gs_base_user. */
   44.24  } cpu_user_regs_t;
   44.25  
   44.26  typedef u64 tsc_timestamp_t; /* RDTSC timestamp */