From nobody Mon Oct 17 15:40:52 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 4Mrh6D25Y5z4gDQp; Mon, 17 Oct 2022 15:40:52 +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 4Mrh6D1hSzz3NTP; Mon, 17 Oct 2022 15:40:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666021252; 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=54OdVsOTBf1KK3xkhw0FR6+LBzm+BSBHiIEy/CuLCh4=; b=i7A/OsBMZ6gAw11jRuaTBwCtywXjXf7H4oRnkRj0EoaP4bwj1TqlcjXVKNiQcGUAIUIe3/ EaZ5/gmj24QMUo37a5RKkjMygLawjsI28ZtDtuuLbsM+PaE5aJrxD5XkdYS/xzjRXc2BkU jVlblr6UAMS1XQbLPti6wjWsQ2dFVIFyhWGdXbpdvYLUjDPKIV8fi1xdoOsGeoydLBsOGg TatkAi1nhrW61Aioj7uroC3A7JPd7Y1oEo4CHQC1srpbPzYVknh0GBSl4Ul/OSQ5ih837D +lCuV23a1SRhge2dCfGx9Y3wEWz58J/TGUMvtxtoCSJI4SLTsx1b92MjO58hZA== 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 4Mrh6D0mfnzsnp; Mon, 17 Oct 2022 15:40:52 +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 29HFeqsE016433; Mon, 17 Oct 2022 15:40:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29HFeqPU016432; Mon, 17 Oct 2022 15:40:52 GMT (envelope-from git) Date: Mon, 17 Oct 2022 15:40:52 GMT Message-Id: <202210171540.29HFeqPU016432@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 2258cf36241e - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2258cf36241e02f8c182dae2b2d9cc93ac1b6fdc Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666021252; 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=54OdVsOTBf1KK3xkhw0FR6+LBzm+BSBHiIEy/CuLCh4=; b=uBecgT2+Eexwj3VrmnnpzrsvNQagpcaYG15rlixEv3vYVU+F8sHG2Q2VobIuRsLj8ExXPg /8N4DlRiDOZOdXncYjRh9YqNkYtaaaVlZU58XBtPh38IVxPaFjNWZudVWn6m4Cs8CiXtiv Bj91hueA+8MNa/9mlv/+GIMS3wwZr/i29ZE72Ca9zMSX9RygyMAHjvyGw3GocqAZfB0Jff uLib92LBPJi0G4g1QfkuWTn1htxbweARjkGUwWEwnksLpcM6VSiJD5q2U95TtcSc1LFWUG bw6XOZNQB6GA2D0yyEc0afyTXW66eA2dpHyWjXVsNuv1zTF1K95+oazIqkjFXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666021252; a=rsa-sha256; cv=none; b=Lc/M9ewgQyJu++GOjRV4cdrnKX4pLqIzi0hL6e20TZm4t/UNS/F9sS427dlmP8ulN3oxys FHPMlO23maCEBRzazZ+QByl1UXxC+dDeasqbpts/NYlf6ZbSYJ/mWSuJUd4HFIqIJNnDjk SlJlQciL6k/iEL4EMakpAZf4brp1m5AyV5zD/FdN/OHuSIGlnplpbioOl/eg5RTbLf326D rRDo8QBrzHrAaT2AZK8Q+yTKRGYDEikzmHl+cfHafwSE2oD1W4pNifBankbsosRTBeiNKl juu/0ntL4ZJ+Z3ZYKeE5mU8sF2FYkrlO/Qufow81tcf9V7h8sh4y/1nXGGu1Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=2258cf36241e02f8c182dae2b2d9cc93ac1b6fdc commit 2258cf36241e02f8c182dae2b2d9cc93ac1b6fdc Author: Kyle Evans AuthorDate: 2022-09-26 19:24:21 +0000 Commit: Kyle Evans CommitDate: 2022-10-17 15:36:59 +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 (cherry picked from commit bd93b5f79ab489fb0ed6ab25d6be48242eb8c028) --- 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 f23173ce0a43..c4099387c0cf 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -420,7 +420,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); @@ -436,16 +435,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(dev, type, start, end, &phys_start, - &phys_end)) { - 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",