[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Add an explicit result field to multicall_entry_t, rather than abusing



ChangeSet 1.1625, 2005/06/01 10:49:24+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        Add an explicit result field to multicall_entry_t, rather than abusing
        the sixth argument field.
        Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>



 freebsd-5.3-xen-sparse/i386-xen/xen/netfront/xn_netfront.c |    2 -
 linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c      |    2 -
 linux-2.6.11-xen-sparse/drivers/xen/netback/netback.c      |    8 ++---
 linux-2.6.11-xen-sparse/drivers/xen/netfront/netfront.c    |    2 -
 linux-2.6.11-xen-sparse/drivers/xen/usbback/usbback.c      |    2 -
 netbsd-2.0-xen-sparse/sys/arch/xen/xen/if_xennet.c         |    4 +-
 xen/arch/x86/x86_32/asm-offsets.c                          |    4 ++
 xen/arch/x86/x86_64/asm-offsets.c                          |    4 ++
 xen/include/public/arch-ia64.h                             |    1 
 xen/include/public/arch-x86_32.h                           |    1 
 xen/include/public/arch-x86_64.h                           |    1 
 xen/include/public/xen.h                                   |   18 ++-----------
 12 files changed, 20 insertions(+), 29 deletions(-)


diff -Nru a/freebsd-5.3-xen-sparse/i386-xen/xen/netfront/xn_netfront.c 
b/freebsd-5.3-xen-sparse/i386-xen/xen/netfront/xn_netfront.c
--- a/freebsd-5.3-xen-sparse/i386-xen/xen/netfront/xn_netfront.c        
2005-06-01 09:02:17 -04:00
+++ b/freebsd-5.3-xen-sparse/i386-xen/xen/netfront/xn_netfront.c        
2005-06-01 09:02:17 -04:00
@@ -454,7 +454,7 @@
     (void)HYPERVISOR_multicall(xn_rx_mcl, i+1);
 
     /* Check return status of HYPERVISOR_dom_mem_op(). */
-    if (unlikely(xn_rx_mcl[i].args[5] != i))
+    if (unlikely(xn_rx_mcl[i].result != i))
         panic("Unable to reduce memory reservation\n");
 
     /* Above is a suitable barrier to ensure backend will see requests. */
diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c 
b/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c
--- a/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c     2005-06-01 
09:02:17 -04:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c     2005-06-01 
09:02:17 -04:00
@@ -562,7 +562,7 @@
 
     for ( i = 0; i < nseg; i++ )
     {
-        if ( unlikely(mcl[i].args[5] != 0) )
+        if ( unlikely(mcl[i].result != 0) )
         {
             DPRINTK("invalid buffer -- could not remap it\n");
             fast_flush_area(pending_idx, nseg);
diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/netback/netback.c 
b/linux-2.6.11-xen-sparse/drivers/xen/netback/netback.c
--- a/linux-2.6.11-xen-sparse/drivers/xen/netback/netback.c     2005-06-01 
09:02:17 -04:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/netback/netback.c     2005-06-01 
09:02:17 -04:00
@@ -296,12 +296,12 @@
         netif->stats.tx_packets++;
 
         /* The update_va_mapping() must not fail. */
-        if ( unlikely(mcl[0].args[5] != 0) )
+        if ( unlikely(mcl[0].result != 0) )
             BUG();
 
         /* Check the reassignment error code. */
         status = NETIF_RSP_OKAY;
-        if ( unlikely(mcl[1].args[5] != 0) )
+        if ( unlikely(mcl[1].result != 0) )
         {
             DPRINTK("Failed MMU update transferring to DOM%u\n", netif->domid);
             free_mfn(mdata >> PAGE_SHIFT);
@@ -440,7 +440,7 @@
     while ( dealloc_cons != dp )
     {
         /* The update_va_mapping() must not fail. */
-        if ( unlikely(mcl[0].args[5] != 0) )
+        if ( unlikely(mcl[0].result != 0) )
             BUG();
 
         pending_idx = dealloc_ring[MASK_PEND_IDX(dealloc_cons++)];
@@ -606,7 +606,7 @@
         memcpy(&txreq, &pending_tx_info[pending_idx].req, sizeof(txreq));
 
         /* Check the remap error code. */
-        if ( unlikely(mcl[0].args[5] != 0) )
+        if ( unlikely(mcl[0].result != 0) )
         {
             DPRINTK("Bad page frame\n");
             make_tx_response(netif, txreq.id, NETIF_RSP_ERROR);
diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/netfront/netfront.c 
b/linux-2.6.11-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6.11-xen-sparse/drivers/xen/netfront/netfront.c   2005-06-01 
09:02:17 -04:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/netfront/netfront.c   2005-06-01 
09:02:17 -04:00
@@ -419,7 +419,7 @@
     (void)HYPERVISOR_multicall(rx_mcl, i+1);
 
     /* Check return status of HYPERVISOR_dom_mem_op(). */
-    if (unlikely(rx_mcl[i].args[5] != i))
+    if (unlikely(rx_mcl[i].result != i))
         panic("Unable to reduce memory reservation\n");
 
     /* Above is a suitable barrier to ensure backend will see requests. */
diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/usbback/usbback.c 
b/linux-2.6.11-xen-sparse/drivers/xen/usbback/usbback.c
--- a/linux-2.6.11-xen-sparse/drivers/xen/usbback/usbback.c     2005-06-01 
09:02:17 -04:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/usbback/usbback.c     2005-06-01 
09:02:17 -04:00
@@ -686,7 +686,7 @@
         int j;
         for ( j = 0; j < i; j++ )
         {
-            if ( unlikely(mcl[j].args[5] != 0) )
+            if ( unlikely(mcl[j].result != 0) )
             {
                 printk(KERN_WARNING
                       "invalid buffer %d -- could not remap it\n", j);
diff -Nru a/netbsd-2.0-xen-sparse/sys/arch/xen/xen/if_xennet.c 
b/netbsd-2.0-xen-sparse/sys/arch/xen/xen/if_xennet.c
--- a/netbsd-2.0-xen-sparse/sys/arch/xen/xen/if_xennet.c        2005-06-01 
09:02:17 -04:00
+++ b/netbsd-2.0-xen-sparse/sys/arch/xen/xen/if_xennet.c        2005-06-01 
09:02:17 -04:00
@@ -612,7 +612,7 @@
        (void)HYPERVISOR_multicall(rx_mcl, nr_pfns+1);
 
        /* Check return status of HYPERVISOR_dom_mem_op(). */
-       if ( rx_mcl[nr_pfns].args[5] != nr_pfns )
+       if ( rx_mcl[nr_pfns].result != nr_pfns )
                panic("Unable to reduce memory reservation\n");
 
        /* Above is a suitable barrier to ensure backend will see requests. */
@@ -912,7 +912,7 @@
        (void)HYPERVISOR_multicall(rx_mcl, nr_pfns+1);
 
        /* Check return status of HYPERVISOR_dom_mem_op(). */
-       if (rx_mcl[nr_pfns].args[5] != nr_pfns)
+       if (rx_mcl[nr_pfns].result != nr_pfns)
                panic("Unable to reduce memory reservation\n");
 
        /* Above is a suitable barrier to ensure backend will see requests. */
diff -Nru a/xen/arch/x86/x86_32/asm-offsets.c 
b/xen/arch/x86/x86_32/asm-offsets.c
--- a/xen/arch/x86/x86_32/asm-offsets.c 2005-06-01 09:02:17 -04:00
+++ b/xen/arch/x86/x86_32/asm-offsets.c 2005-06-01 09:02:17 -04:00
@@ -88,7 +88,9 @@
     OFFSET(MULTICALL_arg2, multicall_entry_t, args[2]);
     OFFSET(MULTICALL_arg3, multicall_entry_t, args[3]);
     OFFSET(MULTICALL_arg4, multicall_entry_t, args[4]);
-    OFFSET(MULTICALL_result, multicall_entry_t, args[5]);
+    OFFSET(MULTICALL_arg5, multicall_entry_t, args[5]);
+    OFFSET(MULTICALL_arg6, multicall_entry_t, args[6]);
+    OFFSET(MULTICALL_result, multicall_entry_t, result);
     BLANK();
 
     DEFINE(FIXMAP_apic_base, fix_to_virt(FIX_APIC_BASE));
diff -Nru a/xen/arch/x86/x86_64/asm-offsets.c 
b/xen/arch/x86/x86_64/asm-offsets.c
--- a/xen/arch/x86/x86_64/asm-offsets.c 2005-06-01 09:02:17 -04:00
+++ b/xen/arch/x86/x86_64/asm-offsets.c 2005-06-01 09:02:17 -04:00
@@ -88,7 +88,9 @@
     OFFSET(MULTICALL_arg2, multicall_entry_t, args[2]);
     OFFSET(MULTICALL_arg3, multicall_entry_t, args[3]);
     OFFSET(MULTICALL_arg4, multicall_entry_t, args[4]);
-    OFFSET(MULTICALL_result, multicall_entry_t, args[5]);
+    OFFSET(MULTICALL_arg5, multicall_entry_t, args[5]);
+    OFFSET(MULTICALL_arg6, multicall_entry_t, args[6]);
+    OFFSET(MULTICALL_result, multicall_entry_t, result);
     BLANK();
 
     DEFINE(IRQSTAT_shift, LOG_2(sizeof(irq_cpustat_t)));
diff -Nru a/xen/include/public/arch-ia64.h b/xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h    2005-06-01 09:02:17 -04:00
+++ b/xen/include/public/arch-ia64.h    2005-06-01 09:02:17 -04:00
@@ -18,7 +18,6 @@
 
 /* NB. Both the following are 64 bits each. */
 typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
-typedef unsigned long cpureg_t;   /* Full-sized register.                    */
 
 typedef struct
 {
diff -Nru a/xen/include/public/arch-x86_32.h b/xen/include/public/arch-x86_32.h
--- a/xen/include/public/arch-x86_32.h  2005-06-01 09:02:17 -04:00
+++ b/xen/include/public/arch-x86_32.h  2005-06-01 09:02:17 -04:00
@@ -77,7 +77,6 @@
 
 /* NB. Both the following are 32 bits each. */
 typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
-typedef unsigned long cpureg_t;   /* Full-sized register.                    */
 
 /*
  * Send an array of these to HYPERVISOR_set_trap_table()
diff -Nru a/xen/include/public/arch-x86_64.h b/xen/include/public/arch-x86_64.h
--- a/xen/include/public/arch-x86_64.h  2005-06-01 09:02:17 -04:00
+++ b/xen/include/public/arch-x86_64.h  2005-06-01 09:02:17 -04:00
@@ -111,7 +111,6 @@
 
 /* NB. Both the following are 64 bits each. */
 typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
-typedef unsigned long cpureg_t;   /* Full-sized register.                    */
 
 /*
  * Send an array of these to HYPERVISOR_set_trap_table().
diff -Nru a/xen/include/public/xen.h b/xen/include/public/xen.h
--- a/xen/include/public/xen.h  2005-06-01 09:02:17 -04:00
+++ b/xen/include/public/xen.h  2005-06-01 09:02:17 -04:00
@@ -59,16 +59,6 @@
 #define __HYPERVISOR_set_segment_base     25 /* x86/64 only */
 #define __HYPERVISOR_mmuext_op            26
 
-/*
- * MULTICALLS
- * 
- * Multicalls are listed in an array, with each element being a fixed size 
- * (BYTES_PER_MULTICALL_ENTRY). Each is of the form (op, arg1, ..., argN)
- * where each element of the tuple is a machine word. 
- */
-#define ARGS_PER_MULTICALL_ENTRY 8
-
-
 /* 
  * VIRTUAL INTERRUPTS
  * 
@@ -281,7 +271,7 @@
 {
     memory_t ptr;       /* Machine address of PTE. */
     memory_t val;       /* New contents of PTE.    */
-} PACKED mmu_update_t;
+} mmu_update_t;
 
 /*
  * Send an array of these to HYPERVISOR_multicall().
@@ -289,9 +279,9 @@
  */
 typedef struct
 {
-    cpureg_t op;
-    cpureg_t args[7];
-} PACKED multicall_entry_t;
+    unsigned long op, result;
+    unsigned long args[6];
+} multicall_entry_t;
 
 /* Event channel endpoints per domain. */
 #define NR_EVENT_CHANNELS 1024

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.