ChangeSet 1.1778, 2005/06/30 09:09:03+01:00, arun.sharma@xxxxxxxxx
[PATCH] Enable vmxassist for 64 bit.
Enable vmxassist for 64 bit.
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@xxxxxxxxx>
Signed-off-by: Arun Sharma <arun.sharma@xxxxxxxxx>
tools/firmware/vmxassist/gen.c | 2 -
tools/firmware/vmxassist/util.c | 2 -
tools/firmware/vmxassist/vm86.h | 13 +++++++
xen/arch/x86/vmx.c | 11 +++---
xen/include/public/vmx_assist.h | 68 ++++++++++++++++++++--------------------
5 files changed, 55 insertions(+), 41 deletions(-)
diff -Nru a/tools/firmware/vmxassist/gen.c b/tools/firmware/vmxassist/gen.c
--- a/tools/firmware/vmxassist/gen.c 2005-06-30 05:03:39 -04:00
+++ b/tools/firmware/vmxassist/gen.c 2005-06-30 05:03:39 -04:00
@@ -20,7 +20,7 @@
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
-#include <public/vmx_assist.h>
+#include <vm86.h>
int
main()
diff -Nru a/tools/firmware/vmxassist/util.c b/tools/firmware/vmxassist/util.c
--- a/tools/firmware/vmxassist/util.c 2005-06-30 05:03:39 -04:00
+++ b/tools/firmware/vmxassist/util.c 2005-06-30 05:03:39 -04:00
@@ -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 -Nru a/tools/firmware/vmxassist/vm86.h b/tools/firmware/vmxassist/vm86.h
--- a/tools/firmware/vmxassist/vm86.h 2005-06-30 05:03:39 -04:00
+++ b/tools/firmware/vmxassist/vm86.h 2005-06-30 05:03:39 -04:00
@@ -20,6 +20,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>
#define NR_EXCEPTION_HANDLER 32
diff -Nru a/xen/arch/x86/vmx.c b/xen/arch/x86/vmx.c
--- a/xen/arch/x86/vmx.c 2005-06-30 05:03:39 -04:00
+++ b/xen/arch/x86/vmx.c 2005-06-30 05:03:39 -04:00
@@ -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 -Nru a/xen/include/public/vmx_assist.h b/xen/include/public/vmx_assist.h
--- a/xen/include/public/vmx_assist.h 2005-06-30 05:03:39 -04:00
+++ b/xen/include/public/vmx_assist.h 2005-06-30 05:03:39 -04:00
@@ -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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|