From patchwork Tue Nov 21 18:36:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 13463461 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D629A5101F for ; Tue, 21 Nov 2023 18:36:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pikMlQn3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0859FC433C7; Tue, 21 Nov 2023 18:36:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700591810; bh=iUIz/SwdoSJeQb7e6Gxw95AuLdR6o8t7aa9vIVBVcl8=; h=From:To:Cc:Subject:Date:From; b=pikMlQn3Oj8RTANE4jzV/LDOk/isKXa2rIbLdcmxJsx1Fd84N6Hs23H/1PtdFQFa8 jgm2HYGPtOPCohu0G0EcSrk+wmjSoKhI2SSZSlLwYUgAFbq5s3uVlQ6Fb94yZuKjEn ctjlmkItYi2GuBXgRx9B9PlNgdUGVh8kVnGAx7nBQJ4+Ise7fvComSyuG5Ipfir0AF C/WCfYG1QbW5bVVM7sOv8HHqfd23Mqbjx/NmZgX3a+9g9j4sHZcOQ2r8uaGVSF/p8g ZuUIX8EX1iErDf3MtAH6CGVW/d5mZ5M02Xoa24W59Zd9SIB12WzOOQKDa/nSXJl59V PnK80iVt2d6Cg== From: Bjorn Helgaas To: linux-pci@vger.kernel.org Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , "Rafael J . Wysocki" , Dan Williams , Kan Liang , Tony Luck , Giovanni Cabiddu , Yunying Sun , Tomasz Pala , Sebastian Manciulea , linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: [PATCH 0/9] x86/pci: Work around lack of ECAM space reservation Date: Tue, 21 Nov 2023 12:36:34 -0600 Message-Id: <20231121183643.249006-1-helgaas@kernel.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bjorn Helgaas The ECAM space described in the ACPI MCFG table should be reserved via a PNP0C02 _CRS method, per PCI Firmware spec (r3.3, sec 4.1.2). Some platforms (at least Supermicro X9DRi-LN4+, HP Proliant ML30 Gen9) do not include these PNP0C02 reservations, and at the same time, they *do* include that space in the PNP0A03 host bridge windows, which makes it available for assignment to PCI devices. In this case, we treat the ECAM space as valid (after fd3a8cff4d4a ("x86/pci: Treat EfiMemoryMappedIO as reservation of ECAM space")), but there was no actual reservation to prevent assignment to PCI devices. This series adds that reservation to prevent assigning ECAM space to PCI BARs, adds more debug logging, changes "MMCONFIG" to "ECAM" to match the spec terminology, and cleans up some coding style. I propose to merge this via the PCI tree for v6.8. Bjorn Helgaas (9): x86/pci: Reserve ECAM if BIOS didn't include it in PNP0C02 _CRS x86/pci: Reword ECAM EfiMemoryMappedIO logging to avoid 'reserved' x86/pci: Add MCFG debug logging x86/pci: Rename 'MMCONFIG' to 'ECAM', use pr_fmt x86/pci: Rename acpi_mcfg_check_entry() to acpi_mcfg_valid_entry() x86/pci: Rename pci_mmcfg_check_reserved() to pci_mmcfg_reserved() x86/pci: Comment pci_mmconfig_insert() obscure MCFG dependency x86/pci: Return pci_mmconfig_add() failure early x86/pci: Reorder pci_mmcfg_arch_map() definition before calls arch/x86/pci/acpi.c | 3 + arch/x86/pci/mmconfig-shared.c | 178 ++++++++++++++++++--------------- arch/x86/pci/mmconfig_32.c | 2 +- arch/x86/pci/mmconfig_64.c | 42 ++++---- 4 files changed, 120 insertions(+), 105 deletions(-)