From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [Qemu-devel] KVM: Windows 64-bit troubles with user space irqchip Date: Sun, 6 Feb 2011 12:28:23 +0200 Message-ID: <20110206102823.GA14984@redhat.com> References: <4D49738D.7080404@redhat.com> <4D4979BD.6080900@siemens.com> <20110202154611.GR14984@redhat.com> <4D497DAB.7010901@siemens.com> <4D4A64F2.8010309@redhat.com> <4D4A7629.1010506@siemens.com> <20110203100407.GA2449@amt.cnet> <4D4A7F4B.6050406@siemens.com> <20110203141537.GY14984@redhat.com> <4D4E7760.2050601@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kiszka , Marcelo Tosatti , kvm , qemu-devel To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:29614 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751956Ab1BFK21 (ORCPT ); Sun, 6 Feb 2011 05:28:27 -0500 Content-Disposition: inline In-Reply-To: <4D4E7760.2050601@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Feb 06, 2011 at 12:26:40PM +0200, Avi Kivity wrote: > On 02/03/2011 04:15 PM, Gleb Natapov wrote: > >> > >> Maybe this is true for the in-kernel model, but I don't see the issue > >> (anymore) for the way user space works. > >> > >With patch below I can boot Windows7. > > > >diff --git a/hw/apic.c b/hw/apic.c > >index 146deca..fdcac88 100644 > >--- a/hw/apic.c > >+++ b/hw/apic.c > >@@ -600,7 +600,7 @@ int apic_get_interrupt(DeviceState *d) > > intno = get_highest_priority_int(s->irr); > > if (intno< 0) > > return -1; > >- if (s->tpr&& intno<= s->tpr) > >+ if ((s->tpr>> 4)&& (intno>> 4)<= (s->tpr>> 4)) > > return s->spurious_vec& 0xff; > > reset_bit(s->irr, intno); > > set_bit(s->isr, intno); > > That still allows interrupts that have higher priority than the TPR, > but lower priority than interrupts in the ISR to be injected. I > think we need to use the PPR here (same as apic_update_irq()). > We shouldn't get here if isr is non-empty, but see the patch I posted today to qemu-devel. It does what you say anyway. -- Gleb.