Bug 596223
Summary: | Kdump on Intel fails because of misrouted timer IRQs | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Dor Laor <dlaor> |
Component: | kernel | Assignee: | Chris Lalancette <clalance> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Qian Cai <qcai> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 6.0 | CC: | anderson, apevec, clalance, ehabkost, knoel, mikeda, mtosatti, ndai, nhorman, ovirt-maint, pbonzini, phan, qbarnes, qcai, rmitchel, sct, sgrinber, syeghiay, tburke, virt-maint, ykaul |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | see also bug 418501 | ||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | 505527 | Environment: | |
Last Closed: | 2010-11-11 15:45:04 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 524819 |
Comment 1
RHEL Program Management
2010-05-26 12:36:44 UTC
I've been looking at this problem and made some progress, although it's not all encouraging news. I think I've described the basic problem enough, so I'll skip it here and just launch into specifics. In the KVM code, there are a number of places where we make incorrect assumptions regarding the timer and which vcpu to deliver it to: 1) In the i8254.c code when the hrtimer representing the PIT expires. In this case, when we get the callback, we kick only the BSP. 2) In the i8254.c code when a vcpu is migrated from one processor to another. In this case we only migrate the PIT timer if the vcpu to be migrated is the BSP. 3) In the lapic code when deciding whether to accept a PIC interrupt, we only accept interrupts on the BSP. 4) In the irq_comm.c code when calling kvm_irq_delivery_to_apic(). The problem here is that we don't take into account the fact that an LAPIC might be disabled when trying to deliver an interrupt in DM_LOWEST mode. Further, on a kexec, the processor that we are kexec'ing *to* gets it's APIC ID re-written to the BSP APIC ID. What it means in the end is that we are currently still matching against the BSP even though vcpu 1 (where the kexec is happening) would match if we let it. I have a patch currently that can take care of 1), 3), and 4), and works in my testing (it needs to be cleaned up a bit to not be so inefficient, but it should work). However, problem 2) is pretty sticky. The reason we are currently migrating the PIT timer around with the BSP is pretty well explained in commit 2f5997140f22f68f6390c49941150d3fa8a95cb7. With my new patch, though, we are no longer guaranteeing that we are going to inject onto CPU 0. I think we can do something where when the hrtimer expires, we figure out which processor will get the timer interrupt and IPI to that processor to cause the VMEXIT. Unfortunately it's racy because the expiration of the hrtimer is de-coupled from the setting of the IRQ for the interrupt. That means that the hrtimer could expire, we could choose vcpu 2 (say), IPI to cause a VMEXIT, but by the time it goes to VMENTER the guest has changed something in the (IO)APIC(s) so that the set_irq logic chooses vcpu 3 to do the injection. This would result in a delayed injection that 2f5997 is trying to avoid. Taking a step back, it seems to me that something along the lines of my previous patchset (where we do set_irq directly from the hrtimer callback) is the right way to go. We would still need to IPI to the appropriate physical cpu to cause a VMEXIT on the cpu we care about, but we would avoid the race I describe in the previous paragraph. Unfortunately that patchset is also much more risky. Thoughts? I'll also post a similar mail to kvm@ to gauge opinions there, but does anyone have any thoughts here? Chris Lalancette Patch(es) available on kernel-2.6.32-42.el6 Red Hat Enterprise Linux 6.0 is now available and should resolve the problem described in this bug report. This report is therefore being closed with a resolution of CURRENTRELEASE. You may reopen this bug report if the solution does not work for you. |