[Hyper-V] x86/ioapic: Disable interrupts when re-routing legacy IRQs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Trusty |
Invalid
|
High
|
Unassigned | ||
Vivid |
Invalid
|
High
|
Unassigned | ||
Wily |
Fix Released
|
High
|
Unassigned |
Bug Description
A sporadic hang with consequent crash is observed when booting Hyper-V Gen1 guests...
Sauce request for upstream submission:
https:/
From Vitaly Kuznetsov <>
Subject [PATCH] x86/ioapic: Disable interrupts when re-routing legacy IRQs
Date Thu, 15 Oct 2015 19:42:23 +0200
A sporadic hang with consequent crash is observed when booting Hyper-V Gen1
guests:
Call Trace:
<IRQ>
[<ffffffff810
[<ffffffff810
[<ffffffff813
...
<EOI>
[<ffffffff814
[<ffffffff810
[<ffffffff810
[<ffffffff810
[<ffffffff810
[<ffffffff810
[<ffffffff810
[<ffffffff810
[<ffffffff810
[<ffffffff810
[<ffffffff817
...
[<ffffffff814
The issue is easily reproducible with a simple instrumentation: if
mdelay(10) is put between mp_setup_entry() and mp_register_
in mp_irqdomain_
IRQ0. The issue seems to be caused by the fact that we don't disable
interrupts while doing IOPIC programming for legacy IRQs and IRQ0 actually
happens. Decorate manipulations with legacy IRQs with local_irq_save()/
local_irq_
Cc: Thomas Gleixner <email address hidden>
Cc: Ingo Molnar <email address hidden>
Cc: "H. Peter Anvin" <email address hidden>
Cc: Jiang Liu <email address hidden>
Cc: Yinghai Lu <email address hidden>
Cc: K. Y. Srinivasan <email address hidden>
Signed-off-by: Vitaly Kuznetsov <email address hidden>
---
It may make sense to have interrupts disabled for non-legacy IRQs as well
but I'm unaware of any bugs with them at this moment.
---
arch/x86/
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/
index 5c60bb1..9aac777 100644
--- a/arch/
+++ b/arch/
@@ -2907,6 +2907,7 @@ int mp_irqdomain_
struct irq_data *irq_data;
struct mp_chip_data *data;
struct irq_alloc_info *info = arg;
+ unsigned long flags = 0;
if (!info || nr_irqs > 1)
return -EINVAL;
@@ -2939,11 +2940,16 @@ int mp_irqdomain_
cfg = irqd_cfg(irq_data);
add_pin_
+
+ if (virq < nr_legacy_irqs())
+ local_irq_
if (info->
mp_setup_
mp_register_
- if (virq < nr_legacy_irqs())
+ if (virq < nr_legacy_irqs()) {
legacy_
+ local_irq_
+ }
apic_
"IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> IRQ %d Mode:%i Active:%i Dest:%d)\n",
--
2.4.3
Changed in linux-kernel (Ubuntu): | |
status: | New → Confirmed |
affects: | linux-kernel (Ubuntu) → linux (Ubuntu) |
Changed in linux (Ubuntu): | |
importance: | Undecided → High |
status: | Confirmed → Triaged |
tags: | added: kernel-hyper-v |
tags: | added: trusty vivid wily |
Changed in linux (Ubuntu Trusty): | |
status: | New → In Progress |
Changed in linux (Ubuntu Vivid): | |
status: | New → In Progress |
Changed in linux (Ubuntu Wily): | |
status: | New → In Progress |
Changed in linux (Ubuntu Trusty): | |
importance: | Undecided → High |
Changed in linux (Ubuntu Vivid): | |
importance: | Undecided → High |
Changed in linux (Ubuntu Wily): | |
importance: | Undecided → High |
Changed in linux (Ubuntu Trusty): | |
assignee: | nobody → Joseph Salisbury (jsalisbury) |
Changed in linux (Ubuntu Vivid): | |
assignee: | nobody → Joseph Salisbury (jsalisbury) |
Changed in linux (Ubuntu Wily): | |
assignee: | nobody → Joseph Salisbury (jsalisbury) |
Changed in linux (Ubuntu Vivid): | |
status: | Incomplete → In Progress |
Changed in linux (Ubuntu Trusty): | |
status: | Incomplete → In Progress |
Changed in linux (Ubuntu Wily): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu): | |
status: | Triaged → In Progress |
assignee: | nobody → Joseph Salisbury (jsalisbury) |
tags: |
added: verification-done-wily removed: verification-needed-wily |
Changed in linux (Ubuntu Trusty): | |
status: | In Progress → Invalid |
Changed in linux (Ubuntu Vivid): | |
status: | In Progress → Invalid |
Changed in linux (Ubuntu): | |
status: | In Progress → Fix Released |
Argh, this should be in linux-kernel, not systemd.