Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2044700pxb; Sat, 27 Feb 2021 08:33:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0KUNqEl/LSYXVkO8EM/PEj6/IfOJCr/JPcFjqoRDzOnU0b71H/oPAXi3RUCsFFlGQrWl+ X-Received: by 2002:a17:906:c9c2:: with SMTP id hk2mr8747557ejb.244.1614443583736; Sat, 27 Feb 2021 08:33:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614443583; cv=none; d=google.com; s=arc-20160816; b=icPLO05GZKw7HEFvpeAc2Dk9OGe2s2pqcwg06h53k9T44oXo9MFru5mwYYV9sE4DTW hLAwdbN0OrQ3Ig30m3xl6ZVX3bc2QGF9+SnrLy3Jn4+PwdmjjCP+pKMztYF9rU2knwj/ Os13E0wi+ie9JsTdnfXikZSWxC+Fu3RxQSuqkZKLzq4m51/4G6HWkanjh156PS+QgRJm SfkgHrDjhRR3F0LOWC048+hF5uDzGJOrXEXpAXYvfsnu3Gw631+qlt93kLEkEtaFPNaJ pQXH8T9LgkYtqSPrENS7GfYFA/TLzGf4Aipeabgoicb6bAAPvIcfhcugGJmvBwG5zYHL h+RQ== 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=cy4E2D+4Dcn5vi/togSEO0gEwM+xnBfHBUgEaQxxst0=; b=NkE+Enl97xZVswmbRrdA0cGbODTMK/uW3fM6WaPN7nqoKmvFr82RCkM9AqtCx4TucC jJiC4+FxViZgEEsfaJPkXQVGn+4ShawHR5JLb1hZ91NjGIrxb1HM54JCnaX53LwOIMRF yHnGmQpqhqNY1C3qPbjSLGwXPp6qc/WrZtAxjApOjplqxsLWA5ONS8MZ7K5DMuRuVYkO p7ThZ2dl5wYFoKaxUK+k2t45S5EylYTe3dwP46kz65sjGtsYhxTomutxrdYUzDHzLnK6 A2o8mA9fqYnm5h9GKyFa5EoFUbG9NA0e46MT7tZ7N+b67jk2m+qE557Elwe9Z2zU05DM zFKQ== 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 h6si8010572ejs.315.2021.02.27.08.32.41; Sat, 27 Feb 2021 08:33:03 -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 S230179AbhB0Qby (ORCPT + 99 others); Sat, 27 Feb 2021 11:31:54 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:20221 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230194AbhB0Qbq (ORCPT ); Sat, 27 Feb 2021 11:31:46 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4DnsTM3g9Cz9txrK; Sat, 27 Feb 2021 17:30:47 +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 tg9Ti39ns7Wn; Sat, 27 Feb 2021 17:30:47 +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 4DnsTM2S4mz9txrJ; Sat, 27 Feb 2021 17:30:47 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1277A8B77E; Sat, 27 Feb 2021 17:30:49 +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 VF7aLnK4Ywf4; Sat, 27 Feb 2021 17:30:48 +0100 (CET) Received: from localhost.localdomain (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id B2CBB8B75B; Sat, 27 Feb 2021 17:30:48 +0100 (CET) Received: by localhost.localdomain (Postfix, from userid 0) id 6DB0F67452; Sat, 27 Feb 2021 16:30:48 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [PATCH] powerpc: Force inlining of mmu_has_feature to fix build failure To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Sat, 27 Feb 2021 16:30:48 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The test robot has managed to generate a random config leading to following build failure: LD .tmp_vmlinux.kallsyms1 powerpc64-linux-ld: arch/powerpc/mm/pgtable.o: in function `ptep_set_access_flags': pgtable.c:(.text.ptep_set_access_flags+0xf0): undefined reference to `hash__flush_tlb_page' powerpc64-linux-ld: arch/powerpc/mm/book3s32/mmu.o: in function `MMU_init_hw_patch': mmu.c:(.init.text+0x452): undefined reference to `patch__hash_page_A0' powerpc64-linux-ld: mmu.c:(.init.text+0x45e): undefined reference to `patch__hash_page_A0' powerpc64-linux-ld: mmu.c:(.init.text+0x46a): undefined reference to `patch__hash_page_A1' powerpc64-linux-ld: mmu.c:(.init.text+0x476): undefined reference to `patch__hash_page_A1' powerpc64-linux-ld: mmu.c:(.init.text+0x482): undefined reference to `patch__hash_page_A2' powerpc64-linux-ld: mmu.c:(.init.text+0x48e): undefined reference to `patch__hash_page_A2' powerpc64-linux-ld: mmu.c:(.init.text+0x49e): undefined reference to `patch__hash_page_B' powerpc64-linux-ld: mmu.c:(.init.text+0x4aa): undefined reference to `patch__hash_page_B' powerpc64-linux-ld: mmu.c:(.init.text+0x4b6): undefined reference to `patch__hash_page_C' powerpc64-linux-ld: mmu.c:(.init.text+0x4c2): undefined reference to `patch__hash_page_C' powerpc64-linux-ld: mmu.c:(.init.text+0x4ce): undefined reference to `patch__flush_hash_A0' powerpc64-linux-ld: mmu.c:(.init.text+0x4da): undefined reference to `patch__flush_hash_A0' powerpc64-linux-ld: mmu.c:(.init.text+0x4e6): undefined reference to `patch__flush_hash_A1' powerpc64-linux-ld: mmu.c:(.init.text+0x4f2): undefined reference to `patch__flush_hash_A1' powerpc64-linux-ld: mmu.c:(.init.text+0x4fe): undefined reference to `patch__flush_hash_A2' powerpc64-linux-ld: mmu.c:(.init.text+0x50a): undefined reference to `patch__flush_hash_A2' powerpc64-linux-ld: mmu.c:(.init.text+0x522): undefined reference to `patch__flush_hash_B' powerpc64-linux-ld: mmu.c:(.init.text+0x532): undefined reference to `patch__flush_hash_B' powerpc64-linux-ld: arch/powerpc/mm/book3s32/mmu.o: in function `update_mmu_cache': mmu.c:(.text.update_mmu_cache+0xa0): undefined reference to `add_hash_page' powerpc64-linux-ld: mm/memory.o: in function `zap_pte_range': memory.c:(.text.zap_pte_range+0x160): undefined reference to `flush_hash_pages' powerpc64-linux-ld: mm/memory.o: in function `handle_pte_fault': memory.c:(.text.handle_pte_fault+0x180): undefined reference to `hash__flush_tlb_page' This is due to mmu_has_feature() not being inlined. See extract of build of mmu.c with -Winline: In file included from ./include/linux/mm_types.h:19, from ./include/linux/mmzone.h:21, from ./include/linux/gfp.h:6, from ./include/linux/mm.h:10, from arch/powerpc/mm/book3s32/mmu.c:21: ./arch/powerpc/include/asm/mmu.h: In function 'find_free_bat': ./arch/powerpc/include/asm/mmu.h:231:20: warning: inlining failed in call to 'early_mmu_has_feature': call is unlikely and code size would grow [-Winline] 231 | static inline bool early_mmu_has_feature(unsigned long feature) | ^~~~~~~~~~~~~~~~~~~~~ ./arch/powerpc/include/asm/mmu.h:291:9: note: called from here 291 | return early_mmu_has_feature(feature); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The code relies on constant folding of MMU_FTRS_POSSIBLE at buildtime and elimination of non possible parts of code at compile time. For this to work, mmu_has_feature() and early_mmu_has_feature() must be inlined. Reported-by: kernel test robot Fixes: 259149cf7c3c ("powerpc/32s: Only build hash code when CONFIG_PPC_BOOK3S_604 is selected") Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/mmu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h index 80b27f5d9648..607168b1aef4 100644 --- a/arch/powerpc/include/asm/mmu.h +++ b/arch/powerpc/include/asm/mmu.h @@ -228,7 +228,7 @@ enum { #define MMU_FTRS_ALWAYS 0 #endif -static inline bool early_mmu_has_feature(unsigned long feature) +static __always_inline bool early_mmu_has_feature(unsigned long feature) { if (MMU_FTRS_ALWAYS & feature) return true; @@ -286,7 +286,7 @@ static inline void mmu_feature_keys_init(void) } -static inline bool mmu_has_feature(unsigned long feature) +static __always_inline bool mmu_has_feature(unsigned long feature) { return early_mmu_has_feature(feature); } -- 2.25.0