Skip to contentSkip to conversation

Enable vmxassist for 64 bit.

PATCH New Arun Sharma 1 participant 1 message Jun 30, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 6/10 Enable vmxassist for 64 bit.

Enable vmxassist for 64 bit.

xen/include/public/vmx_assist.h +34 -34
diff -r 18df82c3dcc7 -r 3c25261fef1c xen/include/public/vmx_assist.h
@@ -51,47 +51,47 @@
  * World switch state
  */
 typedef struct vmx_assist_context {
-	unsigned long		eip;		/* execution pointer */
-	unsigned long		esp;		/* stack point */
-	unsigned long		eflags;		/* flags register */
-	unsigned long		cr0;
-	unsigned long		cr3;		/* page table directory */
-	unsigned long		cr4;
-	unsigned long		idtr_limit;	/* idt */
-	unsigned long		idtr_base;
-	unsigned long		gdtr_limit;	/* gdt */
-	unsigned long		gdtr_base;
-	unsigned long		cs_sel;		/* cs selector */
-	unsigned long		cs_limit;
-	unsigned long		cs_base;
+	u32		eip;		/* execution pointer */
+	u32		esp;		/* stack point */
+	u32		eflags;		/* flags register */
+	u32		cr0;
+	u32		cr3;		/* page table directory */
+	u32		cr4;
+	u32		idtr_limit;	/* idt */
+	u32		idtr_base;
+	u32		gdtr_limit;	/* gdt */
+	u32		gdtr_base;
+	u32		cs_sel;		/* cs selector */
+	u32		cs_limit;
+	u32		cs_base;
 	union vmcs_arbytes	cs_arbytes;
-	unsigned long		ds_sel;		/* ds selector */
-	unsigned long		ds_limit;
-	unsigned long		ds_base;
+	u32		ds_sel;		/* ds selector */
+	u32		ds_limit;
+	u32		ds_base;
 	union vmcs_arbytes	ds_arbytes;
-	unsigned long		es_sel;		/* es selector */
-	unsigned long		es_limit;
-	unsigned long		es_base;
+	u32		es_sel;		/* es selector */
+	u32		es_limit;
+	u32		es_base;
 	union vmcs_arbytes	es_arbytes;
-	unsigned long		ss_sel;		/* ss selector */
-	unsigned long		ss_limit;
-	unsigned long		ss_base;
+	u32		ss_sel;		/* ss selector */
+	u32		ss_limit;
+	u32		ss_base;
 	union vmcs_arbytes	ss_arbytes;
-	unsigned long		fs_sel;		/* fs selector */
-	unsigned long		fs_limit;
-	unsigned long		fs_base;
+	u32		fs_sel;		/* fs selector */
+	u32		fs_limit;
+	u32		fs_base;
 	union vmcs_arbytes	fs_arbytes;
-	unsigned long		gs_sel;		/* gs selector */
-	unsigned long		gs_limit;
-	unsigned long		gs_base;
+	u32		gs_sel;		/* gs selector */
+	u32		gs_limit;
+	u32		gs_base;
 	union vmcs_arbytes	gs_arbytes;
-	unsigned long		tr_sel;		/* task selector */
-	unsigned long		tr_limit;
-	unsigned long		tr_base;
+	u32		tr_sel;		/* task selector */
+	u32		tr_limit;
+	u32		tr_base;
 	union vmcs_arbytes	tr_arbytes;
-	unsigned long		ldtr_sel;	/* ldtr selector */
-	unsigned long		ldtr_limit;
-	unsigned long		ldtr_base;
+	u32		ldtr_sel;	/* ldtr selector */
+	u32		ldtr_limit;
+	u32		ldtr_base;
 	union vmcs_arbytes	ldtr_arbytes;
 } vmx_assist_context_t;
 
xen/arch/x86/vmx.c +6 -5
diff -r 18df82c3dcc7 -r 3c25261fef1c xen/arch/x86/vmx.c
@@ -581,7 +581,7 @@
 	 */
 	mfn = phys_to_machine_mapping(c->cr3 >> PAGE_SHIFT);
 	if (mfn != pagetable_get_pfn(d->arch.guest_table)) {
-	    printk("Invalid CR3 value=%lx", c->cr3);
+	    printk("Invalid CR3 value=%x", c->cr3);
 	    domain_crash_synchronous();
 	    return 0;
 	}
@@ -591,9 +591,9 @@
 	 * If different, make a shadow. Check if the PDBR is valid
 	 * first.
 	 */
-	VMX_DBG_LOG(DBG_LEVEL_VMMU, "CR3 c->cr3 = %lx", c->cr3);
+	VMX_DBG_LOG(DBG_LEVEL_VMMU, "CR3 c->cr3 = %x", c->cr3);
 	if ((c->cr3 >> PAGE_SHIFT) > d->domain->max_pages) {
-	    printk("Invalid CR3 value=%lx", c->cr3);
+	    printk("Invalid CR3 value=%x", c->cr3);
 	    domain_crash_synchronous(); 
 	    return 0;
 	}
@@ -604,7 +604,7 @@
 	 * arch.shadow_table should now hold the next CR3 for shadow
 	 */
 	d->arch.arch_vmx.cpu_cr3 = c->cr3;
-	VMX_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %lx", c->cr3);
+	VMX_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %x", c->cr3);
 	__vmwrite(GUEST_CR3, pagetable_get_paddr(d->arch.shadow_table));
     }
 
@@ -669,7 +669,8 @@
 vmx_assist(struct vcpu *d, int mode)
 {
     struct vmx_assist_context c;
-    unsigned long magic, cp;
+    u32 magic;
+    unsigned long cp;
 
     /* make sure vmxassist exists (this is not an error) */
     if (!vmx_copy(&magic, VMXASSIST_MAGIC_OFFSET, sizeof(magic), COPY_IN))
tools/firmware/vmxassist/util.c +1 -1
diff -r 18df82c3dcc7 -r 3c25261fef1c tools/firmware/vmxassist/util.c
@@ -18,7 +18,7 @@
  * Place - Suite 330, Boston, MA 02111-1307 USA.
  */
 #include <stdarg.h>
-#include <public/vmx_assist.h>
+#include <vm86.h>
 
 #include "util.h"
 #include "machine.h"
tools/firmware/vmxassist/gen.c +1 -1
diff -r 18df82c3dcc7 -r 3c25261fef1c tools/firmware/vmxassist/gen.c
@@ -20,7 +20,7 @@
 #include <stdio.h>
 #include <stddef.h>
 #include <stdlib.h>
-#include <public/vmx_assist.h>
+#include <vm86.h>
 
 int
 main()
tools/firmware/vmxassist/vm86.h +13 -0
diff -r 18df82c3dcc7 -r 3c25261fef1c tools/firmware/vmxassist/vm86.h
@@ -19,6 +19,19 @@
  */
 #ifndef __VM86_H__
 #define __VM86_H__
+
+#ifndef __ASSEMBLY__
+#include <stdint.h>
+
+typedef uint8_t            u8;
+typedef uint16_t           u16;
+typedef uint32_t           u32;
+typedef uint64_t           u64;
+typedef int8_t             s8;
+typedef int16_t            s16;
+typedef int32_t            s32;
+typedef int64_t            s64;
+#endif
 
 #include <public/vmx_assist.h>