From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH 2/5] qemu-kvm: msix: Only invoke msix_handle_mask_update on changes Date: Tue, 18 Oct 2011 15:49:21 +0200 Message-ID: <20111018134921.GA4946@redhat.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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , Marcelo Tosatti , "kvm@vger.kernel.org" To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:65256 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932168Ab1JRNsQ (ORCPT ); Tue, 18 Oct 2011 09:48:16 -0400 Content-Disposition: inline In-Reply-To: <20111018132043.GR28776@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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? -- MST