From nobody Mon Sep 26 19:26:03 2022 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 4Mbt5l6pQWz4cYbr; Mon, 26 Sep 2022 19:26:03 +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 4Mbt5l5rRJz3Xhg; Mon, 26 Sep 2022 19:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664220363; 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=M7k5EFSO8S3QpEIlRYXEa21MLpAF/WIWLrkc66pwaJ0=; b=Il2/CmoTINB5/pSGyNOHGjzda4dpc4EaI0GNGYqNzYrENvVIHVL2h6UqC0jNNKMfEqAjpR C+xqhkNtQvIR7FmtBeIP7WczUyqU1ipM0/jH+i9833evlfj/Y7q3QM1Gmo8PpbukzpskJ9 5UKy/iNh44qii3295NXbLumHPUDjRO5KFQ3q9qirgKBVFbGM4Dp/7KxnLW126VH4/syDak 5ajllcFDJ+HT0aqb+EqSOimVTc6FMBkc2YdYruIOTaVPoQXaeLTDNbgudlTAFvVurQXPef wTlGKM2KPKHU2itqpyGLAemgJrkvsyuC6e/CND6d3C6tSsfVpsJqqFWPhX6/aA== 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 4Mbt5l4rh1zslK; Mon, 26 Sep 2022 19:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28QJQ3mw037928; Mon, 26 Sep 2022 19:26:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28QJQ3MU037927; Mon, 26 Sep 2022 19:26:03 GMT (envelope-from git) Date: Mon, 26 Sep 2022 19:26:03 GMT Message-Id: <202209261926.28QJQ3MU037927@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: bd93b5f79ab4 - main - pci_host_generic: stop address translation in bus_alloc_resource 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: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd93b5f79ab489fb0ed6ab25d6be48242eb8c028 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664220363; 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=M7k5EFSO8S3QpEIlRYXEa21MLpAF/WIWLrkc66pwaJ0=; b=kZgdZWnHpkECIsc//8k7QPWF6msG9ZPw+jrCtaj1FimosUMvoSuJwX4rkNSVxDDJrKYcYT QlkpcMvM7a1Z/PqjJyrWVYvdGrqg59idc9fwEjYqSqYOkajrgC5loOx2QHDMhqVU6D1kzy GIEd3w/wcx/eqbCTvILYtXG5FpvWkvJLaOs2P8Pvb65JDLL15avKuBSxCnMsL9YJ6AECqs aUOmxvdXX82BcVV14GpUbuzzmlB83CSorMNWBDzBznAc6g/pBUHj1KYgAwszIAnJvLQC+n QOdeT+ZDlxTziWBhaSNzzvpnr2ROXATaEZGFR0Z0GsZ/2dTH+fWgD9kfJ+BR9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664220363; a=rsa-sha256; cv=none; b=If0chdgWTn9ZQh1TZhl6geBICHUR4vTVMR19IXAwLijmsFppUQEDr5PZRnCtDKM7jlBcid 4a7TyPvgOlBjAU4nDzGl9VDqqiOFvQNzjhAD8Q8hbFgQ7lo8OQmYfL8uJBnpgxraTR8hIB aVRXtKxnhsBpDTS7hVsYc2dAEVKmWXoSgSkXgSKzRJaNd5Psopk95yofJVHWLWrLqGEsyR Kty2kLPY8KckqHUQ8GnWiTmVAg+7u4LrPEdn1qVdoI9Oh201qkBXctX+FtYxLOIqoWepCs gBC8qEMZQ8xZQjbBUFLYXKHsE9pH0cUZbRLDzVLXJy/UeoRy2oPWQiI8Mxf0YQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=bd93b5f79ab489fb0ed6ab25d6be48242eb8c028 commit bd93b5f79ab489fb0ed6ab25d6be48242eb8c028 Author: Kyle Evans AuthorDate: 2022-09-26 19:24:21 +0000 Commit: Kyle Evans CommitDate: 2022-09-26 19:25:13 +0000 pci_host_generic: stop address translation in bus_alloc_resource Translating the provided range prior to rman_reserve_resource(9) is decidedly wrong; the caller may be trying to do a wildcard allocation, for which the implementation is expected to DTRT and clamp the range to what's actually feasible. We don't use the resulting translation here anyways, so just remove it entirely -- the rman in the default implementation is derived from sc->ranges, so the translation should trivially succeed every time as long as the reservation succeeded. If something has gone awry in a derived driver, we'll detect it when we translate prior to activation, so there's likely no diagnostic value in retaining the translation after reservation either. Reviewed by: andrew Noticed by: jhb Differential Revision: https://reviews.freebsd.org/D36618 --- sys/dev/pci/pci_host_generic.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 31462a198541..fbc9c2e1d3c2 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -436,7 +436,6 @@ pci_host_generic_core_alloc_resource(device_t dev, device_t child, int type, struct generic_pcie_core_softc *sc; struct resource *res; struct rman *rm; - rman_res_t phys_start, phys_end; sc = device_get_softc(dev); @@ -452,16 +451,6 @@ pci_host_generic_core_alloc_resource(device_t dev, device_t child, int type, return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid, start, end, count, flags)); - /* Translate the address from a PCI address to a physical address */ - if (generic_pcie_translate_resource_common(dev, type, start, end, - &phys_start, &phys_end) != 0) { - device_printf(dev, - "Failed to translate resource %jx-%jx type %x for %s\n", - (uintmax_t)start, (uintmax_t)end, type, - device_get_nameunit(child)); - return (NULL); - } - if (bootverbose) { device_printf(dev, "rman_reserve_resource: start=%#jx, end=%#jx, count=%#jx\n",