Initial support for HVM compat guests
authorEmmanuel Ackaouy <ack@xensource.com>
Fri, 5 Jan 2007 17:51:07 +0000 (17:51 +0000)
committerEmmanuel Ackaouy <ack@xensource.com>
Fri, 5 Jan 2007 17:51:07 +0000 (17:51 +0000)
Signed-off-by: Emmanuel Ackaouy <ack@xensource.com>
xen/arch/x86/domain.c
xen/arch/x86/hvm/intercept.c
xen/arch/x86/mm/shadow/multi.c
xen/arch/x86/x86_64/compat/entry.S
xen/include/public/hvm/ioreq.h

index acff71b90ff76fca48f697567908d04c06036634..b03824f5ca39992fcd64b30f6c2eb52fdd62f96e 100644 (file)
@@ -1395,7 +1395,11 @@ void domain_relinquish_resources(struct domain *d)
 #ifdef CONFIG_COMPAT
         if ( IS_COMPAT(d) )
         {
-            pfn = l4e_get_pfn(*(l4_pgentry_t *)__va(pagetable_get_paddr(v->arch.guest_table)));
+            if ( is_hvm_vcpu(v) )
+                pfn = pagetable_get_pfn(v->arch.guest_table);
+            else
+                pfn = l4e_get_pfn(*(l4_pgentry_t *)__va(pagetable_get_paddr(v->arch.guest_table)));
+
             if ( pfn != 0 )
             {
                 if ( shadow_mode_refcounts(d) )
index 4a1e682b5d932b26d1a1a6c0443735da4ed870dd..3de58812c32b626acc9a0853d8f31d9445ec5771 100644 (file)
@@ -182,7 +182,7 @@ int hvm_buffered_io_intercept(ioreq_t *p)
     spin_lock(buffered_io_lock);
 
     if ( buffered_iopage->write_pointer - buffered_iopage->read_pointer ==
-         (unsigned long)IOREQ_BUFFER_SLOT_NUM ) {
+         (unsigned int)IOREQ_BUFFER_SLOT_NUM ) {
         /* the queue is full.
          * send the iopacket through the normal path.
          * NOTE: The arithimetic operation could handle the situation for
index 56bd93d4282c13600bc69f4c4924871d0e42a074..b86b55b0858694b32a871ab77d3caefc1f4a8d23 100644 (file)
@@ -2106,7 +2106,6 @@ void sh_destroy_monitor_table(struct vcpu *v, mfn_t mmfn)
             shadow_free(d, _mfn(l3e_get_pfn(l3e[3])));
             sh_unmap_domain_page(l3e);
         }
-        shadow_free(d, mmfn);
         sh_unmap_domain_page(l4e);
     }
 #elif CONFIG_PAGING_LEVELS == 3
index bc47636d2547f356fc0fb0106ecb663e3c4b0b2b..25ea08bacffbc6e7c5d82b3595fc80445458b01e 100644 (file)
@@ -313,7 +313,7 @@ ENTRY(compat_hypercall_table)
         .quad compat_xenoprof_op
         .quad do_event_channel_op
         .quad compat_physdev_op
-        .quad compat_ni_hypercall
+        .quad do_hvm_op
         .quad compat_sysctl             /* 35 */
         .quad compat_domctl
         .quad compat_kexec_op
@@ -356,7 +356,7 @@ ENTRY(compat_hypercall_args_table)
         .byte 2 /* compat_xenoprof_op       */
         .byte 2 /* compat_event_channel_op  */
         .byte 2 /* compat_physdev_op        */
-        .byte 0 /* compat_ni_hypercall      */
+        .byte 2 /* do_hvm_op                */
         .byte 1 /* compat_sysctl            */  /* 35 */
         .byte 1 /* compat_domctl            */
         .byte 2 /* compat_kexec_op          */
index 0d3dc3277a73117a03f6112dc555422fbb62d38e..351801a9b27f27e144c92f0044349c11a8ec4006 100644 (file)
@@ -56,6 +56,7 @@ struct ioreq {
     uint8_t dir:1;          /*  1=read, 0=write             */
     uint8_t df:1;
     uint8_t type;           /* I/O type                     */
+    uint8_t _pad0[6];
     uint64_t io_count;      /* How many IO done on a vcpu   */
 };
 typedef struct ioreq ioreq_t;
@@ -74,8 +75,8 @@ typedef struct shared_iopage shared_iopage_t;
 
 #define IOREQ_BUFFER_SLOT_NUM     80
 struct buffered_iopage {
-    unsigned long   read_pointer;
-    unsigned long   write_pointer;
+    unsigned int    read_pointer;
+    unsigned int    write_pointer;
     ioreq_t         ioreq[IOREQ_BUFFER_SLOT_NUM];
 };            /* sizeof this structure must be in one page */
 typedef struct buffered_iopage buffered_iopage_t;