From patchwork Mon May 13 06:19:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 10940315 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8968A912 for ; Mon, 13 May 2019 06:21:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A0C6201B1 for ; Mon, 13 May 2019 06:21:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BE0322A65; Mon, 13 May 2019 06:21:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5FAA5201B1 for ; Mon, 13 May 2019 06:21:15 +0000 (UTC) Received: from localhost ([127.0.0.1]:51750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQ4Kn-00049N-RU for patchwork-qemu-devel@patchwork.kernel.org; Mon, 13 May 2019 02:21:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQ4JQ-0002gy-Tl for qemu-devel@nongnu.org; Mon, 13 May 2019 02:19:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQ4JP-0004LP-Qy for qemu-devel@nongnu.org; Mon, 13 May 2019 02:19:48 -0400 Received: from bilbo.ozlabs.org ([2401:3900:2:1::2]:60419 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQ4JP-0004KJ-0m; Mon, 13 May 2019 02:19:47 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 452Vz22nVVz9sBr; Mon, 13 May 2019 16:19:42 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1557728382; bh=3meNiWKeCMSH1H6VF02jPY1B6QxQ4zMUps7w6jp5uy4=; h=From:To:Cc:Subject:Date:From; b=DsvQDTAmueqKMWF6sUmRw3T9g3pyTKLrylV/A8OUiwJKTo2Wt7V3hNaABtaMwJwBR t5OMT7UioLj25EWAwAqiYf+lTAXJt11cdFIk7W+xkMvECbC1ME5fMiTbOJ7ebjowwG 9rYqunHRuwHg/c6XubqedJwjQLriUWG7sawF8u2w= From: David Gibson To: mst@redhat.com, qemu-devel@nongnu.org Date: Mon, 13 May 2019 16:19:34 +1000 Message-Id: <20190513061939.3464-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PATCH v4 0/5] Simplify some not-really-necessary PCI bus callbacks X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aik@ozlabs.ru, Mark Cave-Ayland , groug@kaod.org, qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP c2077e2c "pci: Adjust PCI config limit based on bus topology" introduced checking the availability of extended config space for PCI-E devices which are in a bus topology that doesn't permit extended config space access (e.g. under PCI-E to PCI then PCI to PCI-E bridges). This caused some problems for the spapr para-virtual PCI bus which _does_ allow extended config space access, despite acting in most ways like a vanilla PCI bus. Greg Kurz made a fix for that which was merged as 1c685a90263 "pci: Allow PCI bus subtypes to support extended config space accesses". While that was an appropriate minimal fix for the 4.0 hard freeze, it was kind of a hack longer term. This series implements a simpler way of handling the extended config space permission, which works for both the normal and weird-PAPR cases. While we're there, we also make other small cleanups to the PCI code. Changes since v3: * Remove a redundant call to pci_find_bus_nr() found during review Changes since v2: * Add some minor additional cleanups (patches 4 & 5) * Minor whitespace tweak to patch 3 David Gibson (5): pcie: Remove redundant test in pcie_mmcfg_data_{read,write}() pci: Simplify pci_bus_is_root() pcie: Simplify pci_adjust_config_limit() pci: Make is_bridge a bool pci: Fold pci_get_bus_devfn() into its sole caller hw/pci-bridge/dec.c | 4 +- hw/pci-bridge/i82801b11.c | 2 +- hw/pci-bridge/pci_bridge_dev.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 6 -- hw/pci-bridge/pcie_pci_bridge.c | 2 +- hw/pci-bridge/pcie_root_port.c | 2 +- hw/pci-bridge/simba.c | 2 +- hw/pci-bridge/xio3130_downstream.c | 2 +- hw/pci-bridge/xio3130_upstream.c | 2 +- hw/pci/pci.c | 115 +++++++++++++--------------- hw/pci/pci_host.c | 13 +--- hw/pci/pcie_host.c | 10 --- hw/ppc/spapr_pci.c | 34 +++----- hw/virtio/virtio-pci.c | 1 + include/hw/pci/pci.h | 4 +- include/hw/pci/pci_bus.h | 20 ++++- 16 files changed, 95 insertions(+), 126 deletions(-)