From patchwork Mon Jun 11 18:07:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 164232 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1CB36B6FD7 for ; Tue, 12 Jun 2012 04:07:07 +1000 (EST) Received: from localhost ([::1]:46503 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Se916-0001bF-Sf for incoming@patchwork.ozlabs.org; Mon, 11 Jun 2012 14:07:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Se90v-0001Wo-Fd for qemu-devel@nongnu.org; Mon, 11 Jun 2012 14:06:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Se90t-00083p-I8 for qemu-devel@nongnu.org; Mon, 11 Jun 2012 14:06:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Se90t-00083L-A2 for qemu-devel@nongnu.org; Mon, 11 Jun 2012 14:06:51 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5BI6mY0022730 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 11 Jun 2012 14:06:48 -0400 Received: from redhat.com (vpn1-5-168.ams2.redhat.com [10.36.5.168]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q5BI6kqH019677; Mon, 11 Jun 2012 14:06:46 -0400 Date: Mon, 11 Jun 2012 21:07:19 +0300 From: "Michael S. Tsirkin" To: Anthony Liguori Message-ID: <20120611180717.GA7829@redhat.com> References: <20120607163830.GA13873@redhat.com> <4FD627D9.5060601@codemonkey.ws> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4FD627D9.5060601@codemonkey.ws> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id q5BI6mY0022730 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: jan.kiszka@siemens.com, fernando@oss.ntt.co.jp, jbaron@redhat.com, qemu-devel@nongnu.org, kakuta.hayato@oss.ntt.co.jp Subject: Re: [Qemu-devel] [PULL] rtl8139,pci,msi X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On Mon, Jun 11, 2012 at 12:16:09PM -0500, Anthony Liguori wrote: > On 06/07/2012 11:38 AM, Michael S. Tsirkin wrote: > >The following changes since commit 8cc9b43f7c5f826b39af4b012ad89bb55faac29c: > > > > target-microblaze: lwx/swx: first implementation (2012-06-04 10:19:46 +0200) > > > >are available in the git repository at: > > > > git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_anthony > > > >for you to fetch changes up to 11e02c393109508fde4d99650f003dd2d6029bc5: > > > > pci_bridge_dev: fix error path in pci_bridge_dev_initfn() (2012-06-07 17:19:01 +0300) > > > >---------------------------------------------------------------- > >rtl8139,pci,msi > > > >This pull includes a bugfix for rtl8139 (this is independent of > >Jason Wang's fix which Anthony has merged) and pci bridge hotplug bugfixes. > >Further there are MSI/MSIX fixes and changes by Jan which should > >also help merging device assignment down the road. > > > >Signed-off-by: Michael S. Tsirkin > > > >---------------------------------------------------------------- > >Fernando Luis Vazquez Cao (1): > > rtl8139: honor RxOverflow flag in can_receive method > > > >Jan Kiszka (9): > > ahci: Fix reset of MSI function > > intel-hda: Fix reset of MSI function > > ahci: Clean up reset functions > > msi: Guard msi_reset with msi_present > > msi: Invoke msi/msix_reset from PCI core > > msi: Guard msi/msix_write_config with msi_present > > msi: Invoke msi/msix_write_config from PCI core > > msi: Use msi/msix_present more consistently > > msix: Drop unused msix_bar_size > > This last commit made GCC unhappy. > > CC libhw64/hw/msix.o > /home/anthony/git/qemu/hw/msix.c: In function ‘msix_add_config’: > /home/anthony/git/qemu/hw/msix.c:58:14: error: variable ‘new_size’ > set but not used [-Werror=unused-but-set-variable] > cc1: all warnings being treated as errors > > Regards, > > Anthony Liguori Something like the following will be needed on top. I'll fix it up but for now will drop this and resend pull request. diff --git a/hw/msix.c b/hw/msix.c index 2b86cdf..b64f109 100644 --- a/hw/msix.c +++ b/hw/msix.c @@ -55,21 +55,15 @@ static int msix_add_config(struct PCIDevice *pdev, unsigned short nentries, { int config_offset; uint8_t *config; - uint32_t new_size; if (nentries < 1 || nentries > PCI_MSIX_FLAGS_QSIZE + 1) return -EINVAL; if (bar_size > 0x80000000) return -ENOSPC; - /* Add space for MSI-X structures */ - if (!bar_size) { - new_size = MSIX_PAGE_SIZE; - } else if (bar_size < MSIX_PAGE_SIZE) { - bar_size = MSIX_PAGE_SIZE; - new_size = MSIX_PAGE_SIZE * 2; - } else { - new_size = bar_size * 2; + /* Require aligned offset for MSI-X structures */ + if (bar_size & ~(MSIX_PAGE_SIZE - 1)) { + return -EINVAL; } config_offset = pci_add_capability(pdev, PCI_CAP_ID_MSIX,