WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH][6/10] Enable vmxassist for 64 bit.

To: Ian Pratt <Ian.Pratt@xxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH][6/10] Enable vmxassist for 64 bit.
From: Arun Sharma <arun.sharma@xxxxxxxxx>
Date: Wed, 29 Jun 2005 22:51:52 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 30 Jun 2005 05:47:33 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
Enable vmxassist for 64 bit.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@xxxxxxxxx>
Signed-off-by: Arun Sharma <arun.sharma@xxxxxxxxx>

diff -r 18df82c3dcc7 -r 3c25261fef1c xen/include/public/vmx_assist.h
--- a/xen/include/public/vmx_assist.h   Thu Jun 30 04:15:49 2005
+++ b/xen/include/public/vmx_assist.h   Thu Jun 30 04:18:49 2005
@@ -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;
 
diff -r 18df82c3dcc7 -r 3c25261fef1c xen/arch/x86/vmx.c
--- a/xen/arch/x86/vmx.c        Thu Jun 30 04:15:49 2005
+++ b/xen/arch/x86/vmx.c        Thu Jun 30 04:18:49 2005
@@ -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))
diff -r 18df82c3dcc7 -r 3c25261fef1c tools/firmware/vmxassist/util.c
--- a/tools/firmware/vmxassist/util.c   Thu Jun 30 04:15:49 2005
+++ b/tools/firmware/vmxassist/util.c   Thu Jun 30 04:18:49 2005
@@ -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"
diff -r 18df82c3dcc7 -r 3c25261fef1c tools/firmware/vmxassist/gen.c
--- a/tools/firmware/vmxassist/gen.c    Thu Jun 30 04:15:49 2005
+++ b/tools/firmware/vmxassist/gen.c    Thu Jun 30 04:18:49 2005
@@ -20,7 +20,7 @@
 #include <stdio.h>
 #include <stddef.h>
 #include <stdlib.h>
-#include <public/vmx_assist.h>
+#include <vm86.h>
 
 int
 main()
diff -r 18df82c3dcc7 -r 3c25261fef1c tools/firmware/vmxassist/vm86.h
--- a/tools/firmware/vmxassist/vm86.h   Thu Jun 30 04:15:49 2005
+++ b/tools/firmware/vmxassist/vm86.h   Thu Jun 30 04:18:49 2005
@@ -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>
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH][6/10] Enable vmxassist for 64 bit., Arun Sharma <=