Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3827669ybt; Tue, 30 Jun 2020 11:59:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBXOVVgrKwvXsAT1XIAawupPDFDg7sMl+rbCD7BnfVeuX9gCWCmMC4felfRka3tgVa/18E X-Received: by 2002:a17:906:71c6:: with SMTP id i6mr20272303ejk.103.1593543175624; Tue, 30 Jun 2020 11:52:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593543175; cv=none; d=google.com; s=arc-20160816; b=aJCzWIS9rcGHfU07lomFNCwp6XO4vr2JU04o3nt8Al8yNZ9BpYJw6I4YeXn2zH8+/E m6dWFkApQncgl/rYo2p6+6wNF8wvtXtIXIaFUZ1AWnWTdI9qGAOFr7Guw1I525sK6OtW iCXkXZEOlFDRpxO0MVyS9moXUBYeGhy3tm1a1qqviM7dreBBeorydIQKwVwmcyLjDpFw EFxo/tYcaIe+OMbEqAXxKNkEZuIt38GBoHN3HrPdp7A4U6+OIy8PX6cQE7EwaK3wMTj/ cw66fTnnRIVGYxKmdjinUMpUYMzpsg6JL+wssX1OU4GQrhMZKr5/9JPxrktrxt9S2TIl l+VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UA03CWNLWExQNbi9OBj5MA7Zak+fgULtpRw1m79H0+Q=; b=Ra6Nygc6OViOeiEVnHGxqK/KNijHMubb+4HJMqijDdmXbQ5pmsPmdteOM5/pmRx4p1 CN/Az8yDs2deq8aUZCZOizzT68aWSol7m+G/ETOAzPK+xoAwb0bPAqDOFWHJo022y9Pq svlKdBj+GBd5GO2ZHRDKJ46DmgeflJecDO8fHVX713H0LmIDjSY1bf8TEkto6NGzDQJ2 pyaqvbcguoNfAoRK69Vp8HnnUBpKV+hSwObEnye4+9gOTcxGT7CYqD12bnEWChZiDg3r H7ypEgTEJsAu0k4hEKyx6QU3067MyQqnDYjV6VHkdZR56b0PSeuxVtcTv/7XpVdOvHGN 2+1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=miSjsYRj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si2193731edm.183.2020.06.30.11.52.33; Tue, 30 Jun 2020 11:52:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=miSjsYRj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388119AbgF3Rh7 (ORCPT + 99 others); Tue, 30 Jun 2020 13:37:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:50666 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731150AbgF3Rh6 (ORCPT ); Tue, 30 Jun 2020 13:37:58 -0400 Received: from localhost.localdomain (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1C6B02077D; Tue, 30 Jun 2020 17:37:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593538677; bh=OOz54nURBDJ/FlpVR17jC8frzVSg3np+p40nJdQ06H8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=miSjsYRjo4dD94F5c3hmtaHZKtmJAskq64XZNSRLmXY8Cz1K9PwWV/Nqdd+kbIN76 WmQgbQS50TH/dWHsmkcqmcS2v0CMoVVXHAm3cWFrnLguGiq8X0DAgftmMXZ5NxtFNb 6PWw5KOdAwT9+dDoFosqYwadzVFMn4zwXq4/27w4= From: Will Deacon To: linux-kernel@vger.kernel.org Cc: Will Deacon , Sami Tolvanen , Nick Desaulniers , Kees Cook , Marco Elver , "Paul E. McKenney" , Josh Triplett , Matt Turner , Ivan Kokshaysky , Richard Henderson , Peter Zijlstra , Alan Stern , "Michael S. Tsirkin" , Jason Wang , Arnd Bergmann , Boqun Feng , Catalin Marinas , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-alpha@vger.kernel.org, virtualization@lists.linux-foundation.org, kernel-team@android.com Subject: [PATCH 03/18] asm/rwonce: Allow __READ_ONCE to be overridden by the architecture Date: Tue, 30 Jun 2020 18:37:19 +0100 Message-Id: <20200630173734.14057-4-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200630173734.14057-1-will@kernel.org> References: <20200630173734.14057-1-will@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The meat and potatoes of READ_ONCE() is defined by the __READ_ONCE() macro, which uses a volatile casts in an attempt to avoid tearing of byte, halfword, word and double-word accesses. Allow this to be overridden by the architecture code in the case that things like memory barriers are also required. Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- include/asm-generic/rwonce.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/asm-generic/rwonce.h b/include/asm-generic/rwonce.h index 92cc2f223cb3..f9dfa88fc04d 100644 --- a/include/asm-generic/rwonce.h +++ b/include/asm-generic/rwonce.h @@ -33,7 +33,9 @@ * atomicity or dependency ordering guarantees. Note that this may result * in tears! */ +#ifndef __READ_ONCE #define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x)) +#endif #define __READ_ONCE_SCALAR(x) \ ({ \ -- 2.27.0.212.ge8ba1cc988-goog