From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH 04/10] Support for device capability Date: Wed, 4 Mar 2009 10:56:36 +0800 Message-ID: <200903041056.36603.sheng@linux.intel.com> References: <1235982573-6932-1-git-send-email-sheng@linux.intel.com> <1235982573-6932-5-git-send-email-sheng@linux.intel.com> <20090303124207.GA15492@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Anthony Liguori , kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from mga06.intel.com ([134.134.136.21]:34292 "EHLO orsmga101.jf.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751463AbZCDC4n (ORCPT ); Tue, 3 Mar 2009 21:56:43 -0500 In-Reply-To: <20090303124207.GA15492@amt.cnet> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Tuesday 03 March 2009 20:42:07 Marcelo Tosatti wrote: > Hi Sheng, > > On Mon, Mar 02, 2009 at 04:29:27PM +0800, Sheng Yang wrote: > > This framework can be easily extended to support device capability, like > > MSI/MSI-x. > > > > Signed-off-by: Sheng Yang > > --- > > qemu/hw/pci.c | 85 > > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ qemu/hw/pci.h | > > 30 ++++++++++++++++++++ > > 2 files changed, 115 insertions(+), 0 deletions(-) > > > > > > @@ -205,6 +215,15 @@ struct PCIDevice { > > > > /* Current IRQ levels. Used internally by the generic PCI code. */ > > int irq_state[4]; > > + > > + /* Device capability configuration space */ > > + struct { > > + int supported; > > + uint8_t config[PCI_CAPABILITY_CONFIG_MAX_LENGTH]; > > + unsigned int start, length; > > + PCICapConfigReadFunc *config_read; > > + PCICapConfigWriteFunc *config_write; > > + } cap; > > }; > > Why do you have a copy of the capabilities config space? Why not just > access PCIDevice->config directly? I am not sure upstream would accept which. Separate the logic seems more clear and easy to accept to me... -- regards Yang, Sheng