From nobody Thu Jan 18 23:39:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGK321F16z57HfN; Thu, 18 Jan 2024 23:39:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TGK316KqFz4Sgm; Thu, 18 Jan 2024 23:39:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705621165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MkXc0jqR0xgQ6JfT2RdoZqPuMGT8CUeDOg8u1M+JkpU=; b=ywNVg9WheSLRPVrSP/pG3zuLhJkwiIyiGB+P1U3+MiCZuh+jeAFM3f1NXLlj5S8qOv0LSg DAAThSwli6wFvr8H0Sxy6tW0UJ9lNildU32xoDCW3ebLkqoPw+Rla11F9u5gd8POKAuiAD CKyQZro9idcSOgs6n8NNFDuans4Hzrjkl5yrB2qW60tuSzpgTa2yN0uv7mgMeDJt997NsZ VYNJjgXL06n+7pTwyQCJKVM1yXTEGWnsweoHWMk0YiMXnlD8jB6JDLeGf2HZzFQKkhjxTh OvtjEbV9f4KEFQzn4n0ha9Noy8cTY+krGq0vzgcTq6O0vXKRlfj4X5uh1isDMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705621165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MkXc0jqR0xgQ6JfT2RdoZqPuMGT8CUeDOg8u1M+JkpU=; b=iQ1cHF9bJbH8BsJMwTQmJ954lp791lB/ZmphOgOvW0GPEEvDsb+y7uPCKMN+3JPL/KkVhN HCVpLp3ZoL+f5/BGHKKnnh3cCCvVkR+7NuvtFLDap0q+/O/cX3FmAQ1zHw5Yla+PzpgcRI Ay0KQP02idNEtDAAlp6yi7nTJcyX70ep0c9gTaaAegR+eukEvTxWa84e3NpIJUYoQhtKGS vv9a0Zc5MSGGHKB9QYrL5fkTVtA6UyXK3SlDbd5Kj+FNaChKqCN9SwpspEysSGM9tbqA0Z MeqW9ZjPFoq3xSwJXfnfI95pI4NLC3ggLqRCZ2wARo1O4ybZjg54KjN/Dyt8XQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705621165; a=rsa-sha256; cv=none; b=GBwPDOSRZ0b/0+RymGMGo6kFJ5wak5oehRlb9e6ezOs+RtQBBfQSH+YJdSIV8hsFFCPupz PJOrEkGaFGcW17+Xrx/sQOrQnyisnmhDg0PezpCBYCE14tmdiYw8Atn5gveFYxdQQ0tgDb rnraZlaXlbsvE90MLatrASCSIuHNkzLoGsqF6Lbx4KArMNJTfsQ5QBjRd6PGynXzj/vD5w 8QSOE2Pid4FjvziY6mzJoYLKFxtdyy/gQuNOJJ9slAMyNQkt+Viwfw0n/ncWv9kPMKPTVi J9Fudd4CkrPL//8SkuzWwY2+cd9NuW8fJznQpBKQaItLwO7AoRGbmx8hayEN7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TGK315RjnzRtZ; Thu, 18 Jan 2024 23:39:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40INdP5N011909; Thu, 18 Jan 2024 23:39:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40INdPIj011906; Thu, 18 Jan 2024 23:39:25 GMT (envelope-from git) Date: Thu, 18 Jan 2024 23:39:25 GMT Message-Id: <202401182339.40INdPIj011906@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 122ac7ca1424 - stable/13 - x86: Adjust base addr for PCI MCFG regions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 122ac7ca14244a865a2252c853f3601816398a95 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=122ac7ca14244a865a2252c853f3601816398a95 commit 122ac7ca14244a865a2252c853f3601816398a95 Author: Colin Percival AuthorDate: 2023-12-27 08:09:08 +0000 Commit: John Baldwin CommitDate: 2024-01-18 23:27:25 +0000 x86: Adjust base addr for PCI MCFG regions Each bus gets 1 MB of address space; the actual base address for an MCFG bus range is the address from the table plus the starting bus number times 1 MB. The PCI spec is unclear on this point, but this change matches what Linux does, which is likely enough of a de facto standard regardless of what any de jure standard might attempt to say. Fixes: f54a3890b1f4 ("x86: Support multiple PCI MCFG regions") Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D43206 (cherry picked from commit 61e2161367bb4e68e603f53b1107f9427f988861) --- sys/amd64/pci/pci_cfgreg.c | 2 +- sys/i386/pci/pci_cfgreg.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/amd64/pci/pci_cfgreg.c b/sys/amd64/pci/pci_cfgreg.c index 0f591cb0112a..e026eb57c413 100644 --- a/sys/amd64/pci/pci_cfgreg.c +++ b/sys/amd64/pci/pci_cfgreg.c @@ -298,7 +298,7 @@ pcie_cfgregopen(uint64_t base, uint16_t domain, uint8_t minbus, uint8_t maxbus) region = &mcfg_regions[mcfg_numregions]; /* XXX: We should make sure this really fits into the direct map. */ - region->base = pmap_mapdev_pciecfg(base, (maxbus + 1 - minbus) << 20); + region->base = pmap_mapdev_pciecfg(base + (minbus << 20), (maxbus + 1 - minbus) << 20); region->domain = domain; region->minbus = minbus; region->maxbus = maxbus; diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c index 231205dde28c..d5896c0d4583 100644 --- a/sys/i386/pci/pci_cfgreg.c +++ b/sys/i386/pci/pci_cfgreg.c @@ -575,7 +575,7 @@ pcie_cfgregopen(uint64_t base, uint16_t domain, uint8_t minbus, uint8_t maxbus) sizeof(*mcfg_regions) * (mcfg_numregions + 1), M_DEVBUF, M_WAITOK); region = &mcfg_regions[mcfg_numregions]; - region->base = base; + region->base = base + (minbus << 20); region->domain = domain; region->minbus = minbus; region->maxbus = maxbus;