ia64/xen-unstable

changeset 5613:332eb7887996

bitkeeper revision 1.1778 (42c3a89fKOC3ZLo9T-f0b9tyflqDzg)

[PATCH] Enable vmxassist for 64 bit.

Enable vmxassist for 64 bit.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
author arun.sharma@intel.com[kaf24]
date Thu Jun 30 08:09:03 2005 +0000 (2005-06-30)
parents 7c198f2e6dd2
children bc8bb3a26ccc
files tools/firmware/vmxassist/gen.c tools/firmware/vmxassist/util.c tools/firmware/vmxassist/vm86.h xen/arch/x86/vmx.c xen/include/public/vmx_assist.h
line diff
     1.1 --- a/tools/firmware/vmxassist/gen.c	Thu Jun 30 08:08:42 2005 +0000
     1.2 +++ b/tools/firmware/vmxassist/gen.c	Thu Jun 30 08:09:03 2005 +0000
     1.3 @@ -20,7 +20,7 @@
     1.4  #include <stdio.h>
     1.5  #include <stddef.h>
     1.6  #include <stdlib.h>
     1.7 -#include <public/vmx_assist.h>
     1.8 +#include <vm86.h>
     1.9  
    1.10  int
    1.11  main()
     2.1 --- a/tools/firmware/vmxassist/util.c	Thu Jun 30 08:08:42 2005 +0000
     2.2 +++ b/tools/firmware/vmxassist/util.c	Thu Jun 30 08:09:03 2005 +0000
     2.3 @@ -18,7 +18,7 @@
     2.4   * Place - Suite 330, Boston, MA 02111-1307 USA.
     2.5   */
     2.6  #include <stdarg.h>
     2.7 -#include <public/vmx_assist.h>
     2.8 +#include <vm86.h>
     2.9  
    2.10  #include "util.h"
    2.11  #include "machine.h"
     3.1 --- a/tools/firmware/vmxassist/vm86.h	Thu Jun 30 08:08:42 2005 +0000
     3.2 +++ b/tools/firmware/vmxassist/vm86.h	Thu Jun 30 08:09:03 2005 +0000
     3.3 @@ -20,6 +20,19 @@
     3.4  #ifndef __VM86_H__
     3.5  #define __VM86_H__
     3.6  
     3.7 +#ifndef __ASSEMBLY__
     3.8 +#include <stdint.h>
     3.9 +
    3.10 +typedef uint8_t            u8;
    3.11 +typedef uint16_t           u16;
    3.12 +typedef uint32_t           u32;
    3.13 +typedef uint64_t           u64;
    3.14 +typedef int8_t             s8;
    3.15 +typedef int16_t            s16;
    3.16 +typedef int32_t            s32;
    3.17 +typedef int64_t            s64;
    3.18 +#endif
    3.19 +
    3.20  #include <public/vmx_assist.h>
    3.21  
    3.22  #define	NR_EXCEPTION_HANDLER	32
     4.1 --- a/xen/arch/x86/vmx.c	Thu Jun 30 08:08:42 2005 +0000
     4.2 +++ b/xen/arch/x86/vmx.c	Thu Jun 30 08:09:03 2005 +0000
     4.3 @@ -581,7 +581,7 @@ vmx_world_restore(struct vcpu *d, struct
     4.4  	 */
     4.5  	mfn = phys_to_machine_mapping(c->cr3 >> PAGE_SHIFT);
     4.6  	if (mfn != pagetable_get_pfn(d->arch.guest_table)) {
     4.7 -	    printk("Invalid CR3 value=%lx", c->cr3);
     4.8 +	    printk("Invalid CR3 value=%x", c->cr3);
     4.9  	    domain_crash_synchronous();
    4.10  	    return 0;
    4.11  	}
    4.12 @@ -591,9 +591,9 @@ vmx_world_restore(struct vcpu *d, struct
    4.13  	 * If different, make a shadow. Check if the PDBR is valid
    4.14  	 * first.
    4.15  	 */
    4.16 -	VMX_DBG_LOG(DBG_LEVEL_VMMU, "CR3 c->cr3 = %lx", c->cr3);
    4.17 +	VMX_DBG_LOG(DBG_LEVEL_VMMU, "CR3 c->cr3 = %x", c->cr3);
    4.18  	if ((c->cr3 >> PAGE_SHIFT) > d->domain->max_pages) {
    4.19 -	    printk("Invalid CR3 value=%lx", c->cr3);
    4.20 +	    printk("Invalid CR3 value=%x", c->cr3);
    4.21  	    domain_crash_synchronous(); 
    4.22  	    return 0;
    4.23  	}
    4.24 @@ -604,7 +604,7 @@ vmx_world_restore(struct vcpu *d, struct
    4.25  	 * arch.shadow_table should now hold the next CR3 for shadow
    4.26  	 */
    4.27  	d->arch.arch_vmx.cpu_cr3 = c->cr3;
    4.28 -	VMX_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %lx", c->cr3);
    4.29 +	VMX_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %x", c->cr3);
    4.30  	__vmwrite(GUEST_CR3, pagetable_get_paddr(d->arch.shadow_table));
    4.31      }
    4.32  
    4.33 @@ -669,7 +669,8 @@ int
    4.34  vmx_assist(struct vcpu *d, int mode)
    4.35  {
    4.36      struct vmx_assist_context c;
    4.37 -    unsigned long magic, cp;
    4.38 +    u32 magic;
    4.39 +    unsigned long cp;
    4.40  
    4.41      /* make sure vmxassist exists (this is not an error) */
    4.42      if (!vmx_copy(&magic, VMXASSIST_MAGIC_OFFSET, sizeof(magic), COPY_IN))
     5.1 --- a/xen/include/public/vmx_assist.h	Thu Jun 30 08:08:42 2005 +0000
     5.2 +++ b/xen/include/public/vmx_assist.h	Thu Jun 30 08:09:03 2005 +0000
     5.3 @@ -51,47 +51,47 @@ union vmcs_arbytes {
     5.4   * World switch state
     5.5   */
     5.6  typedef struct vmx_assist_context {
     5.7 -	unsigned long		eip;		/* execution pointer */
     5.8 -	unsigned long		esp;		/* stack point */
     5.9 -	unsigned long		eflags;		/* flags register */
    5.10 -	unsigned long		cr0;
    5.11 -	unsigned long		cr3;		/* page table directory */
    5.12 -	unsigned long		cr4;
    5.13 -	unsigned long		idtr_limit;	/* idt */
    5.14 -	unsigned long		idtr_base;
    5.15 -	unsigned long		gdtr_limit;	/* gdt */
    5.16 -	unsigned long		gdtr_base;
    5.17 -	unsigned long		cs_sel;		/* cs selector */
    5.18 -	unsigned long		cs_limit;
    5.19 -	unsigned long		cs_base;
    5.20 +	u32		eip;		/* execution pointer */
    5.21 +	u32		esp;		/* stack point */
    5.22 +	u32		eflags;		/* flags register */
    5.23 +	u32		cr0;
    5.24 +	u32		cr3;		/* page table directory */
    5.25 +	u32		cr4;
    5.26 +	u32		idtr_limit;	/* idt */
    5.27 +	u32		idtr_base;
    5.28 +	u32		gdtr_limit;	/* gdt */
    5.29 +	u32		gdtr_base;
    5.30 +	u32		cs_sel;		/* cs selector */
    5.31 +	u32		cs_limit;
    5.32 +	u32		cs_base;
    5.33  	union vmcs_arbytes	cs_arbytes;
    5.34 -	unsigned long		ds_sel;		/* ds selector */
    5.35 -	unsigned long		ds_limit;
    5.36 -	unsigned long		ds_base;
    5.37 +	u32		ds_sel;		/* ds selector */
    5.38 +	u32		ds_limit;
    5.39 +	u32		ds_base;
    5.40  	union vmcs_arbytes	ds_arbytes;
    5.41 -	unsigned long		es_sel;		/* es selector */
    5.42 -	unsigned long		es_limit;
    5.43 -	unsigned long		es_base;
    5.44 +	u32		es_sel;		/* es selector */
    5.45 +	u32		es_limit;
    5.46 +	u32		es_base;
    5.47  	union vmcs_arbytes	es_arbytes;
    5.48 -	unsigned long		ss_sel;		/* ss selector */
    5.49 -	unsigned long		ss_limit;
    5.50 -	unsigned long		ss_base;
    5.51 +	u32		ss_sel;		/* ss selector */
    5.52 +	u32		ss_limit;
    5.53 +	u32		ss_base;
    5.54  	union vmcs_arbytes	ss_arbytes;
    5.55 -	unsigned long		fs_sel;		/* fs selector */
    5.56 -	unsigned long		fs_limit;
    5.57 -	unsigned long		fs_base;
    5.58 +	u32		fs_sel;		/* fs selector */
    5.59 +	u32		fs_limit;
    5.60 +	u32		fs_base;
    5.61  	union vmcs_arbytes	fs_arbytes;
    5.62 -	unsigned long		gs_sel;		/* gs selector */
    5.63 -	unsigned long		gs_limit;
    5.64 -	unsigned long		gs_base;
    5.65 +	u32		gs_sel;		/* gs selector */
    5.66 +	u32		gs_limit;
    5.67 +	u32		gs_base;
    5.68  	union vmcs_arbytes	gs_arbytes;
    5.69 -	unsigned long		tr_sel;		/* task selector */
    5.70 -	unsigned long		tr_limit;
    5.71 -	unsigned long		tr_base;
    5.72 +	u32		tr_sel;		/* task selector */
    5.73 +	u32		tr_limit;
    5.74 +	u32		tr_base;
    5.75  	union vmcs_arbytes	tr_arbytes;
    5.76 -	unsigned long		ldtr_sel;	/* ldtr selector */
    5.77 -	unsigned long		ldtr_limit;
    5.78 -	unsigned long		ldtr_base;
    5.79 +	u32		ldtr_sel;	/* ldtr selector */
    5.80 +	u32		ldtr_limit;
    5.81 +	u32		ldtr_base;
    5.82  	union vmcs_arbytes	ldtr_arbytes;
    5.83  } vmx_assist_context_t;
    5.84