From nobody Mon Jan 20 15:50:44 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 4YcFDN6Nb8z5kGcW; Mon, 20 Jan 2025 15:50:44 +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 4YcFDN4lgCz3NVn; Mon, 20 Jan 2025 15:50:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737388244; 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=lJCWwyQuHx67SBB3eAXsN78pQuNHQbbmIwuO3wjGgAs=; b=eb30PZonn0dKGydKVRSSUcdGZmXtEET6ocycvloGJA4c+405NlpevW78QARxDXBWxiam+s TZhQhhLCISR/KWd6QAESt/h3JL2dpVSIwbqqnovlHPNp4+IjGm/PpfaPO9EcK989gOvDOc xYOWT08FvsFJ4VKWLtUlvXYvM6VXYbarKKuEiX1trSRNl3oGAQImAZndB3vflEzjgbKIQe 6wS+3J3BW8Nbda5ZfUk/13rUQSdVOEaJjyyMQjysRzKlD3VN+c4g69ZFcM1DPPopHB6jmr h+4OJZW1XvgY84aAG2FwO2IeHKD6cWrrnIcLiCBd99zJ5h0v2nZvo3eInX7bTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737388244; 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=lJCWwyQuHx67SBB3eAXsN78pQuNHQbbmIwuO3wjGgAs=; b=rI4MeSsgOvccikEFNx++THt96atXFOtvdkDLDZ1vOUhkf/02/fNMbEQpMBP0yD3hTEsDs1 I3UG1PIGBW3Aoq6HTajzJva5tqdycu+NyzDiDD1k2MhT3V0oK4s+k02ADO1llKF6PIwVqQ ezELhSJ8CqAPaKgPJqED22R2cOZUluScxZGAyAMJLNKoPk7JMOD53m2qM2Hz/qV0UOP+tW HxaRfDv8ilk36iNx9XDK1Sy56mWjaow5KeEIms8p9TrkEc+M92LRFCnjrmKkTdU158Z46K vuROVytzTyCV1kSVBmrrAdzMDqvjeqEinHeUrPNAusa3EPmYnyhIS0NmO+u/EQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737388244; a=rsa-sha256; cv=none; b=Bckb1yqZrdYSOkZ6dPit02WSF/zatdFYpVWcGtdj1WlfpDNNxNWn6FvbGpMgo8woMfsUkr wALOdhhiO4JgHFx2Z8CT+eZ2NBfnjNvy6l6LfEA0WSBHeSzCnKtGDajmsAh1wbpsDM2Wa+ 9UMct8tnnZB0cmKMDYJzVQcXs0fcmz3JMNmTu/8k7uLEYR++ghDG8i3tGrh3e6C3G1jgdr g+DXgqQmERBAifCTptWD6XWfRZTYXyDkoVMIkoQwBoNnK7hsX8mKZgIuiZNpYyAnUOY6YF jiE7PIZnBDvqd5RuyMBzVNMcMJ3TYn7gt5h/fWVOnv9W9Um19wPVY3XkLe0nFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YcFDN4HxYzBcn; Mon, 20 Jan 2025 15:50:44 +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 50KFoie6047868; Mon, 20 Jan 2025 15:50:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KFoiO1047865; Mon, 20 Jan 2025 15:50:44 GMT (envelope-from git) Date: Mon, 20 Jan 2025 15:50:44 GMT Message-Id: <202501201550.50KFoiO1047865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: d0cbb1930e82 - main - atomics: atomic_load_consume_ptr(): Accept pointers to const 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: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d0cbb1930e82a53b07b1091402ff14cdfe7a4898 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=d0cbb1930e82a53b07b1091402ff14cdfe7a4898 commit d0cbb1930e82a53b07b1091402ff14cdfe7a4898 Author: Olivier Certner AuthorDate: 2025-01-20 13:53:35 +0000 Commit: Olivier Certner CommitDate: 2025-01-20 15:49:52 +0000 atomics: atomic_load_consume_ptr(): Accept pointers to const Now that all directly-implemented loads (with acquire semantics or not) accept pointers to const, ensure that atomic_load_consume_ptr(), built on atomic_load_acq_ptr(), does so too, in the common atomics header as well as *SAN interceptors. Reviewed by: kib Fixes: 5e9a82e898d5 ("atomics: Constify loads") MFC after: 4 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48497 --- sys/sys/atomic_common.h | 2 +- sys/sys/atomic_san.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/atomic_common.h b/sys/sys/atomic_common.h index e03cd93c2d4a..e802b2a99630 100644 --- a/sys/sys/atomic_common.h +++ b/sys/sys/atomic_common.h @@ -133,7 +133,7 @@ * openly resorting to the stronger acquire fence, to be sorted out. */ #define atomic_load_consume_ptr(p) \ - ((__typeof(*p)) atomic_load_acq_ptr((uintptr_t *)p)) + ((__typeof(*p)) atomic_load_acq_ptr((const volatile uintptr_t *)p)) #define atomic_interrupt_fence() __compiler_membar() diff --git a/sys/sys/atomic_san.h b/sys/sys/atomic_san.h index 93a9bfcbf593..06c6c98ec8a8 100644 --- a/sys/sys/atomic_san.h +++ b/sys/sys/atomic_san.h @@ -270,7 +270,7 @@ ATOMIC_SAN_THREAD_FENCE(SAN_INTERCEPTOR_PREFIX); __DECONST(volatile uintptr_t *, (x)))) #define atomic_load_acq_ptr ATOMIC_SAN(load_acq_ptr) #define atomic_load_consume_ptr(x) \ - ((__typeof(*x))atomic_load_acq_ptr((volatile uintptr_t *)(x))) + ((__typeof(*x))atomic_load_acq_ptr((const volatile uintptr_t *)(x))) #define atomic_readandclear_ptr ATOMIC_SAN(readandclear_ptr) #define atomic_set_ptr ATOMIC_SAN(set_ptr) #define atomic_set_acq_ptr ATOMIC_SAN(set_acq_ptr)