diff options
author | Yang Zhang <yang.z.zhang@Intel.com> | 2013-04-11 07:21:36 -0400 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2013-04-15 22:20:33 -0400 |
commit | 8dc6aade5bdc9d436d4ab8328cb15f0adbbc47bf (patch) | |
tree | 88471ae7c01ef63aff41368fff526fed8c8dfd5d /virt/kvm | |
parent | 1fcc7890dbf32571c25278803ee19182c801c006 (diff) |
KVM: Introduce struct rtc_status
rtc_status is used to track RTC interrupt delivery status. The pending_eoi
will be increased by vcpu who received RTC interrupt and will be decreased
when EOI to this interrupt.
Also, we use dest_map to record the destination vcpu to avoid the case that
vcpu who didn't get the RTC interupt, but issued EOI with same vector of RTC
and descreased pending_eoi by mistake.
Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Reviewed-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt/kvm')
-rw-r--r-- | virt/kvm/ioapic.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/virt/kvm/ioapic.h b/virt/kvm/ioapic.h index 2fc61a5013d2..87cd94bae372 100644 --- a/virt/kvm/ioapic.h +++ b/virt/kvm/ioapic.h | |||
@@ -34,6 +34,17 @@ struct kvm_vcpu; | |||
34 | #define IOAPIC_INIT 0x5 | 34 | #define IOAPIC_INIT 0x5 |
35 | #define IOAPIC_EXTINT 0x7 | 35 | #define IOAPIC_EXTINT 0x7 |
36 | 36 | ||
37 | #ifdef CONFIG_X86 | ||
38 | #define RTC_GSI 8 | ||
39 | #else | ||
40 | #define RTC_GSI -1U | ||
41 | #endif | ||
42 | |||
43 | struct rtc_status { | ||
44 | int pending_eoi; | ||
45 | DECLARE_BITMAP(dest_map, KVM_MAX_VCPUS); | ||
46 | }; | ||
47 | |||
37 | struct kvm_ioapic { | 48 | struct kvm_ioapic { |
38 | u64 base_address; | 49 | u64 base_address; |
39 | u32 ioregsel; | 50 | u32 ioregsel; |
@@ -47,6 +58,7 @@ struct kvm_ioapic { | |||
47 | void (*ack_notifier)(void *opaque, int irq); | 58 | void (*ack_notifier)(void *opaque, int irq); |
48 | spinlock_t lock; | 59 | spinlock_t lock; |
49 | DECLARE_BITMAP(handled_vectors, 256); | 60 | DECLARE_BITMAP(handled_vectors, 256); |
61 | struct rtc_status rtc_status; | ||
50 | }; | 62 | }; |
51 | 63 | ||
52 | #ifdef DEBUG | 64 | #ifdef DEBUG |