From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH 2/7] qemu-kvm: Rename kvm_msix_message to KVMMsiMessage Date: Wed, 27 Apr 2011 16:47:24 +0200 Message-ID: <4DB82C7C.2090106@siemens.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> <4DB82AF8.3030305@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "Michael S. Tsirkin" , Marcelo Tosatti , "kvm@vger.kernel.org" To: Avi Kivity Return-path: Received: from thoth.sbs.de ([192.35.17.2]:16896 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751208Ab1D0Orb (ORCPT ); Wed, 27 Apr 2011 10:47:31 -0400 In-Reply-To: <4DB82AF8.3030305@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2011-04-27 16:40, Avi Kivity wrote: > 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. There is no caching need if the messages targets the fixed MSI address window. We can simply pass it directly to the APIC then. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux