Skip to content

Commit

Permalink
KVM: Introduce struct rtc_status
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Gleb Natapov <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>
  • Loading branch information
Yang Zhang authored and matosatti committed Apr 16, 2013
1 parent 1fcc789 commit 8dc6aad
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions virt/kvm/ioapic.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ struct kvm_vcpu;
#define IOAPIC_INIT 0x5
#define IOAPIC_EXTINT 0x7

#ifdef CONFIG_X86
#define RTC_GSI 8
#else
#define RTC_GSI -1U
#endif

struct rtc_status {
int pending_eoi;
DECLARE_BITMAP(dest_map, KVM_MAX_VCPUS);
};

struct kvm_ioapic {
u64 base_address;
u32 ioregsel;
Expand All @@ -47,6 +58,7 @@ struct kvm_ioapic {
void (*ack_notifier)(void *opaque, int irq);
spinlock_t lock;
DECLARE_BITMAP(handled_vectors, 256);
struct rtc_status rtc_status;
};

#ifdef DEBUG
Expand Down

0 comments on commit 8dc6aad

Please sign in to comment.