From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: nmi is broken? Date: Thu, 28 Apr 2011 12:59:09 +0300 Message-ID: <4DB93A6D.3010703@redhat.com> References: <87sjtbe7fz.fsf@devron.myhome.or.jp> <877hak1t1s.fsf@devron.myhome.or.jp> <4DB3C6D3.9040703@redhat.com> <4DB41696.6060606@web.de> <4DB7DA11.8040503@redhat.com> <871v0njhab.fsf@devron.myhome.or.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , kvm@vger.kernel.org To: OGAWA Hirofumi Return-path: Received: from mx1.redhat.com ([209.132.183.28]:31546 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751244Ab1D1J7P (ORCPT ); Thu, 28 Apr 2011 05:59:15 -0400 In-Reply-To: <871v0njhab.fsf@devron.myhome.or.jp> Sender: kvm-owner@vger.kernel.org List-ID: On 04/28/2011 04:28 AM, OGAWA Hirofumi wrote: > Avi Kivity writes: > > > On 04/24/2011 03:24 PM, Jan Kiszka wrote: > >> > > >> > This would cause IRQs to be delivered even if the PIT is masked, no? > >> > >> I checked the patch and our code again: NMI watchdog masking is managed > >> via arch.vapics_in_nmi_mode and by re-checking the per-APIC mask > >> situation in kvm_apic_local_deliver when delivering the NMI. > >> > >> So the patch looks correct - NMIs aren't acked like timer IRQs, the > >> current logic is definitely wrong. > > > > Can you elaborate? Why aren't NMIs acked (if delivered via the PIC)? > > Is the PIC programmed into auto-EOI mode or something? > > This seems to be complex stuff depending on hardware configurations. I'm > not fully understanding though, current state of it is, > > Yes, PIC is in AEOI mode if linux is using IO-APIC. Um.., kvm says > irq == 0 is mp_INT mode in MADT, not mp_ExtINT. That is correct, kvm doesn't connect the master 8259 output to the IOAPIC. Instead the 8259 is connected to LINT0 (which is configured for ExtInt when the IOAPIC is disabled, or for NMI which the NMI watchdog is enabled). However, now I can't see how it would work. auto EOI works on the INTA cycle, which would only occur if LINT0 is configured for ExtInt. If it is configured for NMI, I don't think it would issue the INTA cycle. So the NMI watchdog not working is actually correct for our hardware configuration! But I may be misunderstanding something here. > So I guess system does > automatically INTA cycle (and AEOI because of PIC config), or not > connected via 8259A? (like in mpspec figure 5-2.) > > To checking it, I've tested in check_timer() of linux on the physical > machine (irq==0 and mp_INT). The test is something like, > > if (pin1 != -1) { > /* > * Ok, does IRQ0 through the IOAPIC work? > */ > unmask_IO_APIC_irq(0); > disable_8259_irq(0); > if (timer_irq_works()) { > > even if I called disable_8259_irq(0), timer was still working via > IO-APIC. > > Would this explain why? Sorry, I got lost - what does this explain? -- error compiling committee.c: too many arguments to function