diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-06-20 11:50:16 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-06-20 11:50:16 +0100 |
commit | 19636447b80747cd9da57cd540f09f475b13cfce (patch) | |
tree | be76ad344ed33741fd7f70b231b4563202791ee0 /xen/include | |
parent | eed63189dabd90abe422b0e94ab8854783329bed (diff) | |
download | xen-19636447b80747cd9da57cd540f09f475b13cfce.tar.gz xen-19636447b80747cd9da57cd540f09f475b13cfce.tar.bz2 xen-19636447b80747cd9da57cd540f09f475b13cfce.zip |
hvm: Support injection of virtual NMIs and clean up ExtInt handling in general.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/include')
-rw-r--r-- | xen/include/asm-x86/event.h | 1 | ||||
-rw-r--r-- | xen/include/asm-x86/hvm/hvm.h | 16 | ||||
-rw-r--r-- | xen/include/asm-x86/hvm/irq.h | 12 | ||||
-rw-r--r-- | xen/include/asm-x86/hvm/vcpu.h | 4 | ||||
-rw-r--r-- | xen/include/asm-x86/hvm/vlapic.h | 2 | ||||
-rw-r--r-- | xen/include/asm-x86/hvm/vmx/vmx.h | 11 | ||||
-rw-r--r-- | xen/include/asm-x86/hvm/vpic.h | 2 | ||||
-rw-r--r-- | xen/include/asm-x86/hvm/vpt.h | 3 |
8 files changed, 35 insertions, 16 deletions
diff --git a/xen/include/asm-x86/event.h b/xen/include/asm-x86/event.h index 32b157b8db..05671f7ef3 100644 --- a/xen/include/asm-x86/event.h +++ b/xen/include/asm-x86/event.h @@ -10,7 +10,6 @@ #define __ASM_EVENT_H__ #include <xen/shared.h> -#include <asm/hvm/irq.h> /* cpu_has_pending_irq() */ static inline void vcpu_kick(struct vcpu *v) { diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h index dd93c36e2a..203427593e 100644 --- a/xen/include/asm-x86/hvm/hvm.h +++ b/xen/include/asm-x86/hvm/hvm.h @@ -55,6 +55,14 @@ typedef struct segment_register { u64 base; } __attribute__ ((packed)) segment_register_t; +/* Interrupt acknowledgement sources. */ +enum hvm_intack { + hvm_intack_none, + hvm_intack_pic, + hvm_intack_lapic, + hvm_intack_nmi +}; + /* * The hardware virtual machine (HVM) interface abstracts away from the * x86/x86_64 CPU virtualization assist specifics. Currently this interface @@ -106,7 +114,7 @@ struct hvm_function_table { int (*long_mode_enabled)(struct vcpu *v); int (*pae_enabled)(struct vcpu *v); int (*nx_enabled)(struct vcpu *v); - int (*interrupts_enabled)(struct vcpu *v); + int (*interrupts_enabled)(struct vcpu *v, enum hvm_intack); int (*guest_x86_mode)(struct vcpu *v); unsigned long (*get_guest_ctrl_reg)(struct vcpu *v, unsigned int num); unsigned long (*get_segment_base)(struct vcpu *v, enum x86_segment seg); @@ -199,16 +207,16 @@ hvm_long_mode_enabled(struct vcpu *v) #define hvm_long_mode_enabled(v) (v,0) #endif - static inline int +static inline int hvm_pae_enabled(struct vcpu *v) { return hvm_funcs.pae_enabled(v); } static inline int -hvm_interrupts_enabled(struct vcpu *v) +hvm_interrupts_enabled(struct vcpu *v, enum hvm_intack type) { - return hvm_funcs.interrupts_enabled(v); + return hvm_funcs.interrupts_enabled(v, type); } static inline int diff --git a/xen/include/asm-x86/hvm/irq.h b/xen/include/asm-x86/hvm/irq.h index 1095e86fd0..96f509b632 100644 --- a/xen/include/asm-x86/hvm/irq.h +++ b/xen/include/asm-x86/hvm/irq.h @@ -24,11 +24,11 @@ #include <xen/types.h> #include <xen/spinlock.h> +#include <asm/hvm/hvm.h> #include <asm/hvm/vpic.h> #include <asm/hvm/vioapic.h> #include <public/hvm/save.h> - struct hvm_irq { /* * Virtual interrupt wires for a single PCI bus. @@ -58,7 +58,6 @@ struct hvm_irq { HVMIRQ_callback_gsi, HVMIRQ_callback_pci_intx } callback_via_type; - uint32_t pad; /* So the next field will be aligned */ }; union { uint32_t gsi; @@ -115,9 +114,12 @@ void hvm_set_pci_link_route(struct domain *d, u8 link, u8 isa_irq); void hvm_set_callback_irq_level(void); void hvm_set_callback_via(struct domain *d, uint64_t via); -int cpu_get_interrupt(struct vcpu *v, int *type); -int cpu_has_pending_irq(struct vcpu *v); -int get_isa_irq_vector(struct vcpu *vcpu, int irq, int type); +/* Check/Acknowledge next pending interrupt. */ +enum hvm_intack hvm_vcpu_has_pending_irq(struct vcpu *v); +int hvm_vcpu_ack_pending_irq( + struct vcpu *v, enum hvm_intack type, int *vector); + +int get_isa_irq_vector(struct vcpu *vcpu, int irq, enum hvm_intack src); int is_isa_irq_masked(struct vcpu *v, int isa_irq); #endif /* __ASM_X86_HVM_IRQ_H__ */ diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h index b0a6956120..a6a762ef36 100644 --- a/xen/include/asm-x86/hvm/vcpu.h +++ b/xen/include/asm-x86/hvm/vcpu.h @@ -30,12 +30,14 @@ struct hvm_vcpu { unsigned long hw_cr3; /* value we give to HW to use */ - unsigned long ioflags; struct hvm_io_op io_op; struct vlapic vlapic; s64 cache_tsc_offset; u64 guest_time; + /* Is an NMI pending for delivery to this VCPU core? */ + bool_t nmi_pending; /* NB. integrate flag with save/restore */ + /* Lock and list for virtual platform timers. */ spinlock_t tm_lock; struct list_head tm_list; diff --git a/xen/include/asm-x86/hvm/vlapic.h b/xen/include/asm-x86/hvm/vlapic.h index ed4fe172b7..ca09df2bcb 100644 --- a/xen/include/asm-x86/hvm/vlapic.h +++ b/xen/include/asm-x86/hvm/vlapic.h @@ -76,7 +76,7 @@ int vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig); int vlapic_find_highest_irr(struct vlapic *vlapic); int vlapic_has_interrupt(struct vcpu *v); -int cpu_get_apic_interrupt(struct vcpu *v, int *mode); +int cpu_get_apic_interrupt(struct vcpu *v); int vlapic_init(struct vcpu *v); void vlapic_destroy(struct vcpu *v); diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h index 104e203c3e..f42d6f34a4 100644 --- a/xen/include/asm-x86/hvm/vmx/vmx.h +++ b/xen/include/asm-x86/hvm/vmx/vmx.h @@ -336,9 +336,16 @@ static inline void vmx_inject_sw_exception( instruction_len); } -static inline void vmx_inject_extint(struct vcpu *v, int trap, int error_code) +static inline void vmx_inject_extint(struct vcpu *v, int trap) { - __vmx_inject_exception(v, trap, INTR_TYPE_EXT_INTR, error_code, 0); + __vmx_inject_exception(v, trap, INTR_TYPE_EXT_INTR, + VMX_DELIVER_NO_ERROR_CODE, 0); +} + +static inline void vmx_inject_nmi(struct vcpu *v) +{ + __vmx_inject_exception(v, 2, INTR_TYPE_NMI, + VMX_DELIVER_NO_ERROR_CODE, 0); } #endif /* __ASM_X86_HVM_VMX_VMX_H__ */ diff --git a/xen/include/asm-x86/hvm/vpic.h b/xen/include/asm-x86/hvm/vpic.h index 6bb9bb35ea..59dad65c24 100644 --- a/xen/include/asm-x86/hvm/vpic.h +++ b/xen/include/asm-x86/hvm/vpic.h @@ -32,7 +32,7 @@ void vpic_irq_positive_edge(struct domain *d, int irq); void vpic_irq_negative_edge(struct domain *d, int irq); void vpic_init(struct domain *d); -int cpu_get_pic_interrupt(struct vcpu *v, int *type); +int cpu_get_pic_interrupt(struct vcpu *v); int is_periodic_irq(struct vcpu *v, int irq, int type); #endif /* __ASM_X86_HVM_VPIC_H__ */ diff --git a/xen/include/asm-x86/hvm/vpt.h b/xen/include/asm-x86/hvm/vpt.h index acd245a93d..929fd4b306 100644 --- a/xen/include/asm-x86/hvm/vpt.h +++ b/xen/include/asm-x86/hvm/vpt.h @@ -29,6 +29,7 @@ #include <xen/timer.h> #include <xen/list.h> #include <asm/hvm/vpic.h> +#include <asm/hvm/irq.h> #include <public/hvm/save.h> struct HPETState; @@ -119,7 +120,7 @@ struct pl_time { /* platform time */ void pt_freeze_time(struct vcpu *v); void pt_thaw_time(struct vcpu *v); void pt_update_irq(struct vcpu *v); -void pt_intr_post(struct vcpu *v, int vector, int type); +void pt_intr_post(struct vcpu *v, int vector, enum hvm_intack src); void pt_reset(struct vcpu *v); void pt_migrate(struct vcpu *v); void create_periodic_time( |