Change the vmx mmio handler to static
PATCH 1/3 Change the vmx mmio handler to static
This patch change the vmx mmio handler to static.
Signed-off-by Yunhong Jiang <[email protected]>
Signed-off-by Xin Li <[email protected]>
Thanks
Yunhong Jiang
# HG changeset patch
# User [email protected]
# Node ID 36651a7674bbad52356931bd6d8b66353953a218 # Parent 270469d40f026bca0b7325d3f015a0a4382d28a4 Change the vmx mmio handler to static
Signed-off-by Yunhong Jiang <[email protected]>
Signed-off-by Xin Li <[email protected]>
xen/arch/x86/vmx_intercept.c +10 -10
@@ -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 +135,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 ; } }
xen/arch/x86/vmx_vlapic.c +13 -8
@@ -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) {
xen/include/asm-x86/vmx_intercept.h +4 -8
@@ -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,
xen/include/asm-x86/vmx_vlapic.h +0 -8
@@ -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-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel