From nobody Wed Dec 27 21:15:07 2023 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 4T0ktg2z0Wz54MTB; Wed, 27 Dec 2023 21:15:07 +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 4T0ktg2J7Bz4bB7; Wed, 27 Dec 2023 21:15:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703711707; 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=l8Zo2E8/kL4/SG6V28nLyWDFYYBv9nnNlZ42MH4Qyfc=; b=RTsfBESqiTqWtBEyvICKaiKEma4/KQq7g4HsFZldptcUz2w6gk7TbIJWYldUJZ6/IWFyB+ 3nihkfDC8lpepW2517M2OoVTvjXXDKSx9gMvvbK5tigexcp9GSi2qwsA/MrlCxLwFhE9pY KAukVwl+TWTBP/tsgOaSJjIRSwakWSXhz39wOvyR7ZT1Eg0DvMKUdozeQk5+r3LOuUialu keK+7teQEz3uZOJberj8uTeQBLL1edSuld+7xlv/Uzj+OhgjrMK8T1yLQ+n4/cILIuHUlM nsmlg9QThUFSQmdjIBtOEkC4BCDy3Ujm5k/tqW484+Zr8DJyfMlTcBzGoHVL0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703711707; a=rsa-sha256; cv=none; b=kI0ZTggQgiYxzMpe+G72VAb4fxo21o1304XpI1AEQD4KMvif6JZzV0ovi20jOLQ/04mgs0 2JOOo/LXqQTV/y5NWgC2hSw6ndVFAZLXELYhsfTF/a1CT1HNzVItPvw8LGe4+Mp8Zal1ZW eIqX8M3mZvv5Ow5hWB+L9WeQUHuu7CemcT1FDO1FB1y2MaXoSQa0cTRcmEtIM67J+Omk4M PgRmIp3LMUmVdkQT6LnwgHOhzx7/ddz77HJzxxwb1iuqcau9V33pcc1QH+89ZzXf4i1xXH IeDK/HzN3L/d0o+SxNhHWtgEx5sjCKgUmwb6W02W66ZVcyaxETEaR3GpMZaJCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703711707; 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=l8Zo2E8/kL4/SG6V28nLyWDFYYBv9nnNlZ42MH4Qyfc=; b=AmMOqRD2xqNO99/dlwJkwWhou8PGboCG+5pX+XKEmyoX7jTow/S5MXbj+PWCs71AWxmVP/ 3iWHqh/zqqUfCRCXPLfE5jurfgkgzUEnTQkwaQkpr6K3Vm1cjO9NsUIoRLNrW0PaxssmaC ee5TO2pmpZUK//XRBau1PGPqz0gTRxbvQQ5PhwMeNIXWQQKefcaA0WMHS6qdS8wVPzmHlN yao2KB5ZoHUYzRJBJRfp+v7mL2Xz/mhvPSaifN3M4NFIf4g5MHbJCm7ce1YNy0yI3X+IS2 kMf8nPnCpmDzVXLaDgueNxEgTqm/rOlGf27RweBPSVMLBEnsPjXCeSwFUKsxaQ== 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 4T0ktg1M1lzv8t; Wed, 27 Dec 2023 21:15:07 +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 3BRLF7Sq052740; Wed, 27 Dec 2023 21:15:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BRLF7wB052737; Wed, 27 Dec 2023 21:15:07 GMT (envelope-from git) Date: Wed, 27 Dec 2023 21:15:07 GMT Message-Id: <202312272115.3BRLF7wB052737@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 61e2161367bb - main - 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: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61e2161367bb4e68e603f53b1107f9427f988861 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=61e2161367bb4e68e603f53b1107f9427f988861 commit 61e2161367bb4e68e603f53b1107f9427f988861 Author: Colin Percival AuthorDate: 2023-12-27 08:09:08 +0000 Commit: Colin Percival CommitDate: 2023-12-27 21:14:47 +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 --- 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 21e8d9c21228..90e15b15553d 100644 --- a/sys/amd64/pci/pci_cfgreg.c +++ b/sys/amd64/pci/pci_cfgreg.c @@ -296,7 +296,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 b2cd23687ccc..bb6258ccf214 100644 --- a/sys/i386/pci/pci_cfgreg.c +++ b/sys/i386/pci/pci_cfgreg.c @@ -574,7 +574,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;