From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 2/7] qemu-kvm: Rename kvm_msix_message to KVMMsiMessage Date: Wed, 27 Apr 2011 17:40:56 +0300 Message-ID: <4DB82AF8.3030305@redhat.com> References: <34c1e72dbc96d7a3f03f064093d101e2f4cb03b2.1303554218.git.jan.kiszka@web.de> <20110427133400.GH15788@redhat.com> <4DB8227C.9030907@siemens.com> <4DB82836.9000708@redhat.com> <4DB828A3.5050804@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "Michael S. Tsirkin" , Marcelo Tosatti , "kvm@vger.kernel.org" To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:20482 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750988Ab1D0OlC (ORCPT ); Wed, 27 Apr 2011 10:41:02 -0400 In-Reply-To: <4DB828A3.5050804@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: On 04/27/2011 05:30 PM, Jan Kiszka wrote: > On 2011-04-27 16:29, Avi Kivity wrote: > > On 04/27/2011 05:04 PM, Jan Kiszka wrote: > >>> > >>> I put kvm_msix_message in pci.h to avoid having every pci device pull in kvm.h > >>> is anything wrong with that? Maybe just rename it to make it generic > >>> for msi and leave if where it is. > >> > >> kvm.h shall provide kvm related types, not some unrelated header. That's > >> even more important with MSI support for non-PCI devices (aka HPET). > > > > We could have an MSIMessage type that abstracts the general facility, > > and let it embed a KVMMsiMessage that contains just the gsi. > > Yes, likely also useful for generic MSI delivery services that bypass > stl_phys. > Right, so you can cache the phys_page and apic lookups. A different layer in which to accomplish this is to have a per-device tlb. So we'd have CachedPhysicalAddress msi_fsb_tlb; stl_phys_tlb(&msi_fsb_cache, addr, data); which caches the addr lookup in a 1-entry tlb. If we have many non-msi repeated device writes to the same address, this might be worthwhile. From a quick look at the code, I don't think we do, though. -- error compiling committee.c: too many arguments to function