Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp193393pxf; Wed, 10 Mar 2021 04:12:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxy4HSq1t90tCoOt+gU4RA/aTLr/gzt5sJAjBskq9W2TLPbiXWikO6U3JRTVM2svj5V/CI9 X-Received: by 2002:a05:6402:104c:: with SMTP id e12mr2821255edu.108.1615378347182; Wed, 10 Mar 2021 04:12:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615378347; cv=none; d=google.com; s=arc-20160816; b=CzJFUUTw04neO/Ti0UTD3pf1iyF0gUmVrHa63dh3yfV5uu9CN7g+cw+PT1vNND+uqY Ymh6qScCh7UxajMPBLCrOPRD4SsT5fSz+nLKDxahc+tlDnp8SI1KiGSHiOoLwx25sRbR 0SlSfuB+mf20CbRhgR9hibBHAP0dwOBsoM76e9411g64rph1ku2qZCu38VVrdqxYKMwH 4OtKdjlef1Ue0h6CT6oVj2V3EwcNaLJhjqABtKTHCm+A3OImVKtslYaUSQRkTOYt+akr jLBmespSF4SSzr9Bwsqm72hjc84H4mDf6Oj7hHSK0jRv6hBlUftdK38BaqdYvLYHK3Ft Z0vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:message-id; bh=nDNrlMZ1QLn93ZfCVjo4poO9Apl58MpwdJQJn6ShYfA=; b=Xsg+LeifjNrdAe0a/AvWGeU/3KBQaxzIzoU0HWNkQ1w8CXJGPuuXjpo35UDwZSrOFw 5SbyN6DKjZFjsigQAyYnndkLFrWzPNaP/WIrekS3RzBA1WCtd76zAzJhiIm6cRi7e0UQ 5XuhmcDWoe6HAHH+oX+10zlOxWWWfAnl/lOzKIFPtbjN71TtgYv6nK51eh3VOP/TWQ96 wSjMf+azwkWyHnnW7OFm/VM1CBBwT+TQ2BNpgzzxaFVXrvPDyDOx+gvZpDeGlpRUHxu4 F5RJADvir5Q8usoTxWM1F+JQF5yzSvzbneXjUOsKCe4GHOqFhcHPkeElRKEHZvDW8P2D DGWQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a22si11546204ejp.696.2021.03.10.04.12.00; Wed, 10 Mar 2021 04:12:27 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229948AbhCJMKm (ORCPT + 99 others); Wed, 10 Mar 2021 07:10:42 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:49184 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232231AbhCJMKi (ORCPT ); Wed, 10 Mar 2021 07:10:38 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4DwWB33MXvz9txr0; Wed, 10 Mar 2021 13:10:35 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 50zCdInSTEKv; Wed, 10 Mar 2021 13:10:35 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4DwWB26L47z9txqx; Wed, 10 Mar 2021 13:10:34 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E2DEB8B78A; Wed, 10 Mar 2021 13:10:35 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id L-0L8waMBKwJ; Wed, 10 Mar 2021 13:10:35 +0100 (CET) Received: from po16121vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 576EA8B77E; Wed, 10 Mar 2021 13:10:35 +0100 (CET) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id EB1536755D; Wed, 10 Mar 2021 12:10:34 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [PATCH] powerpc: Force inlining of cpu_has_feature() to avoid build failure To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Wed, 10 Mar 2021 12:10:34 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The code relies on constant folding of cpu_has_feature() based on possible and always true values as defined per CPU_FTRS_ALWAYS and CPU_FTRS_POSSIBLE. Build failure is encountered with for instance book3e_all_defconfig on kisskb in the AMDGPU driver which uses cpu_has_feature(CPU_FTR_VSX_COMP) to decide whether calling kernel_enable_vsx() or not. The failure is due to cpu_has_feature() not being inlined with that configuration with gcc 4.9. In the same way as commit acdad8fb4a15 ("powerpc: Force inlining of mmu_has_feature to fix build failure"), for inlining of cpu_has_feature(). Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/cpu_has_feature.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/cpu_has_feature.h b/arch/powerpc/include/asm/cpu_has_feature.h index 7897d16e0990..727d4b321937 100644 --- a/arch/powerpc/include/asm/cpu_has_feature.h +++ b/arch/powerpc/include/asm/cpu_has_feature.h @@ -7,7 +7,7 @@ #include #include -static inline bool early_cpu_has_feature(unsigned long feature) +static __always_inline bool early_cpu_has_feature(unsigned long feature) { return !!((CPU_FTRS_ALWAYS & feature) || (CPU_FTRS_POSSIBLE & cur_cpu_spec->cpu_features & feature)); @@ -46,7 +46,7 @@ static __always_inline bool cpu_has_feature(unsigned long feature) return static_branch_likely(&cpu_feature_keys[i]); } #else -static inline bool cpu_has_feature(unsigned long feature) +static __always_inline bool cpu_has_feature(unsigned long feature) { return early_cpu_has_feature(feature); } -- 2.25.0