From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH 2/5] qemu-kvm: msix: Only invoke msix_handle_mask_update on changes Date: Tue, 18 Oct 2011 15:52:39 +0200 Message-ID: <4E9D84A7.3000609@siemens.com> References: <20111018114331.GE28776@redhat.com> <4E9D68EF.7070703@siemens.com> <20111018121128.GI28776@redhat.com> <4E9D6F8E.3040808@siemens.com> <20111018123709.GL28776@redhat.com> <4E9D749C.8080604@siemens.com> <20111018132043.GR28776@redhat.com> <20111018134921.GA4946@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Marcelo Tosatti , "kvm@vger.kernel.org" To: "Michael S. Tsirkin" Return-path: Received: from thoth.sbs.de ([192.35.17.2]:23950 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755237Ab1JRNwn (ORCPT ); Tue, 18 Oct 2011 09:52:43 -0400 In-Reply-To: <20111018134921.GA4946@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2011-10-18 15:49, Michael S. Tsirkin wrote: > On Tue, Oct 18, 2011 at 03:20:43PM +0200, Michael S. Tsirkin wrote: >> Ah. Right. Good catch. It's probably best to just make that >> state be !enabled || masked. Like the below? (compiled only): >> >> ---> >> >> msix: track function masked in pci device state >> >> Only go over the table when function is masked. >> This optimization is not really important for qemu.git but helps >> qemu-kvm.git. >> >> Signed-off-by: Michael S. Tsirkin > > ... > >> diff --git a/hw/pci.h b/hw/pci.h >> index 86a81c8..da4c9c3 100644 >> --- a/hw/pci.h >> +++ b/hw/pci.h >> @@ -178,6 +178,8 @@ struct PCIDevice { >> unsigned *msix_entry_used; >> /* Region including the MSI-X table */ >> uint32_t msix_bar_size; >> + /* MSIX function mask set or MSIX disabled */ >> + bool msix_function_masked; >> /* Version id needed for VMState */ >> int32_t version_id; > > BTW, since code checks msix_function_masked consistently, > this also covers the case your other patch addressed, > where there's a table access while msix is disabled, right? Looks like. Not sure about potential side effects of this change to msi_is_masked, but conceptually there should be none. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux