From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH 1/3] KVM: x86: Relax accept conditions of kvm_apic_accept_pic_intr Date: Fri, 17 Oct 2008 13:11:10 +0800 Message-ID: <200810171311.11309.sheng@linux.intel.com> References: <20081015142748.385784583@mchn012c.ww002.siemens.net> <20081015142748.606503565@mchn012c.ww002.siemens.net> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , avi@redhat.com, jiajun.xu@intel.com To: kvm@vger.kernel.org Return-path: Received: from mga09.intel.com ([134.134.136.24]:54751 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991AbYJQFMx (ORCPT ); Fri, 17 Oct 2008 01:12:53 -0400 In-Reply-To: <20081015142748.606503565@mchn012c.ww002.siemens.net> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Wednesday 15 October 2008 22:27:49 Jan Kiszka wrote: > Aligning in-kernel kvm_apic_accept_pic_intr with its user space mate, > this patch relaxes the conditions under which PIC IRQs are accepted > by LVT0. This reflects reality and allows to reuse the service for the > NMI watchdog use case. > > Signed-off-by: Jan Kiszka > --- > arch/x86/kvm/lapic.c | 13 ++++--------- > 1 file changed, 4 insertions(+), 9 deletions(-) > > Index: b/arch/x86/kvm/lapic.c > =================================================================== > --- a/arch/x86/kvm/lapic.c > +++ b/arch/x86/kvm/lapic.c > @@ -1072,16 +1072,11 @@ int kvm_apic_has_interrupt(struct kvm_vc > int kvm_apic_accept_pic_intr(struct kvm_vcpu *vcpu) > { > u32 lvt0 = apic_get_reg(vcpu->arch.apic, APIC_LVT0); > - int r = 0; > > - if (vcpu->vcpu_id == 0) { > - if (!apic_hw_enabled(vcpu->arch.apic)) > - r = 1; > - if ((lvt0 & APIC_LVT_MASKED) == 0 && > - GET_APIC_DELIVERY_MODE(lvt0) == APIC_MODE_EXTINT) > - r = 1; > - } > - return r; > + if (!apic_hw_enabled(vcpu->arch.apic) || > + (lvt0 & APIC_LVT_MASKED) == 0) > + return 1; > + return 0; > } > > void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu) > (sorry for late review...) Thanks to find out the root cause of BSOD! But I am a little concern about this change. As you know, PIC only connect to cpu0. So I think it's not proper to make it generic. Maybe you can use kvm_apic_accept_pic_intr(vcpu0) in later patch? -- regards Yang, Sheng