From nobody Tue Apr 08 10:49:05 2025 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 4ZX2rL1dbMz5sCJp; Tue, 08 Apr 2025 10:49: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 4ZX2rK6Qsrz3kFL; Tue, 08 Apr 2025 10:49:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744109345; 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=6YYpop6uyNhzcaug8msiYTzO90Jjsp0amjWM+8k3DdI=; b=LM2vmIqyihMwovBvdUAmE17KwdDXzLdfuWSJ+rDToPcw+KU4s0XUKOwT5YBYzSkBU1d5oH QkRW1/ox4jKXGUfPb6qzArVcOXjngKKEBvv01flTcdjdQ8l7IpU4ysJh6udo2y4wTtC8/K +fDMK72PUKJLN7zRMUjUp2Hbk3bm5AXSa34g612P/kE0QOSFQhMT8yALFyMVae/qvyrTqd os7rGPwlAiQ5W/91iNclX5rt2iT4YWEzSOen57+bVGpx0EGzVumEQilSAd1aXAb9OMCV4P YFyzSmXuB9NjRkdG/e1PGneEo0QcyZloUCcFgekYPPKHlzOWBUoKiPWklfLduA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1744109345; a=rsa-sha256; cv=none; b=sl/YI/sk92m05UckFr2lypRWfbR3+Qks0PCpEbVqHNsBQhDMfYt1yVmIqrqF/tfjj3sm1D FonmTnNKne9ZJ+H6U1AgWzYk0SpC9wMHvlmX32Qz4wLWxTLh1bACgu7l61zzhfzHppih59 m0lDOyDgniLOYEYIAiqBj6ZYGlkbqynXPsRGL914tyL2jwHiqqTLdEIEPwkK/T/6ANJs/J inBNS1hA0xM44ByoFzDW0jERJbc1NMHvfRcJH1rzDSvcaz6RnJKwu9dlXXe4KqLpfX2gfa VJeTURHf5sX8x+fz65J09cU3H0Yu6weluHbhtmAZuWccsiB5ZiRkxz+A9ElULg== 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=1744109345; 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=6YYpop6uyNhzcaug8msiYTzO90Jjsp0amjWM+8k3DdI=; b=LJE06NU5qzJO377VPloVmCW5ht5osH1OADeAZyD97MAPFa2gsNq4RkIFl2Q9OhJpob/TM5 q8+RAyLg6r31kC50+wyTuoYUl9Ve/34yd0/kJenED3H1GogsQwnyLi4iQuOMneJOo19U6g IuOdHttIgaOsMCd5RpdaKGcu/MS3cjAiYld9rZVI/8t+hsTV753+Xd7nsQu8PoLyOgmVf4 psF3sXB24w30v1QXOxOwMRGxF8WpG43sQLA06EGLV73wCD1Rj17A/lqEGL6wQ4por5vaE+ AwZojB55DmZ1YEgtPmXxAL/xhwUNBo1pdpKhofurPtPx9xYbErpka9Y8rTl+Tw== 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 4ZX2rK616czCXb; Tue, 08 Apr 2025 10:49:05 +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 538An5wd001871; Tue, 8 Apr 2025 10:49:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 538An5ac001868; Tue, 8 Apr 2025 10:49:05 GMT (envelope-from git) Date: Tue, 8 Apr 2025 10:49:05 GMT Message-Id: <202504081049.538An5ac001868@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 451f0333b707 - main - sys: Make the iommu xref uintptr_t 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 451f0333b707642b4ffd88b7527fb7c401a6b3ef Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=451f0333b707642b4ffd88b7527fb7c401a6b3ef commit 451f0333b707642b4ffd88b7527fb7c401a6b3ef Author: Andrew Turner AuthorDate: 2025-04-08 10:48:22 +0000 Commit: Andrew Turner CommitDate: 2025-04-08 10:48:22 +0000 sys: Make the iommu xref uintptr_t On arm64 we use the iommu base address as an xref. This fails when the address has the lower 32-bits in common with another iommu as they will share an xref. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D48726 --- sys/arm64/acpica/acpi_iort.c | 4 ++-- sys/arm64/iommu/smmu.c | 4 ++-- sys/dev/acpica/acpivar.h | 7 ++++--- sys/dev/pci/pci_host_generic_acpi.c | 3 ++- sys/dev/pci/pci_host_generic_fdt.c | 2 +- sys/dev/pci/pcivar.h | 2 +- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/sys/arm64/acpica/acpi_iort.c b/sys/arm64/acpica/acpi_iort.c index a0e24788b775..a180dc1a2a2c 100644 --- a/sys/arm64/acpica/acpi_iort.c +++ b/sys/arm64/acpica/acpi_iort.c @@ -630,7 +630,7 @@ acpi_iort_map_pci_msi(u_int seg, u_int rid, u_int *xref, u_int *devid) } int -acpi_iort_map_pci_smmuv3(u_int seg, u_int rid, u_int *xref, u_int *sid) +acpi_iort_map_pci_smmuv3(u_int seg, u_int rid, uint64_t *xref, u_int *sid) { ACPI_IORT_SMMU_V3 *smmu; struct iort_node *node; @@ -672,7 +672,7 @@ acpi_iort_map_named_msi(const char *devname, u_int rid, u_int *xref, } int -acpi_iort_map_named_smmuv3(const char *devname, u_int rid, u_int *xref, +acpi_iort_map_named_smmuv3(const char *devname, u_int rid, uint64_t *xref, u_int *devid) { ACPI_IORT_SMMU_V3 *smmu; diff --git a/sys/arm64/iommu/smmu.c b/sys/arm64/iommu/smmu.c index a832f6a6ec70..ec8e04ce117b 100644 --- a/sys/arm64/iommu/smmu.c +++ b/sys/arm64/iommu/smmu.c @@ -1781,7 +1781,7 @@ smmu_set_buswide(device_t dev, struct smmu_domain *domain, } static int -smmu_pci_get_sid(device_t child, u_int *xref0, u_int *sid0) +smmu_pci_get_sid(device_t child, uintptr_t *xref0, u_int *sid0) { struct pci_id_ofw_iommu pi; int err; @@ -1945,7 +1945,7 @@ static int smmu_find(device_t dev, device_t child) { struct smmu_softc *sc; - u_int xref; + uintptr_t xref; int err; sc = device_get_softc(dev); diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index d35504127c9c..106ec9038820 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -614,12 +614,13 @@ bus_get_cpus_t acpi_get_cpus; * ARM specific ACPI interfaces, relating to IORT table. */ int acpi_iort_map_pci_msi(u_int seg, u_int rid, u_int *xref, u_int *devid); -int acpi_iort_map_pci_smmuv3(u_int seg, u_int rid, u_int *xref, u_int *devid); +int acpi_iort_map_pci_smmuv3(u_int seg, u_int rid, uint64_t *xref, + u_int *devid); int acpi_iort_its_lookup(u_int its_id, u_int *xref, int *pxm); int acpi_iort_map_named_msi(const char *devname, u_int rid, u_int *xref, u_int *devid); -int acpi_iort_map_named_smmuv3(const char *devname, u_int rid, u_int *xref, - u_int *devid); +int acpi_iort_map_named_smmuv3(const char *devname, u_int rid, + uint64_t *xref, u_int *devid); #endif #endif /* _KERNEL */ #endif /* !_ACPIVAR_H_ */ diff --git a/sys/dev/pci/pci_host_generic_acpi.c b/sys/dev/pci/pci_host_generic_acpi.c index f12632e7205b..324ead5e8b87 100644 --- a/sys/dev/pci/pci_host_generic_acpi.c +++ b/sys/dev/pci/pci_host_generic_acpi.c @@ -411,7 +411,8 @@ generic_pcie_get_iommu(device_t pci, device_t child, uintptr_t *id) { struct generic_pcie_acpi_softc *sc; struct pci_id_ofw_iommu *iommu; - u_int iommu_sid, iommu_xref; + uint64_t iommu_xref; + u_int iommu_sid; uintptr_t rid; int err; diff --git a/sys/dev/pci/pci_host_generic_fdt.c b/sys/dev/pci/pci_host_generic_fdt.c index 73c6201dc14b..ffe63b82a234 100644 --- a/sys/dev/pci/pci_host_generic_fdt.c +++ b/sys/dev/pci/pci_host_generic_fdt.c @@ -367,7 +367,7 @@ generic_pcie_get_iommu(device_t pci, device_t child, uintptr_t *id) { struct pci_id_ofw_iommu *iommu; uint32_t iommu_rid; - uint32_t iommu_xref; + phandle_t iommu_xref; uint16_t pci_rid; phandle_t node; int err; diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h index 14cb577dbedf..d1b7d28eae91 100644 --- a/sys/dev/pci/pcivar.h +++ b/sys/dev/pci/pcivar.h @@ -122,8 +122,8 @@ struct pcicfg_msix { }; struct pci_id_ofw_iommu { + uintptr_t xref; uint32_t id; - uint32_t xref; }; /* Interesting values for HyperTransport */