Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1255681imw; Tue, 5 Jul 2022 06:31:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tXpQP76B4+Hc/Hv4esOOUnJc2DxM8yM48gz0hfxvqoaHUPUiJZovOQqXbc6g2T7qggp2yb X-Received: by 2002:a05:6402:d0a:b0:437:66ca:c211 with SMTP id eb10-20020a0564020d0a00b0043766cac211mr47452128edb.29.1657027873631; Tue, 05 Jul 2022 06:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657027873; cv=none; d=google.com; s=arc-20160816; b=GNr0vEo5NvvIcDTR1+Eke3cVAiJUaOE9UKAuq0jkQQVaXf9vERkgtGcTHgPYJ6Rtg3 TikoM5YltBw88gro5FT/UXqnV8KpwxuNB7wNE87udJBBqhV68X0FCzfdKi6T7FG32I5A MHuO+Dnzz6CPtw+xC7LlpVHr5OQzNjpurDI5dTW353nIV3W2ViIHIQ3U71zKD8YJp/O3 +YI7HqW3LoIuwmoUnSfsbueDvRBE7kAFyhANtzU6QTdO+dtWyERcESzMu7LfhloCR310 G/6ydARdPeqwwe6AiSSOdsA3LZ/BhfLdQkUDEf/o4Vg5Vp+kxfMxVRE6LnjUXrmXyLI2 cLFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gan10acmHrR6AW/3XT9WX3G7fJvtf9B7qVLRTHkDkvI=; b=Wi0of5UY+dsg6hVF6hjhgUtAPZoTQyHNQLoAEHf0JCdHrXMzUZCU1a1niYJdxc4UQA YWUzkS0KG0becag1/WsSelWUNaR0ok0KkGlQHDesXHH/PPUufbiJJhrWyE3gX5qO5Rrd hLHmZSaviy+wcHpuR5QjF8oYb1GZk7kuEB/RUD3wVvtp5FGI/ITluWFOyBfs6luXKz01 al1YXMR0Su6V6VOYEGcoggHdAqqLxU4iLmVSCBO9Uhv2KhGkEr5DjaRkbK5+wn5MEq0V hlkGGXxAC8e7394RE1tonDzq5LFNnmfIKlAYAEUd05PwUOfckv4nU7VqJjTsGjDeGWRh AhWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VANeL9ux; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l11-20020a056402254b00b0042dd5f6dae8si28896534edb.563.2022.07.05.06.30.48; Tue, 05 Jul 2022 06:31:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VANeL9ux; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231824AbiGEMKQ (ORCPT + 99 others); Tue, 5 Jul 2022 08:10:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233413AbiGEMFk (ORCPT ); Tue, 5 Jul 2022 08:05:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B584C183BC; Tue, 5 Jul 2022 05:05:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 52CCFB817DA; Tue, 5 Jul 2022 12:05:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B815C341CD; Tue, 5 Jul 2022 12:05:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657022701; bh=WajH14n4LRoP5ygMUz/2lERUermXm1YHm+rjDQexCvY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VANeL9uxAQmtAQmIcRRDYxJXiUM92hwvBZ2ypeHB5Vfn7eitGEoS8lyrAUi8BnUJm 8MziW5+Nqqb6iU6AAvar04ZERBxkdtM1UzNHXpaxCzsmRzeWTy695acKxJShXHIWTE hJmtlE6NnjEMb0uhgDzCl1puvSE+zdRDQp7iUl1o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathieu Desnoyers , "Peter Zijlstra (Intel)" Subject: [PATCH 5.4 38/58] selftests/rseq: Remove volatile from __rseq_abi Date: Tue, 5 Jul 2022 13:58:14 +0200 Message-Id: <20220705115611.366613035@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220705115610.236040773@linuxfoundation.org> References: <20220705115610.236040773@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mathieu Desnoyers commit 94b80a19ebfe347a01301d750040a61c38200e2b upstream. This is done in preparation for the selftest uplift to become compatible with glibc-2.35. All accesses to the __rseq_abi fields are volatile, but remove the volatile from the TLS variable declaration, otherwise we are stuck with volatile for the upcoming rseq_get_abi() helper. Signed-off-by: Mathieu Desnoyers Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220124171253.22072-5-mathieu.desnoyers@efficios.com Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/rseq/rseq.c | 4 ++-- tools/testing/selftests/rseq/rseq.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) --- a/tools/testing/selftests/rseq/rseq.c +++ b/tools/testing/selftests/rseq/rseq.c @@ -30,7 +30,7 @@ #include "../kselftest.h" #include "rseq.h" -__thread volatile struct rseq_abi __rseq_abi = { +__thread struct rseq_abi __rseq_abi = { .cpu_id = RSEQ_ABI_CPU_ID_UNINITIALIZED, }; @@ -92,7 +92,7 @@ int rseq_register_current_thread(void) goto end; } if (errno != EBUSY) - __rseq_abi.cpu_id = RSEQ_ABI_CPU_ID_REGISTRATION_FAILED; + RSEQ_WRITE_ONCE(__rseq_abi.cpu_id, RSEQ_ABI_CPU_ID_REGISTRATION_FAILED); ret = -1; __rseq_refcount--; end: --- a/tools/testing/selftests/rseq/rseq.h +++ b/tools/testing/selftests/rseq/rseq.h @@ -43,7 +43,7 @@ #define RSEQ_INJECT_FAILED #endif -extern __thread volatile struct rseq_abi __rseq_abi; +extern __thread struct rseq_abi __rseq_abi; extern int __rseq_handled; #define rseq_likely(x) __builtin_expect(!!(x), 1) @@ -139,7 +139,7 @@ static inline uint32_t rseq_current_cpu( static inline void rseq_clear_rseq_cs(void) { - __rseq_abi.rseq_cs.arch.ptr = 0; + RSEQ_WRITE_ONCE(__rseq_abi.rseq_cs.arch.ptr, 0); } /*