From nobody Mon Feb 9 18:45:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1557728520; cv=none; d=zoho.com; s=zohoarc; b=BBLj0WHayP7XDihj+Pl2KpJHUKG45JT4FjmmZN3vhPaWPd24dCn0t3nAcZ896EvpwwHCFgmeUAWO5jtkk2uyXLrxx2Cm1SALRGCd7J2cc1CCPjkjCpuo9u4da+4Brz2hxy5osQqxwKbPP3ujkeDdxnjEkNgDL0ptynlvW9DLWww= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557728520; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=5atWVtDhflIa18ucpIZdu3Su2l5W/J+/4BaanR0vFcs=; b=FobB3+uISyFV41Nhq7lDWJIP6do2hrE4AYRsxCk3VVWdUaRROnyiDUjouEVwFxAeJqCxveJuMhazXo8x4MvSGlz0Cm2p22gqIeiLAYiTwj6exDH8HW3ubPMW2auzs80OY9zXBPwD5w0c7DM5ivsSkrDJ5/uRjzpBq6CkZQDDQYM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557728520084352.2096304611068; Sun, 12 May 2019 23:22:00 -0700 (PDT) Received: from localhost ([127.0.0.1]:51752 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQ4LO-0004A1-3f for importer@patchew.org; Mon, 13 May 2019 02:21:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQ4JQ-0002gx-PT 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-0004LA-Mf for qemu-devel@nongnu.org; Mon, 13 May 2019 02:19:48 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:40881) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQ4JO-0004KC-QR; Mon, 13 May 2019 02:19:47 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 452Vz25GCyz9sN1; 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=ArXxfw3U498/kSOjRaZfo1gZZ/LtA1dl87OZ9AXBazU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GlXMtOToiYNABkSywlJFYcsW5hukDnamHlm3PeFXse8o0ddsImq8I12obW8uSmMX8 2SI0okym7I2XrfQ3quBtA1huLfG/LesT0TFZWYY5t+QHMfaN5w/qXbyhiuw4kchvSs Uw0yBm6H9MopFBT2WR5vaS08TFdIrfFbCv7TEeh8= From: David Gibson To: mst@redhat.com, qemu-devel@nongnu.org Date: Mon, 13 May 2019 16:19:35 +1000 Message-Id: <20190513061939.3464-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190513061939.3464-1-david@gibson.dropbear.id.au> References: <20190513061939.3464-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 1/5] pcie: Remove redundant test in pcie_mmcfg_data_{read, write}() 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" These functions have an explicit test for accesses above the device's config size. But pci_host_config_{read,write}_common() which they're about to call already have checks against the config space limit and do the right thing. So, remove the redundant tests. Signed-off-by: David Gibson Reviewed-by: Greg Kurz --- hw/pci/pcie_host.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/hw/pci/pcie_host.c b/hw/pci/pcie_host.c index 553db56778..1ee4945a6d 100644 --- a/hw/pci/pcie_host.c +++ b/hw/pci/pcie_host.c @@ -47,11 +47,6 @@ static void pcie_mmcfg_data_write(void *opaque, hwaddr m= mcfg_addr, } addr =3D PCIE_MMCFG_CONFOFFSET(mmcfg_addr); limit =3D pci_config_size(pci_dev); - if (limit <=3D addr) { - /* conventional pci device can be behind pcie-to-pci bridge. - 256 <=3D addr < 4K has no effects. */ - return; - } pci_host_config_write_common(pci_dev, addr, limit, val, len); } =20 @@ -70,11 +65,6 @@ static uint64_t pcie_mmcfg_data_read(void *opaque, } addr =3D PCIE_MMCFG_CONFOFFSET(mmcfg_addr); limit =3D pci_config_size(pci_dev); - if (limit <=3D addr) { - /* conventional pci device can be behind pcie-to-pci bridge. - 256 <=3D addr < 4K has no effects. */ - return ~0x0; - } return pci_host_config_read_common(pci_dev, addr, limit, len); } =20 --=20 2.21.0