From nobody Sat Dec 07 01:57:06 2024 X-Original-To: dev-commits-src-main@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 4Y4rpp57dHz5gHt6; Sat, 07 Dec 2024 01:57:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y4rpp4cdbz4jkT; Sat, 7 Dec 2024 01:57:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733536626; 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=aJEIfVmk2CoAae8qBOfBemtiMyjs+BtPq7Zb9W2zlmU=; b=kvWDfwiouQZx5k0LeNUunVCvgfvLGkeY0UltJwbwd21sQK8hW8lHL64jMAlxwSestJ06Kv RY0kg3kpMEASF6rG7a8xkyNrF4pLwytTH5B9Mynlh999ps3LRtr2TA8ulcEqHPtl9ys8Hg VEcJU52KE6IY30YhhOHqtlXDxF7ild9wecadTRhLKYP0UzKcEQDyE1sXYSGz9CnI0O34KL OdKGnICuL64SOSpXht0H0H6GE2nuJy958HjFKryPHan7RvwpeLgJOIW3OX/EeYuun/uihn PqAQXDzFt0pwsSI33z5tO7RKZODAp2ATrliS6vWtpEly/MUIR/qhoz6M2eROuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733536626; 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=aJEIfVmk2CoAae8qBOfBemtiMyjs+BtPq7Zb9W2zlmU=; b=xD6OncBnUZmKM4yR4jMlCXmpkgvocMq/fmihCU16MokUUnCDEl5WIOxddMsWjiIp7E80GR tO+kqnB/ua/PlzUTDP5MNg43ltV5ZFY5bI/ExzsEUnMYF/gB8a67EAu7uo1L1jCKmiEHRf 0In1i+SXCfGsEvBcnt99RJR1sTUs4rFphe9CgNg30K1Srk0kIr67cazsoZHYDaG8dTkRO0 5P9c3rZuiQZ/LWv1nZ/0P1JiZUtmF1pi4j+H7ix8lWJRJBSNqdOr5LUR3Ru4QxGt/BH2qk p6lxWzmO7++PPhamy1kaYsRJz+3g0LAUil4oWM0FyHB6od2bQUEEr//pnrjMug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733536626; a=rsa-sha256; cv=none; b=o7AVaN4/HaRUlq+uMcRFZDNfkFm/ZEWeR5gxFXrVRZgUH8A2r+w0hvdmKG+qK2ZI9tiuXa Cr7/XpnfIsprv3jmjeorzmIVfDK3+7lefKwZehZil++q5SeT2LRFetdpoirzASu/2c7gNV wIK8KqgZFH3zXylV+WKuQgmjLJ1XVL9fqHUJ3LKb4v1n3PmS/csOR27esckrQ1GCMo0X+x 162oSSDFubqs4yRn1L1RTnm3AL1/A6T6dPP1g+QEY4N9nbg2ITSTN8DKVQmnyfXFX5r1Eu 5gsR/pEHqvGjqQv8iYFuk1paiDiOaZHqtcgb+AVKvi0kmNs9Puupr19OGBBetg== 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 4Y4rpp46kyz13Dl; Sat, 7 Dec 2024 01:57:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B71v61Z062105; Sat, 7 Dec 2024 01:57:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B71v6BZ062102; Sat, 7 Dec 2024 01:57:06 GMT (envelope-from git) Date: Sat, 7 Dec 2024 01:57:06 GMT Message-Id: <202412070157.4B71v6BZ062102@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 53adc0b898a4 - main - amdiommu: correctly initialize iommu.unit List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 53adc0b898a4d263cad0bdfb687d9f008e5768f3 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=53adc0b898a4d263cad0bdfb687d9f008e5768f3 commit 53adc0b898a4d263cad0bdfb687d9f008e5768f3 Author: Konstantin Belousov AuthorDate: 2024-12-06 08:06:42 +0000 Commit: Konstantin Belousov CommitDate: 2024-12-07 01:54:01 +0000 amdiommu: correctly initialize iommu.unit The field is mostly used for display, and should match device unit, not BIOS IVHD device id, which is deprecated and is practically zero. Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/x86/iommu/amd_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/x86/iommu/amd_drv.c b/sys/x86/iommu/amd_drv.c index 4d7db52a4acd..0712a2a2225f 100644 --- a/sys/x86/iommu/amd_drv.c +++ b/sys/x86/iommu/amd_drv.c @@ -176,7 +176,6 @@ ivrs_lookup_ivhd_0x40(ACPI_IVRS_HARDWARE2 *h2, void *arg) return (false); ildp->sc->unit_dom = h2->PciSegmentGroup; - ildp->sc->iommu.unit = ivrs_info_to_unit_id(h2->Info); ildp->sc->efr = h2->EfrRegisterImage; return (true); } @@ -194,7 +193,6 @@ ivrs_lookup_ivhd_0x10(ACPI_IVRS_HARDWARE1 *h1, void *arg) return (false); ildp->sc->unit_dom = h1->PciSegmentGroup; - ildp->sc->iommu.unit = ivrs_info_to_unit_id(h1->Info); return (true); } @@ -456,6 +454,7 @@ amdiommu_attach(device_t dev) bool res; sc = device_get_softc(dev); + sc->iommu.unit = device_get_unit(dev); sc->iommu.dev = dev; error = pci_find_cap(dev, PCIY_SECDEV, &sc->seccap_reg);