From nobody Fri Apr 28 15:19:24 2023 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 4Q7GVP3bmwz48bHP; Fri, 28 Apr 2023 15:19:25 +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 4Q7GVP17gTz44rs; Fri, 28 Apr 2023 15:19:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682695165; 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=SSXmyLVcN9OuHC5YOmqBZGEQhN90RbyTLKsxpOvpC0Y=; b=khYe06fym/ETkSjoYGd3jLtU/8w3MF9qHdyLil3L9AF4GTEbvwG/PctLQ8AtKwdPSIaF+Y /2qv0UfssGnNN6C8z/DN9iewfXfoNyExvrEAn09+jHxmSuw2uyaco9WznRAkgIzUBONSk/ YUpTUwFNPKvxsCCixEdOb3QdsgzPjwcxBAFTsafwUCC/Csnj8yfJzDnoNmhSstav8SJ9AL I/soeFpEejai29lL0LOFDkz2Jq4iWZ1jbh9uPVseVv5HjadG9sYDFFc+yTLWba4kMAXqLC MY1CHnkx2Isd9F9FI72G22EgUpwmgcR+MaMOjl8eoOoBBO+8rIS8KYuMEGB9MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682695165; 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=SSXmyLVcN9OuHC5YOmqBZGEQhN90RbyTLKsxpOvpC0Y=; b=c9F2415mXhiRo/Qoioa43iL4VtH8klDBKkTJdQcK5bM2wwuH17fZFZftX/6k0iLtZyypMz Zdb4jWaT10yOmlDjMnCHQinHcnMCt01xkFy5DkaOo2U9UWQN0C9LHFGNseEZqhJP7EgMFs Mx/OJiTvXoRGIijclKRBLMLhgmkRhxiAmgHMoyh9weSnxu6RzWLYdmhILIMphP4523q2EJ bZhcdiwFCmkJD/H7QdLmnYhKTLKrnLxdUDygo/3SG5Zlv6jl1RCMK7k7Ta6CYrppNCa8sw TY+jwFHsaR6G72fAcNBV4uPj5lrFYyZFi2t21Wl3TVfRlSOo8KYfanEkeF1Nmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682695165; a=rsa-sha256; cv=none; b=LnADbSn2SmCw+ontEcCJMcrBDaL43u3LpWblhLz/Ds9IOmvFFlpX5yp4ytXpR+5pNV7uhO jHkF/noghajve/IZmQtR3bZS44ZXabU/oWH7VPDYLdzuMKmZ5jmIBIdu+K9qph8Q2HCaQH UKr9O7Ptj7IrERK/lUs6gGFUaQQNHlWYp3JTcKvPvTuBzCqWcM0s6uGF8JR/7hiRRMHrxR ANne5avU74LVzkmUOGPYxJ+lmbTiWqOeusPlqsTCOVRKGD+OOeR5OMyp4HolkGLm7Fe+U0 iXZwglywNm8p4pRR+y3iiA4YAQ1O+Xxj5YUTIFTiX1zmQuYOYk0BLD9y0jSAFQ== 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 4Q7GVP0BWQz14dq; Fri, 28 Apr 2023 15:19:25 +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 33SFJOWL046022; Fri, 28 Apr 2023 15:19:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33SFJOpZ046021; Fri, 28 Apr 2023 15:19:24 GMT (envelope-from git) Date: Fri, 28 Apr 2023 15:19:24 GMT Message-Id: <202304281519.33SFJOpZ046021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 6eca9db1e7a5 - main - busdma: Update KMSAN shadow maps later in bounce_bus_dmamap_sync() 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6eca9db1e7a52b1060c8999cafb5cb088854aabb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6eca9db1e7a52b1060c8999cafb5cb088854aabb commit 6eca9db1e7a52b1060c8999cafb5cb088854aabb Author: Mark Johnston AuthorDate: 2023-04-28 14:49:25 +0000 Commit: Mark Johnston CommitDate: 2023-04-28 14:59:01 +0000 busdma: Update KMSAN shadow maps later in bounce_bus_dmamap_sync() Otherwise POSTREAD syncs may re-invalidate the shadow of the data buffer when copying from bounce pages, resulting in false-positive KMSAN reports. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/x86/x86/busdma_bounce.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/x86/x86/busdma_bounce.c b/sys/x86/x86/busdma_bounce.c index cf919c01ca64..7f488198e2c0 100644 --- a/sys/x86/x86/busdma_bounce.c +++ b/sys/x86/x86/busdma_bounce.c @@ -924,7 +924,6 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, if (map == NULL) goto out; - kmsan_bus_dmamap_sync(&map->kmsan_mem, op); if ((bpage = STAILQ_FIRST(&map->bpages)) == NULL) goto out; @@ -1018,6 +1017,8 @@ next_r: } out: atomic_thread_fence_rel(); + if (map != NULL) + kmsan_bus_dmamap_sync(&map->kmsan_mem, op); } #ifdef KMSAN