From nobody Thu Jan 18 23:39:16 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 4TGK2r3RQDz57HtF; Thu, 18 Jan 2024 23:39:16 +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 4TGK2r2NFjz4SNX; Thu, 18 Jan 2024 23:39:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705621156; 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=5TRukxK3u+fJ3m7QPOKlda0fL3dAFzSiJQlxZ0nVZ+o=; b=KLQQzMxfMlFIPRX99LJpV3PYeBx9cj9/cvQMKTggIelcmm+rkkG/m9WBIQdexX2Df7M3gS eohmmNkr/WdJPLJEdfAIyQm6TzNyRCuR8+b3MIJ04gShcGFvjBhA6ghD5GI5vAy7FB2sUn 0k0Vdm2IfI5J2w2wdV4PPS0zxNh5q01H0ltugKHg/a4UttI8c2ef04dxxt0RW6xYaIxfv5 s12M54t+I4lXL7rmwkaR/oaSta54k8Yl1ZLf4B5lxjoYbV+cYvP0PaXVWr5kg5bPz9L6tC gJErKVUzLUmhhpZXIUwzHItvRwx74Rk1dYmGojJTqWT5wLAZzq770yfJXS2tuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705621156; 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=5TRukxK3u+fJ3m7QPOKlda0fL3dAFzSiJQlxZ0nVZ+o=; b=GF33d25+93s3WYl32gf0Ks5PTTu4KqLRf4uKQN96MFY2OCWRLXu1AsQoRWwwMI+Em2Qw2T //vDhBIsB/7x5WBw25JuqpmTkhn7RsLncWmD603oynA9pc+RsSDDch3sitTyVNqB+oB94T z31iDmkWwhwRNJHxgoVQ7RbIF0SEJJE0Oy7kRj0i5sau8zZ31fPsWQAKZrHoY3+V6MjGH7 LHK/a4WpQYQ7z3hc7Tv6TO84LUrf6Znkt+WieVakuQ3lQhBNFbPZJb+rvcei42ZlBFloXf xlG8kUmcPqkuo0PPObKkrt4N2Sz8B/FocPgUXW4gUHyM7SmAqXF6cCMBqoMZXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705621156; a=rsa-sha256; cv=none; b=gTK2bciBYxYdHsg+k1K2fdkbqHd9dbrT4YCSdu7X84DkPd8MmoMt+5wCpBAESmkw5mt+QF i9Kl8esoHSmKCQIS4hF8lpAbX1XfEIzenyZ/CMkfNveGWt5UE8+I6Fibg2/tDIYHbr62qM s6nEUCyhzDHgMX6d48ieaHGcmlkiq9ibHy5mZ1Rr+LV4C4ThafK+QuhxQAGtlqbza3oRtg 2h9ylER1cCxt3IMLReP80/a7KhNlqmrU2LSNjIMvU82EZaJUJEBMo0pCxnAOHE1y97duhP rwKdp59tM+NrX4WUd6Y0Gx8sLIykzl94pKl3C60DCVKmpPA99dkSiSBDUwdAGg== 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 4TGK2r0mffzRq8; Thu, 18 Jan 2024 23:39:16 +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 40INdGcL011534; Thu, 18 Jan 2024 23:39:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40INdGh8011531; Thu, 18 Jan 2024 23:39:16 GMT (envelope-from git) Date: Thu, 18 Jan 2024 23:39:16 GMT Message-Id: <202401182339.40INdGh8011531@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: 6a75d3b3fbe4 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 6a75d3b3fbe4c66bf9b8c18db55bba19ffb492e4 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6a75d3b3fbe4c66bf9b8c18db55bba19ffb492e4 commit 6a75d3b3fbe4c66bf9b8c18db55bba19ffb492e4 Author: Colin Percival AuthorDate: 2023-12-27 08:09:08 +0000 Commit: John Baldwin CommitDate: 2024-01-18 23:24:35 +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;