Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3472188yba; Tue, 23 Apr 2019 04:33:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdMXaF7cpqhkQiM62iMVVBHKbLhcG++4khbrGnOYRYNvFJyfKxBi+DrcyE+RWkJnd+wV5F X-Received: by 2002:a17:902:6ac6:: with SMTP id i6mr25603195plt.313.1556019180010; Tue, 23 Apr 2019 04:33:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556019180; cv=none; d=google.com; s=arc-20160816; b=wjyFXygRU/kgKWoxs/OtGIJwmZhnnab4OycOTM0Ps+S11vhEXyF9Qsyd5qvUOGH5tm gsghZ0cF7/kbN3aim3bR9yEN4UKPzic/pytf3Igz01jvh5mupqFrFh5AKWemsP9QJF9a wW0hq27QVX9ZJxyC4WUiB5vsHM9/CGKQjv1vjiMuK9M+phPF/6pMWsOmLqDqhd5o3sR7 ACjg/hzXZ/JGdnd5OTsX1OPdtsOZlc6aGjHyb4BUSC+nXJPIruH/XHlg+JgQ/J5cnWop TN4x4rBNRV6WvtMfv77gdhCjW7xjvGDWR5kUPQ3sr0h3SH9tDwfLpkSUNipQfwTwRFmJ sleg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=+/dzpF3/FHThJPHeVzoxniNgMRouwNfrychSd5/qbgI=; b=RBLAg0kRYMu/FstOdnmTTm6i1I8Zx/b416tPJnTNf9qQ548eJuZ1m3JMmso0g7Wv2X l6jnp7lRQcAWA/aTrvPMzCmwM1JfNh1Ks1VTZm0ndkAbirMMqLqnnWPQk4Vs9JCo++jW 1V8SwNxVOSC7/0ID0HqDWZu+7jspQpu7KKoBt3z0sCDvt0MYyKFvU/CM3AMO5TR9hUtt xJ85yx3lqpWDHgyb6uejFcBQiZehlW49fZyU92mee4GiOlkbbxt00Rq8q31fm6hxvd39 DJ6/HF4iv8Mbq/nGhOvQZ1tjcjuXuJdAaX7ZjDZwczAldYMN4b9d4wwy/du0Sg+jo65r mFFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d30si13606503pla.404.2019.04.23.04.32.43; Tue, 23 Apr 2019 04:32:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727365AbfDWLbt (ORCPT + 99 others); Tue, 23 Apr 2019 07:31:49 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:54872 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbfDWLbt (ORCPT ); Tue, 23 Apr 2019 07:31:49 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 55D9B374; Tue, 23 Apr 2019 04:31:48 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5C28F3F557; Tue, 23 Apr 2019 04:31:45 -0700 (PDT) Date: Tue, 23 Apr 2019 12:31:42 +0100 From: Mark Rutland To: Masahiro Yamada Cc: Andrew Morton , linux-arch , linux-s390@vger.kernel.org, Heiko Carstens , Arnd Bergmann , linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Ingo Molnar , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Christophe Leroy , Mathieu Malaterre , will.deacon@arm.com, catalin.marinas@arm.com, marc.zyngier@arm.com Subject: Re: [RESEND PATCH v3 02/11] arm64: mark (__)cpus_have_const_cap as __always_inline Message-ID: <20190423113142.GB56999@lakrids.cambridge.arm.com> References: <20190423034959.13525-1-yamada.masahiro@socionext.com> <20190423034959.13525-3-yamada.masahiro@socionext.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190423034959.13525-3-yamada.masahiro@socionext.com> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [adding relevant arm64 folk to Cc] On Tue, Apr 23, 2019 at 12:49:50PM +0900, Masahiro Yamada wrote: > This prepares to move CONFIG_OPTIMIZE_INLINING from x86 to a common > place. We need to eliminate potential issues beforehand. > > If it is enabled for arm64, the following errors are reported: > > In file included from ././include/linux/compiler_types.h:68, > from : > ./arch/arm64/include/asm/jump_label.h: In function 'cpus_have_const_cap': > ./include/linux/compiler-gcc.h:120:38: warning: asm operand 0 probably doesn't match constraints > #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) > ^~~ > ./arch/arm64/include/asm/jump_label.h:32:2: note: in expansion of macro 'asm_volatile_goto' > asm_volatile_goto( > ^~~~~~~~~~~~~~~~~ > ./include/linux/compiler-gcc.h:120:38: error: impossible constraint in 'asm' > #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) > ^~~ > ./arch/arm64/include/asm/jump_label.h:32:2: note: in expansion of macro 'asm_volatile_goto' > asm_volatile_goto( > ^~~~~~~~~~~~~~~~~ > > Signed-off-by: Masahiro Yamada This looks sound to me, and from a quick scan of v5.1-rc6 with: $ git grep -wW inline -- arch/arm64 ... I didn't spot any other sites which obviously needed to be made __always_inline. I've built and booted this atop of defconfig and my usual suite of debug options for fuzzing, at EL1 under QEMU/KVM, and at EL2 under QEMU/TCG, with no issues in either case, so FWIW: Tested-by: Mark Rutland Thanks, Mark. > --- > > Changes in v3: None > Changes in v2: > - split into a separate patch > > arch/arm64/include/asm/cpufeature.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h > index e505e1fbd2b9..77d1aa57323e 100644 > --- a/arch/arm64/include/asm/cpufeature.h > +++ b/arch/arm64/include/asm/cpufeature.h > @@ -406,7 +406,7 @@ static inline bool cpu_have_feature(unsigned int num) > } > > /* System capability check for constant caps */ > -static inline bool __cpus_have_const_cap(int num) > +static __always_inline bool __cpus_have_const_cap(int num) > { > if (num >= ARM64_NCAPS) > return false; > @@ -420,7 +420,7 @@ static inline bool cpus_have_cap(unsigned int num) > return test_bit(num, cpu_hwcaps); > } > > -static inline bool cpus_have_const_cap(int num) > +static __always_inline bool cpus_have_const_cap(int num) > { > if (static_branch_likely(&arm64_const_caps_ready)) > return __cpus_have_const_cap(num); > -- > 2.17.1 >