Add virtual IOAPIC support for VMX guest
PATCH 2/3 Add virtual IOAPIC support for VMX guest
This patch add virtual IOAPIC support for VMX guest.
Signed-off-by Yunhong Jiang <[email protected]>
Signed-off-by Xin Li <[email protected]>
Signed-off-by Eddie Dong <[email protected]>
Signed-off-by Jun Nakajima <[email protected]>
Thanks
Yunhong Jiang
# HG changeset patch
# User [email protected]
# Node ID ecaac5524cd2d8935e714b31e50981821f93501a # Parent 36651a7674bbad52356931bd6d8b66353953a218 Add virtual IOAPIC support for VMX guest.
Signed-off-by Yunhong Jiang <[email protected]>
Signed-off-by Li Xin <[email protected]>
Signed-off-by Eddie Dong <[email protected]>
Signed-off-by Jun Nakajima <[email protected]>
xen/arch/x86/dm/i8259.c +11 -1
@@ -33,6 +33,7 @@#include <asm/vmx.h> #include <public/io/vmx_vpic.h> #include <asm/current.h> +#include <asm/vmx_vioapic.h> #include <asm/vmx_vlapic.h> /* set irq level. If an edge is detected, then the IRR is set to 1 */
@@ -124,6 +125,7 @@ {struct vmx_virpic *s = opaque; +vmx_vioapic_set_irq (current->domain, irq, level);pic_set_irq1 (&s->pics[irq >>3 ], irq &7 , level);/* used for IOAPIC irqs */ if (s->alt_irq_func)
@@ -135,6 +137,7 @@ { s->pics[1 ].irr |= (uint8_t )(irqs >>8 ); s->pics[0 ].irr |= (uint8_t ) irqs; +vmx_vioapic_do_irqs (current->domain, irqs);pic_update_irq (s); }
@@ -142,6 +145,7 @@ { s->pics[1 ].irr &= ~(uint8_t )(irqs >>8 ); s->pics[0 ].irr &= ~(uint8_t ) irqs; +vmx_vioapic_do_irqs_clear (current->domain, irqs);pic_update_irq (s); }
@@ -521,7 +525,13 @@int is_pit_irq (struct vcpu *v,int irq,int type) { -int pit_vec = v->domain->arch.vmx_platform.vmx_pic.pics[0 ].irq_base; +int pit_vec; + +if (type ==VLAPIC_DELIV_MODE_EXT ) + pit_vec = v->domain->arch.vmx_platform.vmx_pic.pics[0 ].irq_base; +else + pit_vec = + v->domain->arch.vmx_platform.vmx_vioapic.redirtbl[0 ].RedirForm.vector;return (irq == pit_vec); }
xen/arch/x86/vmx_intercept.c +5 -3
@@ -34,12 +34,14 @@#ifdef CONFIG_VMX extern struct vmx_mmio_handler vlapic_mmio_handler; - -#define VMX_MMIO_HANDLER_NR 1 +extern struct vmx_mmio_handler vioapic_mmio_handler; + +#define VMX_MMIO_HANDLER_NR 2struct vmx_mmio_handler *vmx_mmio_handlers[VMX_MMIO_HANDLER_NR ] = { - &vlapic_mmio_handler + &vlapic_mmio_handler, + &vioapic_mmio_handler }; static inline void vmx_mmio_access(struct vcpu *v,
xen/arch/x86/vmx_vlapic.c +7 -0
@@ -307,6 +307,11 @@vlapic_clear_isr (vlapic, vector);vlapic_update_ppr (vlapic); + +if (test_and_clear_bit (vector, &vlapic->tmr[0 ])) { +extern void ioapic_update_EOI (struct domain *d,int vector); +ioapic_update_EOI (vlapic->domain, vector); + } } int vlapic_check_vector(struct vlapic *vlapic,
@@ -969,6 +974,8 @@ vlapic->spurious_vec =0xff ; +vmx_vioapic_add_lapic (vlapic, v); +init_ac_timer (&vlapic->vlapic_timer, vlapic_timer_fn, vlapic, v->processor);
xen/arch/x86/vmx_vmcs.c +2 -0
@@ -28,6 +28,7 @@#include <asm/processor.h> #include <asm/msr.h> #include <asm/vmx.h> +#include <asm/vmx_vioapic.h> #include <asm/flushtlb.h> #include <xen/event.h> #include <xen/kernel.h>
@@ -255,6 +256,7 @@if (vmx_apic_support (d) ) {spin_lock_init (&d->arch.vmx_platform.round_robin_lock); +vmx_vioapic_init (d); } }
xen/include/asm-x86/vmx_platform.h +2 -0
@@ -24,6 +24,7 @@#include <asm/e820.h> #include <asm/vmx_virpit.h> #include <asm/vmx_intercept.h> +#include <asm/vmx_vioapic.h> #include <public/io/vmx_vpic.h> #define MAX_OPERAND_NUM 2
@@ -85,6 +86,7 @@struct vmx_virpit vmx_pit;struct vmx_io_handler vmx_io_handler;struct vmx_virpic vmx_pic; +struct vmx_vioapic vmx_vioapic;unsigned char round_info[256 ];spinlock_t round_robin_lock;int interrupt_request;
xen/include/asm-x86/vmx_vmcs.h +2 -1
@@ -284,7 +284,8 @@#define DBG_LEVEL_VMMU (1 << 5)#define DBG_LEVEL_VLAPIC (1 << 6)#define DBG_LEVEL_VLAPIC_TIMER (1 << 7) -#define DBG_LEVEL_VLAPIC_INTERRUPT (1 << 7) +#define DBG_LEVEL_VLAPIC_INTERRUPT (1 << 8) +#define DBG_LEVEL_IOAPIC (1 << 9)extern unsigned int opt_vmx_debug_level; #define VMX_DBG_LOG(level, _f, _a...) \
xen/arch/x86/dm/vmx_vioapic.c new file +608 -0
608 lines not on this page · raw message
xen/include/asm-x86/vmx_vioapic.h new file +136 -0
136 lines not on this page · raw message
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel