From nobody Wed Jul 06 17:11:30 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 1E6721D0F3FB; Wed, 6 Jul 2022 17:11:31 +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 4LdR0L6SnSz3HLg; Wed, 6 Jul 2022 17:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657127490; 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=CH6q/mZIZjt5IP/sTMp1mjKXj9hFFLLTlPNngaqBlY0=; b=TQEabBOsh8oqaKYUunQu4KCbmS8Z6wvtK74ZJ1RKaUmzTYAnw/cEsr+cnlYICevNepfG9i oSHOJTIxeXaTf32bSgfAKH6ZbWisMbiNl6kPFXwXNwPgIm6lNwUgzHRT58Nm6JDn5RR2gp V8AUhcl0MMr3XwLLp+MliDdxWRQfY+dg+GqZTzylpVmQ+9loW50CAxZG1WRwOslyXwNJKP pPCO8YlntVFimNAaZZkfgXD//IBMfAbWTe7Jcm2qX3XchwwQTd8dz3NftKbrZZUtWo3yEj fGyy6eCSoRRZoC5QC6oQjbULgZS50yrn6hORda0kXNIpludE237SSXkBnHiz3g== 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 A7D5A1E822; Wed, 6 Jul 2022 17:11:30 +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 266HBUPl093389; Wed, 6 Jul 2022 17:11:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 266HBUA4093388; Wed, 6 Jul 2022 17:11:30 GMT (envelope-from git) Date: Wed, 6 Jul 2022 17:11:30 GMT Message-Id: <202207061711.266HBUA4093388@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Doug Moore Subject: git: a408ed1c928a - stable/13 - iommu_gas: Eliminate unnecessary wrappers 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: dougm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a408ed1c928a9f68637672bc4a9cc05a296bf21a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657127490; 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=CH6q/mZIZjt5IP/sTMp1mjKXj9hFFLLTlPNngaqBlY0=; b=FjiO2PCZQ618tAeVhw4NuM5euhTwo3pTGzxcvHi2TIjTas1M6hO6oWNyOCPGufGuXIc3Rc lVC6Elj/XX1bt4NY8+T4oe0rgOrcXbVTeqIDjjspaDGxetvpq3zrhaZ+H8BYgAjBpIIDmP aM8yPN7300qnCaPzmQjUC1SOBem5l1mOJZkyz/BFc8ym38E2MgoUDyOPp7LlAZnFt4ra61 agw2kgm4C/avivWovVMW2PQpTi0qy4s4+mSUOGSDVcGGZULMAHUdbSkSBhjpxM8BQMSqlF FfF0RiFlaHNLHOsNbcZZo5u+SwrW++K9kIQRmMc0o/i6RS1B2SrMAt1v7FaZ3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657127490; a=rsa-sha256; cv=none; b=gFMpzKFPXbWSPybONpT8MDZ4pmyOMfEmlvnnYnugPMf1z3mNCGFiiApyw6jNw+kmWISiVZ w5BrNROdNsk0H5RbWQGhKq3SCX9lrqIaor9dGYQmHvLp21+oRzOk4z57hVzWq9lqTu85HJ bqjeSttXxyptFqLMCl7g70kRLb39FIP19JRBoxu01E9Dm0sf6GTACZapUwWF8ou2vzZrD2 d+WRvjEn3wf9iDJhWdVfR/S23vFUVjA72lis8zrTvv/2xLDmTxIhoS4kbvA+5I/W9+C+JJ ziVnpOi9pliB1UNtfrMSkDiCOLSBAaLrndmgcNaekr1n9UeEz80hgbL9ctX97g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=a408ed1c928a9f68637672bc4a9cc05a296bf21a commit a408ed1c928a9f68637672bc4a9cc05a296bf21a Author: Alan Cox AuthorDate: 2022-06-14 19:01:36 +0000 Commit: Doug Moore CommitDate: 2022-07-06 17:10:52 +0000 iommu_gas: Eliminate unnecessary wrappers Eliminate trivial wrappers for several iommu_gas functions that serve no functional purpose. Reviewed by: br, dougm, kib MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D35487 (cherry picked from commit fc2e4f15a9047bbf546cd675ed590b88e54362bd) --- sys/dev/iommu/busdma_iommu.c | 8 ++++---- sys/dev/iommu/iommu.h | 8 -------- sys/dev/iommu/iommu_gas.c | 41 ----------------------------------------- 3 files changed, 4 insertions(+), 53 deletions(-) diff --git a/sys/dev/iommu/busdma_iommu.c b/sys/dev/iommu/busdma_iommu.c index 81d9e6ab969a..a8ba98469345 100644 --- a/sys/dev/iommu/busdma_iommu.c +++ b/sys/dev/iommu/busdma_iommu.c @@ -593,7 +593,7 @@ iommu_bus_dmamap_load_something1(struct bus_dma_tag_iommu *tag, if (seg + 1 < tag->common.nsegments) gas_flags |= IOMMU_MF_CANSPLIT; - error = iommu_map(domain, &tag->common, buflen1, + error = iommu_gas_map(domain, &tag->common, buflen1, offset, e_flags, gas_flags, ma + idx, &entry); if (error != 0) break; @@ -1025,7 +1025,7 @@ bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map1, map = (struct bus_dmamap_iommu *)map1; waitok = (flags & BUS_DMA_NOWAIT) != 0; - entry = iommu_map_alloc_entry(domain, waitok ? 0 : IOMMU_PGF_WAITOK); + entry = iommu_gas_alloc_entry(domain, waitok ? 0 : IOMMU_PGF_WAITOK); if (entry == NULL) return (ENOMEM); entry->start = start; @@ -1033,14 +1033,14 @@ bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map1, ma = malloc(sizeof(vm_page_t) * atop(length), M_TEMP, waitok ? M_WAITOK : M_NOWAIT); if (ma == NULL) { - iommu_map_free_entry(domain, entry); + iommu_gas_free_entry(domain, entry); return (ENOMEM); } for (i = 0; i < atop(length); i++) { ma[i] = vm_page_getfake(entry->start + PAGE_SIZE * i, VM_MEMATTR_DEFAULT); } - error = iommu_map_region(domain, entry, IOMMU_MAP_ENTRY_READ | + error = iommu_gas_map_region(domain, entry, IOMMU_MAP_ENTRY_READ | ((flags & BUS_DMA_NOWRITE) ? 0 : IOMMU_MAP_ENTRY_WRITE), waitok ? IOMMU_MF_CANWAIT : 0, ma); if (error == 0) { diff --git a/sys/dev/iommu/iommu.h b/sys/dev/iommu/iommu.h index dd803e84c2ee..9ef3a6470331 100644 --- a/sys/dev/iommu/iommu.h +++ b/sys/dev/iommu/iommu.h @@ -172,14 +172,6 @@ struct iommu_ctx *iommu_instantiate_ctx(struct iommu_unit *iommu, device_t iommu_get_requester(device_t dev, uint16_t *rid); int iommu_init_busdma(struct iommu_unit *unit); void iommu_fini_busdma(struct iommu_unit *unit); -struct iommu_map_entry *iommu_map_alloc_entry(struct iommu_domain *iodom, - u_int flags); -void iommu_map_free_entry(struct iommu_domain *, struct iommu_map_entry *); -int iommu_map(struct iommu_domain *iodom, - const struct bus_dma_tag_common *common, iommu_gaddr_t size, int offset, - u_int eflags, u_int flags, vm_page_t *ma, struct iommu_map_entry **res); -int iommu_map_region(struct iommu_domain *domain, - struct iommu_map_entry *entry, u_int eflags, u_int flags, vm_page_t *ma); void iommu_gas_init_domain(struct iommu_domain *domain); void iommu_gas_fini_domain(struct iommu_domain *domain); diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c index b6594af80cb9..a14f386c7c54 100644 --- a/sys/dev/iommu/iommu_gas.c +++ b/sys/dev/iommu/iommu_gas.c @@ -798,36 +798,6 @@ iommu_gas_reserve_region_extend(struct iommu_domain *domain, return (error); } -struct iommu_map_entry * -iommu_map_alloc_entry(struct iommu_domain *domain, u_int flags) -{ - struct iommu_map_entry *res; - - res = iommu_gas_alloc_entry(domain, flags); - - return (res); -} - -void -iommu_map_free_entry(struct iommu_domain *domain, struct iommu_map_entry *entry) -{ - - iommu_gas_free_entry(domain, entry); -} - -int -iommu_map(struct iommu_domain *domain, - const struct bus_dma_tag_common *common, iommu_gaddr_t size, int offset, - u_int eflags, u_int flags, vm_page_t *ma, struct iommu_map_entry **res) -{ - int error; - - error = iommu_gas_map(domain, common, size, offset, eflags, flags, - ma, res); - - return (error); -} - void iommu_unmap_msi(struct iommu_ctx *ctx) { @@ -916,17 +886,6 @@ iommu_translate_msi(struct iommu_domain *domain, uint64_t *addr) __func__, (uintmax_t)*addr, (uintmax_t)domain->msi_entry->end)); } -int -iommu_map_region(struct iommu_domain *domain, struct iommu_map_entry *entry, - u_int eflags, u_int flags, vm_page_t *ma) -{ - int error; - - error = iommu_gas_map_region(domain, entry, eflags, flags, ma); - - return (error); -} - SYSCTL_NODE(_hw, OID_AUTO, iommu, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, ""); #ifdef INVARIANTS