From patchwork Mon Jan 25 18:39:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 370565 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp4534878jam; Mon, 25 Jan 2021 18:26:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5kJK3IWbs+iYjKLdAOTLcYJHoOInuKwFleiEUPG8gdkZsP75jpQ8bqgJGR/kSSCeG2SsK X-Received: by 2002:a17:906:fcce:: with SMTP id qx14mr2065981ejb.220.1611627986758; Mon, 25 Jan 2021 18:26:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611627986; cv=none; d=google.com; s=arc-20160816; b=MT3HdL+MyEcR9CQtMtsFwJV9+T/z9kz3wGVlW5snl0cqWyn7bMM3N/qltHKWmhentm lBgyW34MVHT7BcaTxJaQXEyBzpq/L3NLhqSRgS0HEFLD/wdB2skmiNJHCl/s0NDS/15M iDp0Ki/N8GgoY3qpiBI6Uhp+0QGUZqVr1012qmlm+suiDBnY1JjYed46tGOJNZQmcjAw lbZCJw8LERBPlxJhtPh3TceL7ZiyC3u6aXC10TaQLIR2xq5IVyntLACKNDoNaVJQ9Mrn ed8FSHb5eF25TFBom1MIx5diKW6sbieWL6kc4YX2pOT/XjM1034h33GCpqiXEvh40U7S wcNA== 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=T7FseQy9S0DFrKmG+Bf1XKQVkf59ZpoWM4iybgI30do=; b=ty7fErN/orDcPL4Yd8t2bx9zDAFyOomQjI68Ep34hPPT308KSJXnqpjyx4H5Pwvdb2 14VWdycEIL9ipa/VzHT389mYLtaZWs/1QtJvJP763LZmuP/DjQqZz3q0WBYWfVCzqwOa 2bLsE7HTBVf8daLk6LfIyIJriHYTCkaXcxDClkSKeyiu9378cMkQ7HLbvcHemHM0Jbqo IG/U6mpXuMHAzWk8fjc2wm0ZOYZ2FF9M5+fyAMDYPZMvkhDmy7O6jySBqvBU2O++Z+Jr +JDg0Zp5f+7QmSaBupKv2RcqcuybNCqdKI7VIGeoERuM1L57pj5lvAMtp0JjtTrHSEhA 531Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nYzGExRD; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hs7si7053285ejc.147.2021.01.25.18.26.26; Mon, 25 Jan 2021 18:26:26 -0800 (PST) Received-SPF: pass (google.com: domain of stable-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=@linuxfoundation.org header.s=korg header.b=nYzGExRD; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S1729488AbhAYSo4 (ORCPT + 13 others); Mon, 25 Jan 2021 13:44:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:32940 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729367AbhAYSou (ORCPT ); Mon, 25 Jan 2021 13:44:50 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3F6152083E; Mon, 25 Jan 2021 18:44:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1611600249; bh=8bj+lnRpNczUZo35PzLngMNOFbjrf+wRcmr3i5pK/UU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nYzGExRD2ppvugn5JpzYw/KvDTIpHPXo0SvCWYE9SVQqxfnRfrVZDdjfesfaYM6iX Sn6l9i+YFqBhfju76Dfbs2VEwGMgSiVyUcl/fbsD0jC1sg4I/hMkms1yV9FSdmW0LL J6muBGgXJhsMWBNWbuSOyl6hekXQC4BoqNkB6ZgM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Will Deacon , Catalin Marinas , Sasha Levin Subject: [PATCH 5.4 29/86] arm64: make atomic helpers __always_inline Date: Mon, 25 Jan 2021 19:39:11 +0100 Message-Id: <20210125183202.285425896@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210125183201.024962206@linuxfoundation.org> References: <20210125183201.024962206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit c35a824c31834d947fb99b0c608c1b9f922b4ba0 ] With UBSAN enabled and building with clang, there are occasionally warnings like WARNING: modpost: vmlinux.o(.text+0xc533ec): Section mismatch in reference from the function arch_atomic64_or() to the variable .init.data:numa_nodes_parsed The function arch_atomic64_or() references the variable __initdata numa_nodes_parsed. This is often because arch_atomic64_or lacks a __initdata annotation or the annotation of numa_nodes_parsed is wrong. for functions that end up not being inlined as intended but operating on __initdata variables. Mark these as __always_inline, along with the corresponding asm-generic wrappers. Signed-off-by: Arnd Bergmann Acked-by: Will Deacon Link: https://lore.kernel.org/r/20210108092024.4034860-1-arnd@kernel.org Signed-off-by: Catalin Marinas Signed-off-by: Sasha Levin --- arch/arm64/include/asm/atomic.h | 10 +++++----- include/asm-generic/bitops/atomic.h | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) -- 2.27.0 diff --git a/arch/arm64/include/asm/atomic.h b/arch/arm64/include/asm/atomic.h index 9543b5e0534d2..6e0f48ddfc656 100644 --- a/arch/arm64/include/asm/atomic.h +++ b/arch/arm64/include/asm/atomic.h @@ -17,7 +17,7 @@ #include #define ATOMIC_OP(op) \ -static inline void arch_##op(int i, atomic_t *v) \ +static __always_inline void arch_##op(int i, atomic_t *v) \ { \ __lse_ll_sc_body(op, i, v); \ } @@ -32,7 +32,7 @@ ATOMIC_OP(atomic_sub) #undef ATOMIC_OP #define ATOMIC_FETCH_OP(name, op) \ -static inline int arch_##op##name(int i, atomic_t *v) \ +static __always_inline int arch_##op##name(int i, atomic_t *v) \ { \ return __lse_ll_sc_body(op##name, i, v); \ } @@ -56,7 +56,7 @@ ATOMIC_FETCH_OPS(atomic_sub_return) #undef ATOMIC_FETCH_OPS #define ATOMIC64_OP(op) \ -static inline void arch_##op(long i, atomic64_t *v) \ +static __always_inline void arch_##op(long i, atomic64_t *v) \ { \ __lse_ll_sc_body(op, i, v); \ } @@ -71,7 +71,7 @@ ATOMIC64_OP(atomic64_sub) #undef ATOMIC64_OP #define ATOMIC64_FETCH_OP(name, op) \ -static inline long arch_##op##name(long i, atomic64_t *v) \ +static __always_inline long arch_##op##name(long i, atomic64_t *v) \ { \ return __lse_ll_sc_body(op##name, i, v); \ } @@ -94,7 +94,7 @@ ATOMIC64_FETCH_OPS(atomic64_sub_return) #undef ATOMIC64_FETCH_OP #undef ATOMIC64_FETCH_OPS -static inline long arch_atomic64_dec_if_positive(atomic64_t *v) +static __always_inline long arch_atomic64_dec_if_positive(atomic64_t *v) { return __lse_ll_sc_body(atomic64_dec_if_positive, v); } diff --git a/include/asm-generic/bitops/atomic.h b/include/asm-generic/bitops/atomic.h index dd90c9792909d..0e7316a86240b 100644 --- a/include/asm-generic/bitops/atomic.h +++ b/include/asm-generic/bitops/atomic.h @@ -11,19 +11,19 @@ * See Documentation/atomic_bitops.txt for details. */ -static inline void set_bit(unsigned int nr, volatile unsigned long *p) +static __always_inline void set_bit(unsigned int nr, volatile unsigned long *p) { p += BIT_WORD(nr); atomic_long_or(BIT_MASK(nr), (atomic_long_t *)p); } -static inline void clear_bit(unsigned int nr, volatile unsigned long *p) +static __always_inline void clear_bit(unsigned int nr, volatile unsigned long *p) { p += BIT_WORD(nr); atomic_long_andnot(BIT_MASK(nr), (atomic_long_t *)p); } -static inline void change_bit(unsigned int nr, volatile unsigned long *p) +static __always_inline void change_bit(unsigned int nr, volatile unsigned long *p) { p += BIT_WORD(nr); atomic_long_xor(BIT_MASK(nr), (atomic_long_t *)p);