Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3827329ybt; Tue, 30 Jun 2020 11:59:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRpm83Nk09pSJe/rE66Kvd349bWyNXeGXvbC43ZfqKzuSvA5kZXUhT3e+n/tt/n8HPVTUz X-Received: by 2002:aa7:cf02:: with SMTP id a2mr24853966edy.263.1593543181629; Tue, 30 Jun 2020 11:53:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593543181; cv=none; d=google.com; s=arc-20160816; b=aedvg8RhpFACZ9/Qc7gTI0Ke1OTTmpbL57zFeaeaEsDo9BdJb7JDs6eZla8x/yGLLv K2NJ7UCekpcDHFYB7Xjcs20vwZpP/D6PtzzLGUCXiMsDG/GMdhjSk7Zq8yQCxeTiLoyB RdzPJdS8Wyx/TfVHoZwnFz8DP8IwfYi1k+KKttIXUcLTdG8iZk8pFiDSbFQa0jtkkHl3 3MwWg7GY+fO/xIszCUuwsw+Un+pngcf8UgbsVClwcybBjQMQoipFVWdmCetYJ2vtMcRm bHzxsEdYITYg5c3caYSF5tPrW0gVbUBkjd5P4sromaroGpipWfDMMy4Fa4rwLr0pqCEI dsLQ== 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=ZiVJrUAnD99+OXaveB9nDOTVX3w0F+CbxIgW8wwZkxo=; b=fSAi2g2lztcyJxYLaaRZAbvnBXZMyc9uc/SdZv7VS5lbpJtVU4bBrvjPvdTch8HzNW batsoUmRhZ1FHcmN6EALuRslfXUiIiChDfoQyHy0Sf1QvSBl37JR9AVO5ScaThBN0A3K DKUORi5WDaAD13QLhfcSYwRb4mwG9nnPwuShJ0HQiRX0mZ9sinQrFpflI0zc5CA1/7oC GonTcCktkcrqRs4shXgeRfD4mbq2rbPf324cY1z/p84BJfaFZk3nsd+vSl0lAE3iKlzJ QlnvbMkDXBnSVlHwUcL+lMDVek8oS/uFhVj2wEfS6Mw1/dqKlz4ShzzFX0wTj4WkHlgf EksQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bOU7umLf; 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 y21si2220281edt.483.2020.06.30.11.52.39; Tue, 30 Jun 2020 11:53:01 -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=bOU7umLf; 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 S2390350AbgF3RiI (ORCPT + 99 others); Tue, 30 Jun 2020 13:38:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:50884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731150AbgF3RiG (ORCPT ); Tue, 30 Jun 2020 13:38:06 -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 15CD02081A; Tue, 30 Jun 2020 17:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593538685; bh=KoohMc4oy1OYchUtZSZ/5o8eYoZ+TwF900MK61ip/x8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bOU7umLf3Z1uBZ24e0ZbXikzdqMjGZ7XV3SbHT8TKFMcTTlt1d/f4ORiTl8UzYR7/ Fw2LCdkMA9w64wei4ys3rJl+HTcDwEFvhhy2IKgPAM8i1Aas9vi9XI8zbU6rrM41su yU4JiYBlrHL6Q/tg55fyLpDeVp0PzdtvfIoUktIk= 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 05/18] asm/rwonce: Remove smp_read_barrier_depends() invocation Date: Tue, 30 Jun 2020 18:37:21 +0100 Message-Id: <20200630173734.14057-6-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 Alpha overrides __READ_ONCE() directly, so there's no need to use smp_read_barrier_depends() in the core code. This also means that __READ_ONCE() can be relied upon to provide dependency ordering. Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- include/asm-generic/rwonce.h | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/include/asm-generic/rwonce.h b/include/asm-generic/rwonce.h index f9dfa88fc04d..cc810f1f18ca 100644 --- a/include/asm-generic/rwonce.h +++ b/include/asm-generic/rwonce.h @@ -30,24 +30,16 @@ /* * Use __READ_ONCE() instead of READ_ONCE() if you do not require any - * atomicity or dependency ordering guarantees. Note that this may result - * in tears! + * atomicity. 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) \ -({ \ - __unqual_scalar_typeof(x) __x = __READ_ONCE(x); \ - smp_read_barrier_depends(); \ - (typeof(x))__x; \ -}) - #define READ_ONCE(x) \ ({ \ compiletime_assert_rwonce_type(x); \ - __READ_ONCE_SCALAR(x); \ + __READ_ONCE(x); \ }) #define __WRITE_ONCE(x, val) \ @@ -74,12 +66,9 @@ unsigned long __read_once_word_nocheck(const void *addr) */ #define READ_ONCE_NOCHECK(x) \ ({ \ - unsigned long __x; \ - compiletime_assert(sizeof(x) == sizeof(__x), \ + compiletime_assert(sizeof(x) == sizeof(unsigned long), \ "Unsupported access size for READ_ONCE_NOCHECK()."); \ - __x = __read_once_word_nocheck(&(x)); \ - smp_read_barrier_depends(); \ - (typeof(x))__x; \ + (typeof(x))__read_once_word_nocheck(&(x)); \ }) static __no_kasan_or_inline -- 2.27.0.212.ge8ba1cc988-goog