From nobody Fri Apr 4 00:54:36 2025 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 4ZTKrD5fwwz5slnr; Fri, 04 Apr 2025 00:54:36 +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 4ZTKrD51hcz3Jpp; Fri, 04 Apr 2025 00:54:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1743728076; 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=uOSwMbqKWi2GC7hiXKbVSIhXtWLlM7f7NSs1VKfne0k=; b=btAO3n9lz9tsp06p2BiRvCirVT2ly6edrxp6e7F2pDAUVBLwjFDbYtISx43LQcrcWZ/P7m 7w3397PSzySgIABK4nBbjM8jalNpZsDblQ1WFnDuRfCMqKrqogp7aDk9fr6cUgUDiYwzFc lq7We8IXymLRICzjvOLLpJfyjnzENnZv05TnBatXwDLH3pQMkMXfm3Awt4IX1e6wk/5Sm7 R7OE451PYX2G5qs/786ywe65ejE+XkA9C6JJch3aSGvyyvrgT7RoLOvJqY9FN+odxBoUu6 Sk4EJ7w2rjnhHKJmYjqxugcEGSV7/br3RWNoRzNTAmNdsJIPH9/A5lTG3Xyn6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1743728076; a=rsa-sha256; cv=none; b=sWDzTta1T/J18UhlMP0/dCOSyT3zd96eKxVEXxU3O/f3lmgukCIrxYl4D/9KqNBem5afHF qNndCaYpML9vUL0RbRkyimN8Kan7KjxPBx30tZUJcTeZTuYrkPlvcR37gKwyxG7QIGGBLf LjJglbPSG8S2irwdYM5MOEcw6L7KdgZ8fykxTsJAqT7H1WmpiTXsqkuvX+W6NEnUT7jlwx B5gRzGW6wTSlZvqwtdUUwJZV4eimq5R2Q2tWB8fBl9irirEIealZ/4TI8Ae2nNstX7Hhn2 JM6Ebzoc3jZLVtWKQ79ROQLP1o3+eJJam1BzTT1VVnecPl1xpcEW6LBqd3QQrA== 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=1743728076; 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=uOSwMbqKWi2GC7hiXKbVSIhXtWLlM7f7NSs1VKfne0k=; b=NX1BY2/uBDOxw7Sy4Er3CUhj6DYsa8a2PUj/MlJRL/kv9i6mUqWknlqPJf9FBQZ539E+Mv wng6bPR/vcZ05mbX7D1wlL8eQ86piCxgCLy2Bj8ulc7ilptILyQo8OEoIoCoYfMoe6KQ1b r0YcKBAn7+HpkEg4IBikpTKgBpBRUuBtKeAtUG+EcaxAK7lDuWw70jhvOF6NzGeBoO4cOW pld4zdcD+k7cLJVegqrnpkRvYiE4MHYQA097EoWyuHgPnIzDHkTb9QSI7CA5UfAevuDtU+ sPhRlfOY8hThBOBEoBKjyi1o/S1q2Uav2clJS/g5jx9GSvjlWQP6gYpAprfu/g== 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 4ZTKrD4LqNz8kh; Fri, 04 Apr 2025 00:54:36 +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 5340saqj037573; Fri, 4 Apr 2025 00:54:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5340sacU037570; Fri, 4 Apr 2025 00:54:36 GMT (envelope-from git) Date: Fri, 4 Apr 2025 00:54:36 GMT Message-Id: <202504040054.5340sacU037570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b01d15abbae5 - stable/14 - iommu_gas_map_region(): add comment explaining the ma array shift 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: b01d15abbae5767d1a3fae6afe56475c988447a3 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b01d15abbae5767d1a3fae6afe56475c988447a3 commit b01d15abbae5767d1a3fae6afe56475c988447a3 Author: Konstantin Belousov AuthorDate: 2025-01-25 09:37:50 +0000 Commit: Konstantin Belousov CommitDate: 2025-04-04 00:54:06 +0000 iommu_gas_map_region(): add comment explaining the ma array shift (cherry picked from commit 45f70f98fc55b753b1e7a7374b4a061aa1f27392) --- sys/dev/iommu/iommu_gas.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c index d97bdee47b28..ffa8dc096adc 100644 --- a/sys/dev/iommu/iommu_gas.c +++ b/sys/dev/iommu/iommu_gas.c @@ -875,6 +875,11 @@ iommu_gas_map_region(struct iommu_domain *domain, struct iommu_map_entry *entry, if (entry->end == entry->start) return (0); + /* + * iommu_gas_alloc_region() might clipped the entry start and + * end positions. Adjust the beginning of the ma array to map + * the pages at the requested relative positions. + */ error = domain->ops->map(domain, entry, ma + OFF_TO_IDX(start - entry->start), eflags, ((flags & IOMMU_MF_CANWAIT) != 0 ? IOMMU_PGF_WAITOK : 0));