From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [RFC][PATCH 0/2] Fix guest shared interrupt with in-kernel irqchip Date: Thu, 2 Oct 2008 22:06:31 +0800 Message-ID: <20081002140631.GA2783@yukikaze> References: <48E4CC36.70607@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Yang, Sheng" , "'kvm@vger.kernel.org'" To: Avi Kivity Return-path: Received: from ti-out-0910.google.com ([209.85.142.185]:35064 "EHLO ti-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752327AbYJBOGo (ORCPT ); Thu, 2 Oct 2008 10:06:44 -0400 Received: by ti-out-0910.google.com with SMTP id b6so459831tic.23 for ; Thu, 02 Oct 2008 07:06:42 -0700 (PDT) Content-Disposition: inline In-Reply-To: <48E4CC36.70607@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Oct 02, 2008 at 04:27:18PM +0300, Avi Kivity wrote: > Yang, Sheng wrote: >> To deal with guest shared interrupt bug in in-kernel irqchip, we should: >> >> 1. Identify each level trig interrupt source. >> 2. Implement logical OR on the same IRQ line for each interrupt source. >> >> Here I chose a simple method: the caller of kvm_set_irq() has responsiblity >> to identify interrupt sources, and IOAPIC/PIC ensure logical OR on IRQ line. >> > > The downside is that every caller has to do this edge detection. > > How about allocating a vector of u32s (one per irq), and each source > will allocate a bit within this vector. The 'or' operation becomes > (word != 0). Oh, that's what I called the "alternative" one... I just think the request/allocation/free make thing complicate and unnecessary for now, for we are already ensure that kvm_set_irq() are called in pair. I once think if we use resource allocating method, the irqs should bind with the resources, and it's unnecessary. But I think your method is better, reserve one bit for each source on every irq_state make things simpler. OK, I will update the patch following this method. -- regards Yang, Sheng