From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH v2 0/9] qemu-kvm: Clean up and enhance MSI irqchip support Date: Wed, 27 Apr 2011 17:11:34 +0300 Message-ID: <20110427141134.GM15788@redhat.com> References: <4DB7DB24.8060403@siemens.com> <4DB7DC11.1010308@redhat.com> <4DB7DC8B.1030402@siemens.com> <4DB7DE7A.4000608@redhat.com> <4DB7FC21.8000203@siemens.com> <4DB80826.5010706@redhat.com> <4DB81AA4.9060904@siemens.com> <4DB81C8F.1070205@redhat.com> <4DB8201C.1000607@siemens.com> <4DB821A5.70306@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kiszka , Marcelo Tosatti , "kvm@vger.kernel.org" To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:52826 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932815Ab1D0OLw (ORCPT ); Wed, 27 Apr 2011 10:11:52 -0400 Content-Disposition: inline In-Reply-To: <4DB821A5.70306@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Apr 27, 2011 at 05:01:09PM +0300, Avi Kivity wrote: > On 04/27/2011 04:54 PM, Jan Kiszka wrote: > >>> > >>> I was planning for a MSI short-path anyway. Also for TCG, it's pointless > >>> to go through lengthy stl_phys if we know it's supposed to be an MSI > >>> message. > >> > >> I don't think tcg will see much benefit; the decoding path through > >> hw/apic.c isn't complicated. > > > >stl_phys itself is non-trivial, e.g. due to phys_page_find. > > That is true. But consider that MSI delivery has to emulate > interrupt injection through the IDT... > > >> > >> Maybe an intermediate solution is to move kvm_hpet_msi_update() (with a > >> neutral name) into msi.c and have hpet call it whenever things change. > >> So hpet.c isn't aware of kvm directly. > > > >Without caching, you need per-vector tracking to refresh or drop routes. > >That's what the hooks are about. > > Right, my proposal doesn't really change your code, it simply moves > the kvm specific parts away from hpet.c. Instead of a general > cache, the caller is supposed to provide a unique KVMMsiMessage per > msi vector, so there is no cache management. > > >Intermediate solutions (like hacking msi.c now) are one thing. We also > >have to know where we can go to long-term. > > The really general case (allow generating an MSI via DMA, or allow > the device to write to non-MSI addresses via MSI generation) needs > the full blown cache. But while I've seen these techniques actually > used, I hope they're rare. You have? What uses these? As you pointed out earlier, we can make DMA to MSI work, slowly, by using a single gsi per apic. For the reverse, it's probably easiest to make it work by handling MSI outside the APIC range as a store in the kvm module in kernel. > -- > error compiling committee.c: too many arguments to function