[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 21/23] apic: Reevaluate pending interrupts on LVT_LI
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 21/23] apic: Reevaluate pending interrupts on LVT_LINT0 changes |
Date: |
Tue, 21 Aug 2012 12:05:55 -0500 |
From: Jan Kiszka <address@hidden>
When the guest modifies the LVT_LINT0 register, we need to check if some
pending PIC interrupt can now be delivered.
Signed-off-by: Jan Kiszka <address@hidden>
Signed-off-by: Avi Kivity <address@hidden>
(cherry picked from commit a94820ddc36f8c452b37f9dcb323f55ffdbc75f9)
Signed-off-by: Michael Roth <address@hidden>
---
hw/apic.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/hw/apic.c b/hw/apic.c
index ec8f9ba..e96402d 100644
--- a/hw/apic.c
+++ b/hw/apic.c
@@ -540,6 +540,15 @@ static void apic_deliver(DeviceState *d, uint8_t dest,
uint8_t dest_mode,
apic_bus_deliver(deliver_bitmask, delivery_mode, vector_num, trigger_mode);
}
+static bool apic_check_pic(APICCommonState *s)
+{
+ if (!apic_accept_pic_intr(&s->busdev.qdev) || !pic_get_output(isa_pic)) {
+ return false;
+ }
+ apic_deliver_pic_intr(&s->busdev.qdev, 1);
+ return true;
+}
+
int apic_get_interrupt(DeviceState *d)
{
APICCommonState *s = DO_UPCAST(APICCommonState, busdev.qdev, d);
@@ -567,9 +576,7 @@ int apic_get_interrupt(DeviceState *d)
apic_sync_vapic(s, SYNC_TO_VAPIC);
/* re-inject if there is still a pending PIC interrupt */
- if (apic_accept_pic_intr(&s->busdev.qdev) && pic_get_output(isa_pic)) {
- apic_deliver_pic_intr(&s->busdev.qdev, 1);
- }
+ apic_check_pic(s);
apic_update_irq(s);
@@ -812,8 +819,11 @@ static void apic_mem_writel(void *opaque,
target_phys_addr_t addr, uint32_t val)
{
int n = index - 0x32;
s->lvt[n] = val;
- if (n == APIC_LVT_TIMER)
+ if (n == APIC_LVT_TIMER) {
apic_timer_update(s, qemu_get_clock_ns(vm_clock));
+ } else if (n == APIC_LVT_LINT0 && apic_check_pic(s)) {
+ apic_update_irq(s);
+ }
}
break;
case 0x38:
--
1.7.9.5
- [Qemu-devel] [PATCH 09/23] ehci: don't flush cache on doorbell rings., (continued)
- [Qemu-devel] [PATCH 09/23] ehci: don't flush cache on doorbell rings., Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 12/23] usb-redir: Correctly handle the usb_redir_babble usbredir status, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 16/23] check-qjson: add test for large JSON objects, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 17/23] slirp: Enforce host-side user of smb share, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 15/23] json-parser: don't replicate tokens at each level of recursion, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 19/23] slirp: Improve error reporting of inaccessible smb directories, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 23/23] update VERSION for 1.1.2, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 22/23] apic: Defer interrupt updates to VCPU thread, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 20/23] apic: Resolve potential endless loop around apic_update_irq, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 18/23] slirp: Ensure smbd and shared directory exist when enable smb, Michael Roth, 2012/08/21
- [Qemu-devel] [PATCH 21/23] apic: Reevaluate pending interrupts on LVT_LINT0 changes,
Michael Roth <=