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

[Xen-changelog] This patch change the vmx mmio handler to static.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 781b6dd73e4c66ab0f05cd03a045b47e429510cc
# Parent  a05e55c919c1f765b9b93a0178005c4a19cb471e
This patch change the vmx mmio handler to static.

Signed-off-by: Yunhong Jiang <yunhong.jiang@xxxxxxxxx>
Signed-off-by: Xin Li <xin.b.li@xxxxxxxxx>

diff -r a05e55c919c1 -r 781b6dd73e4c xen/arch/x86/vmx_intercept.c
--- a/xen/arch/x86/vmx_intercept.c      Mon Nov  7 14:06:27 2005
+++ b/xen/arch/x86/vmx_intercept.c      Mon Nov  7 15:35:46 2005
@@ -33,13 +33,13 @@
 
 #ifdef CONFIG_VMX
 
-struct vmx_mmio_handler vmx_mmio_handers[VMX_MMIO_HANDLER_NR] =
-{
-    {
-        .check_handler = vlapic_range,
-        .read_handler  = vlapic_read,
-        .write_handler = vlapic_write
-    }
+extern struct vmx_mmio_handler vlapic_mmio_handler;
+
+#define VMX_MMIO_HANDLER_NR 1
+
+struct vmx_mmio_handler *vmx_mmio_handlers[VMX_MMIO_HANDLER_NR] =
+{
+    &vlapic_mmio_handler
 };
 
 static inline void vmx_mmio_access(struct vcpu *v,
@@ -134,16 +134,16 @@
 {
     struct vcpu *v = current;
     int i;
-    struct vmx_mmio_handler *handler = vmx_mmio_handers;
 
     /* XXX currently only APIC use intercept */
     if ( !vmx_apic_support(v->domain) )
         return 0;
 
     for ( i = 0; i < VMX_MMIO_HANDLER_NR; i++ ) {
-        if ( handler[i].check_handler(v, p->addr) ) {
+        if ( vmx_mmio_handlers[i]->check_handler(v, p->addr) ) {
             vmx_mmio_access(v, p,
-              handler[i].read_handler, handler[i].write_handler);
+                            vmx_mmio_handlers[i]->read_handler,
+                            vmx_mmio_handlers[i]->write_handler);
             return 1;
         }
     }
diff -r a05e55c919c1 -r 781b6dd73e4c xen/arch/x86/vmx_vlapic.c
--- a/xen/arch/x86/vmx_vlapic.c Mon Nov  7 14:06:27 2005
+++ b/xen/arch/x86/vmx_vlapic.c Mon Nov  7 15:35:46 2005
@@ -543,8 +543,8 @@
     }
 }
 
-unsigned long vlapic_read(struct vcpu *v, unsigned long address,
-            unsigned long len)
+static unsigned long vlapic_read(struct vcpu *v, unsigned long address,
+                                 unsigned long len)
 {
     unsigned int alignment;
     unsigned int tmp;
@@ -585,8 +585,8 @@
     return result;
 }
 
-unsigned long vlapic_write(struct vcpu *v, unsigned long address,
-                  unsigned long len, unsigned long val)
+static void vlapic_write(struct vcpu *v, unsigned long address,
+                         unsigned long len, unsigned long val)
 {
     struct vlapic *vlapic = VLAPIC(v);
     unsigned int offset = address - vlapic->base_address;
@@ -758,10 +758,9 @@
         printk("Local APIC Write to read-only register\n");
         break;
     }
-    return 1;
-}
-
-int vlapic_range(struct vcpu *v, unsigned long addr)
+}
+
+static int vlapic_range(struct vcpu *v, unsigned long addr)
 {
     struct vlapic *vlapic = VLAPIC(v);
 
@@ -772,6 +771,12 @@
 
     return 0;
 }
+
+struct vmx_mmio_handler vlapic_mmio_handler = {
+    .check_handler = vlapic_range,
+    .read_handler = vlapic_read,
+    .write_handler = vlapic_write
+};
 
 void vlapic_msr_set(struct vlapic *vlapic, uint64_t value)
 {
diff -r a05e55c919c1 -r 781b6dd73e4c xen/include/asm-x86/vmx_intercept.h
--- a/xen/include/asm-x86/vmx_intercept.h       Mon Nov  7 14:06:27 2005
+++ b/xen/include/asm-x86/vmx_intercept.h       Mon Nov  7 15:35:46 2005
@@ -18,10 +18,10 @@
                                          unsigned long addr,
                                          unsigned long length);
 
-typedef unsigned long (*vmx_mmio_write_t)(struct vcpu *v,
-                                         unsigned long addr,
-                                         unsigned long length,
-                                         unsigned long val);
+typedef void (*vmx_mmio_write_t)(struct vcpu *v,
+                                 unsigned long addr,
+                                 unsigned long length,
+                                 unsigned long val);
 
 typedef int (*vmx_mmio_check_t)(struct vcpu *v, unsigned long addr);
 
@@ -43,10 +43,6 @@
     vmx_mmio_write_t write_handler;
 };
 
-#define VMX_MMIO_HANDLER_NR 1
-
-extern struct vmx_mmio_handler vmx_mmio_handers[VMX_MMIO_HANDLER_NR];
-
 /* global io interception point in HV */
 extern int vmx_io_intercept(ioreq_t *p, int type);
 extern int register_io_handler(unsigned long addr, unsigned long size,
diff -r a05e55c919c1 -r 781b6dd73e4c xen/include/asm-x86/vmx_vlapic.h
--- a/xen/include/asm-x86/vmx_vlapic.h  Mon Nov  7 14:06:27 2005
+++ b/xen/include/asm-x86/vmx_vlapic.h  Mon Nov  7 15:35:46 2005
@@ -225,14 +225,6 @@
 
 extern void vlapic_msr_set(struct vlapic *vlapic, uint64_t value);
 
-int vlapic_range(struct vcpu *v, unsigned long addr);
-
-unsigned long vlapic_write(struct vcpu *v, unsigned long address,
-                           unsigned long len, unsigned long val);
-
-unsigned long vlapic_read(struct vcpu *v, unsigned long address,
-                          unsigned long len);
-
 int vlapic_accept_pic_intr(struct vcpu *v);
 
 struct vlapic* apic_round_robin(struct domain *d,

_______________________________________________
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®.