From owner-svn-src-all@freebsd.org Sun Sep 20 23:20:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 768FD3F53AB; Sun, 20 Sep 2020 23:20:19 +0000 (UTC) (envelope-from jrtc27@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bvk7l2LvGz4gj8; Sun, 20 Sep 2020 23:20:19 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BFD124E50; Sun, 20 Sep 2020 23:20:19 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08KNKIPD091735; Sun, 20 Sep 2020 23:20:18 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08KNKIDE091734; Sun, 20 Sep 2020 23:20:18 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202009202320.08KNKIDE091734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Sun, 20 Sep 2020 23:20:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365932 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 365932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2020 23:20:19 -0000 Author: jrtc27 Date: Sun Sep 20 23:20:18 2020 New Revision: 365932 URL: https://svnweb.freebsd.org/changeset/base/365932 Log: atomic_common.h: Fix the volatile qualifier placement in atomic_load_ptr This was broken in r357940 which introduced the __typeof use. We need the volatile qualifier to be on the pointee not the pointer otherwise it does nothing. This was found by mhorne in D26498, noticing there was a problem (a spin loop condition was hoisted for RISC-V boot code) but not the root cause of it. Reported by: mhorne Reviewed by: mhorne, mjg Approved by: mhorne, mjg Differential Revision: https://reviews.freebsd.org/D26500 Modified: head/sys/sys/atomic_common.h Modified: head/sys/sys/atomic_common.h ============================================================================== --- head/sys/sys/atomic_common.h Sun Sep 20 22:16:24 2020 (r365931) +++ head/sys/sys/atomic_common.h Sun Sep 20 23:20:18 2020 (r365932) @@ -41,7 +41,7 @@ #define atomic_load_short(p) (*(volatile u_short *)(p)) #define atomic_load_int(p) (*(volatile u_int *)(p)) #define atomic_load_long(p) (*(volatile u_long *)(p)) -#define atomic_load_ptr(p) (*(volatile __typeof(p))(p)) +#define atomic_load_ptr(p) (*(volatile __typeof(*p) *)(p)) #define atomic_load_8(p) (*(volatile uint8_t *)(p)) #define atomic_load_16(p) (*(volatile uint16_t *)(p)) #define atomic_load_32(p) (*(volatile uint32_t *)(p))