From nobody Tue Jul 12 17:32:35 2022 X-Original-To: dev-commits-src-branches@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 306D21CF9455; Tue, 12 Jul 2022 17:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Lj79v5VzYz3bDb; Tue, 12 Jul 2022 17:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657647155; 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=BBRcwoCLZp+D0N8TgRKsonTl0PnK9vlpS7fo69sRB2I=; b=QOBuYzIRXWP8b/yBUzQXlki5nlLWP9414axjC9Mbsv3cpLU3C5LLdwLBxu6A6g9fq1qjRV 8hvP+a6T5jrSK3n9ARcaC2bR/gOwKawRDvSHBBrDqfLNyFYM90PL1pvNr7cR3yUmcw9wEC BteV2kdiW+urS2SNuoNgFf6xmOLpF6Ed8spDi2d7cQ1trcr+IngKEMa/kzhRZNxnApBWjG zuYx/T2VZ23UtuRnHwTqR6oMihXVCTN2GMC3kMWTJ6ltV0gDN98qmFfh4eK4lwTT9Y1aDz SV9YQ3u0d01wIaQkFJN3NJPc30DA/0YwZOmtLRcQsN3eqLDzZXDV4D9TBPsuOQ== 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 4Lj79v4d2gzsds; Tue, 12 Jul 2022 17:32:35 +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 26CHWZ5S065592; Tue, 12 Jul 2022 17:32:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26CHWZOa065591; Tue, 12 Jul 2022 17:32:35 GMT (envelope-from git) Date: Tue, 12 Jul 2022 17:32:35 GMT Message-Id: <202207121732.26CHWZOa065591@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: 01f79c9da806 - stable/13 - busdma: _bus_dmamap_addseg repaired List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 01f79c9da806b7e64fc250c516b04e9e12a8d7bb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657647155; 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=BBRcwoCLZp+D0N8TgRKsonTl0PnK9vlpS7fo69sRB2I=; b=xeWletcBtZzLlaR6t6gHUfNXA03WkadyXaxqQuDpcOxDUhuVNH0i16JwfTu0xqllpNLrCj Jln27aU/qrj5WrjC2yKOEWz7q0fEAG5L7EoqESvr71RrBuwwVjl6f2mjdchnriVqGAPtvh dMcfg3hbQGueSo9aQaVrlJTts+vB1CSYCrYxjHWugndUcWwnZl14wIIYOY63xhk3I3Z98K axh4nSwELl/4Ai9+N8QB0AhiiPJAtwg531/qwlRjmqxXIqq5mT9zMOsI3iHoDSz96lfrSJ yt2qY+AvPSn7OXHgSXOcNwus2o6LBan45z0piFGWVUnwu4MrHbhSxZMd6h6zlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657647155; a=rsa-sha256; cv=none; b=MQ3gp/huGigKJ9ue974QCIbDmijDdTsdooqxG+bVOD2BHkceN0kO0HjN2QLAM81f/i2wzz bDm/itiArGAEOt9eS/FR3k5mydXDeT+7HwJoMRWuS7jPN0AH3x+G1WWOW57HmrJqm7Wg2Z eIv4DZq7Nu/8H4WjOzoSXn36U96TD2L1BcYN4ofyBnbSK1i2f1tIuKneha5cd3kxUXv5L4 bLb/dZEUZYRYpcpWiyRwb96zNK3agOmTwyyVUmMwZ1hMK0nFQaKVhQrLaN8L+d3dFVvYOx cvgAVU3FtxFyalho8F+mgd1pSQK3Mzp9lYNpHFgG2XTKLOTO1CBdGt5PDoF9ow== 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=01f79c9da806b7e64fc250c516b04e9e12a8d7bb commit 01f79c9da806b7e64fc250c516b04e9e12a8d7bb Author: Doug Moore AuthorDate: 2022-01-02 18:37:05 +0000 Commit: Doug Moore CommitDate: 2022-07-12 16:26:11 +0000 busdma: _bus_dmamap_addseg repaired A recent change introduced a one-off error into a test allowing coalescing chunks into segments. This fixes that error. broke a check in _bus_dmamap_addseg on many architectures. This change makes it clear that it is not a particular range that is being boundary-checked, but the proposed union of the two adjacent ranges. Reported by: se Reviewed by: se Fixes: c606ab59e7f9 vm_extern: use standard address checkers everywhere Differential Revision: https://reviews.freebsd.org/D33715 (cherry picked from commit f1e7a532d1ee23033fe0f3beb8eee80c412eeefe) --- sys/arm/arm/busdma_machdep.c | 4 ++-- sys/arm64/arm64/busdma_bounce.c | 4 ++-- sys/powerpc/powerpc/busdma_machdep.c | 4 ++-- sys/riscv/riscv/busdma_bounce.c | 4 ++-- sys/x86/x86/busdma_bounce.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/arm/arm/busdma_machdep.c b/sys/arm/arm/busdma_machdep.c index dc2ed002fab6..3cd4abe902f1 100644 --- a/sys/arm/arm/busdma_machdep.c +++ b/sys/arm/arm/busdma_machdep.c @@ -1027,8 +1027,8 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr, } else { if (curaddr == segs[seg].ds_addr + segs[seg].ds_len && (segs[seg].ds_len + sgsize) <= dmat->maxsegsz && - vm_addr_bound_ok(segs[seg].ds_addr, segs[seg].ds_len, - dmat->boundary)) + vm_addr_bound_ok(segs[seg].ds_addr, + segs[seg].ds_len + sgsize, dmat->boundary)) segs[seg].ds_len += sgsize; else { if (++seg >= dmat->nsegments) diff --git a/sys/arm64/arm64/busdma_bounce.c b/sys/arm64/arm64/busdma_bounce.c index be48cdd6975f..fb631823d32f 100644 --- a/sys/arm64/arm64/busdma_bounce.c +++ b/sys/arm64/arm64/busdma_bounce.c @@ -784,8 +784,8 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr, } else { if (curaddr == segs[seg].ds_addr + segs[seg].ds_len && (segs[seg].ds_len + sgsize) <= dmat->common.maxsegsz && - vm_addr_bound_ok(segs[seg].ds_addr, segs[seg].ds_len, - dmat->common.boundary)) + vm_addr_bound_ok(segs[seg].ds_addr, + segs[seg].ds_len + sgsize, dmat->common.boundary)) segs[seg].ds_len += sgsize; else { if (++seg >= dmat->common.nsegments) diff --git a/sys/powerpc/powerpc/busdma_machdep.c b/sys/powerpc/powerpc/busdma_machdep.c index 3826a380f793..f75d3e1efcf9 100644 --- a/sys/powerpc/powerpc/busdma_machdep.c +++ b/sys/powerpc/powerpc/busdma_machdep.c @@ -708,8 +708,8 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr, } else { if (curaddr == segs[seg].ds_addr + segs[seg].ds_len && (segs[seg].ds_len + sgsize) <= dmat->maxsegsz && - vm_addr_bound_ok(segs[seg].ds_addr, segs[seg].ds_len, - dmat->boundary)) + vm_addr_bound_ok(segs[seg].ds_addr, + segs[seg].ds_len + sgsize, dmat->boundary)) segs[seg].ds_len += sgsize; else { if (++seg >= dmat->nsegments) diff --git a/sys/riscv/riscv/busdma_bounce.c b/sys/riscv/riscv/busdma_bounce.c index 062f752f5ceb..ffc05e20517f 100644 --- a/sys/riscv/riscv/busdma_bounce.c +++ b/sys/riscv/riscv/busdma_bounce.c @@ -656,8 +656,8 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr, } else { if (curaddr == segs[seg].ds_addr + segs[seg].ds_len && (segs[seg].ds_len + sgsize) <= dmat->common.maxsegsz && - vm_addr_bound_ok(segs[seg].ds_addr, segs[seg].ds_len, - dmat->common.boundary)) + vm_addr_bound_ok(segs[seg].ds_addr, + segs[seg].ds_len + sgsize, dmat->common.boundary)) segs[seg].ds_len += sgsize; else { if (++seg >= dmat->common.nsegments) diff --git a/sys/x86/x86/busdma_bounce.c b/sys/x86/x86/busdma_bounce.c index 80054335782a..cfe4dc862d19 100644 --- a/sys/x86/x86/busdma_bounce.c +++ b/sys/x86/x86/busdma_bounce.c @@ -698,8 +698,8 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t curaddr, } else { if (curaddr == segs[seg].ds_addr + segs[seg].ds_len && (segs[seg].ds_len + sgsize) <= dmat->common.maxsegsz && - vm_addr_bound_ok(segs[seg].ds_addr, segs[seg].ds_len, - dmat->common.boundary)) + vm_addr_bound_ok(segs[seg].ds_addr, + segs[seg].ds_len + sgsize, dmat->common.boundary)) segs[seg].ds_len += sgsize; else { if (++seg >= dmat->common.nsegments)