From nobody Wed Sep 11 08:44:24 2024 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 4X3Yyx0MV6z5W7pw; Wed, 11 Sep 2024 08:44: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X3Yyw6QhJz41ng; Wed, 11 Sep 2024 08:44:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726044264; 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=NMe+5rm1gPQ2hUSOIPna70/iLRuueSYe5xWzirCivok=; b=D/LP/NQwe8aX6c7pLdDsuFtjsdo8CorfUBdr+YWYB+/Kgs7Zwoy+wNrSBgwTeRB0HVaP4g vyHw+PlfOOdDxlisvhkt8nvORJi6vzqauhKZn/roF1IuiELlyMGKdGGYjkzb17t4N2YDti TXhPpl/IBAwpe20KglDAhTW9kNOymi3NRHBrrD3yB4JoNnkrNqI0iRUR20X1zMteRPMJ2V 70+03oIloDdkJG7JhaBipYGDmTM/QsDvlyZv0DL8DW5HNj/pEZSvC2M9/MUZQq9uWXrPZ3 28jPF08x3s1NppPVePOHg/aIQPXYKLvIquc3gwIv7/dGq/sRmBeDEwqJsChS0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726044264; a=rsa-sha256; cv=none; b=orMitjEF86TsfNuRvivF3rcfnsZmyrTgFNv7Ln6l/wMcvsNJOt1x/R/MKX7+sZBeybWdJT SwGpv4UHcqDhrpLJYLASYtEz2lk3LUIOICWU/6c4lc+KP4py8cLK9hke0gtFDwmxUsuhpd ngRDFLioFx6XIxenaqoxQJlH0hmfl1CiUbwR+CgVxF2VMYNrCTrFiU930bH/vYPWZAa19b CAkcNv79qF6kd3c4P3hS5Ga6dID4L2Sqs/LfLcR0SvP6JQYoEfvN76zTvvsY67nR0ZwHYT S7MRD/+lpRXxiz/MvX/OlqqZ2WekV/UEbZ80C7iRAyIPvbFCKoKV4ui7K+qFPA== 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=1726044264; 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=NMe+5rm1gPQ2hUSOIPna70/iLRuueSYe5xWzirCivok=; b=dC2/el2fuGLdeYW/w022UN3Nb15nTqLr5WKdIcKEpyC2chb+Y1vIW4Amqt+nyzwPhIt5il /4Psf2cBLKZGfpP8nFlW/JLEaaixpzXzx6+zIpaw+C6UUeqoP/f4H7FzsaAbXNySeRQson qMo8b0FuUhEWRLldUuncyazqyxGOoxEdhEJo3PeV6l/6q4f+n7ggk9Ho0CgWZyPy2uqdP/ k+8q9k3Po+Vl/Cr1L2ZILPReiBZtTdca/DQ/gHZg346NS+T4aXmDTtBfXke33Z1QQSu3l4 VKBKU5VYitQNJ2jSJ6JuO46X511hxt1F+HlpaWSVPUo9k3qLivkBoxVuvJapjQ== 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 4X3Yyw62ZGzPYH; Wed, 11 Sep 2024 08:44:24 +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 48B8iOUX007497; Wed, 11 Sep 2024 08:44:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48B8iO0H007494; Wed, 11 Sep 2024 08:44:24 GMT (envelope-from git) Date: Wed, 11 Sep 2024 08:44:24 GMT Message-Id: <202409110844.48B8iO0H007494@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: d88d70096cd9 - stable/14 - dmar_qi_emit(): use atomic_store_64() when available 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: d88d70096cd91b2a2085794bbc7d0dcb1965ed5e Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d88d70096cd91b2a2085794bbc7d0dcb1965ed5e commit d88d70096cd91b2a2085794bbc7d0dcb1965ed5e Author: Konstantin Belousov AuthorDate: 2024-06-06 03:21:31 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-11 08:43:59 +0000 dmar_qi_emit(): use atomic_store_64() when available (cherry picked from commit b563be66998ddd9dbc83364c8b515398d984c140) --- sys/x86/iommu/intel_qi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/x86/iommu/intel_qi.c b/sys/x86/iommu/intel_qi.c index 9c7cd1e99c86..d6ce6749e4d4 100644 --- a/sys/x86/iommu/intel_qi.c +++ b/sys/x86/iommu/intel_qi.c @@ -139,15 +139,25 @@ dmar_qi_emit(struct dmar_unit *unit, uint64_t data1, uint64_t data2) { DMAR_ASSERT_LOCKED(unit); +#ifdef __LP64__ + atomic_store_64((uint64_t *)(unit->x86c.inv_queue + + unit->x86c.inv_queue_tail), data1); +#else *(volatile uint64_t *)(unit->x86c.inv_queue + unit->x86c.inv_queue_tail) = data1; +#endif unit->x86c.inv_queue_tail += DMAR_IQ_DESCR_SZ / 2; KASSERT(unit->x86c.inv_queue_tail <= unit->x86c.inv_queue_size, ("tail overflow 0x%x 0x%jx", unit->x86c.inv_queue_tail, (uintmax_t)unit->x86c.inv_queue_size)); unit->x86c.inv_queue_tail &= unit->x86c.inv_queue_size - 1; +#ifdef __LP64__ + atomic_store_64((uint64_t *)(unit->x86c.inv_queue + + unit->x86c.inv_queue_tail), data2); +#else *(volatile uint64_t *)(unit->x86c.inv_queue + unit->x86c.inv_queue_tail) = data2; +#endif unit->x86c.inv_queue_tail += DMAR_IQ_DESCR_SZ / 2; KASSERT(unit->x86c.inv_queue_tail <= unit->x86c.inv_queue_size, ("tail overflow 0x%x 0x%jx", unit->x86c.inv_queue_tail,