Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp541970img; Wed, 20 Mar 2019 06:06:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVOu36pZ1Dw8x7Zid0wtTOi/8t/z5l2/YWgq3Q9ekQry5NZeiRYcSB7+/toNXquYwv+VzL X-Received: by 2002:a17:902:6b08:: with SMTP id o8mr31329676plk.105.1553087200613; Wed, 20 Mar 2019 06:06:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553087200; cv=none; d=google.com; s=arc-20160816; b=bhdt902wbKFBQMQxITohVsbfF6tN6dgtHZXiCoere8NWOBgYJndzI4z9YNTqblmM3o Ni0mYVjDICLCCXqF5x6lJ9t98UT+TRPFCWzPuT3m+5wuu4fLy1lUnexbwWH0wIKyLKNs PePFYFXo2HWsZr35n97S6iOGd+8QbgZrDCQ2tNBOAGM8+uKD3abc//EoLSjs7Ii27+0W oTCs8ru3GgVpev1WBo8/1xvpbYZ+gwBYMupF7J77rzQ+QdpDuI+u0Zp16Jiy/nJNVC82 qDsTzA1oVqjjzUIBV5uqvr4L6DL6pFdOiVTal+lvzE/B9YpggLs746W3M+CkM22Y7OE0 pllw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=+wddUSSDius11UZyiAbEzXtYgG8gvmxfQ0FLbE4Ctdg=; b=FVO9yzMHntpIf3jDFk3aLi4iWRXGq7zdBT0P8JJ/QcEgjj9YGSF7MLbBC4ZSs1xRY1 cTK0M/v7js5cwfRAqK+uoFpkS95vr3SzDj78CAA/HTYT0P1XDbIWUO7QHzo9DbydD0pP 81osrx96W79W8+YY024bwBPGKwfxaYO5j2d/OkTk51sRzXo6hW9e+7HBrDWvkF1Rzupf LtODqlDai9rTmP2rrPEVMM9ixqZry3wAsgRR9Tu4Tp3yofZCU+su2RhRaXMCxwWsm3Us UZL8/VRKy3oMVtwgf94mq0A8V86AHsvpIjPENVVh6rWfV6mO720V13qMO6JXr9eGL5kr 1Bog== 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 m133si1687640pga.314.2019.03.20.06.05.59; Wed, 20 Mar 2019 06:06:40 -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 S1727805AbfCTNEx (ORCPT + 99 others); Wed, 20 Mar 2019 09:04:53 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:34662 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726506AbfCTNEx (ORCPT ); Wed, 20 Mar 2019 09:04:53 -0400 Received: by mail-qt1-f196.google.com with SMTP id k2so2367180qtm.1; Wed, 20 Mar 2019 06:04:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+wddUSSDius11UZyiAbEzXtYgG8gvmxfQ0FLbE4Ctdg=; b=sQtloULPHQksH1WlGY6iMyptaTBWv3XkjzYquW55kmOUS1eK4Kpv5v+mNZe69wXCnc rjJyiy/xsfQzRec1BHhjmi7eThEdGMsH39g70YHX1W4B05i7s60NV8jFD4AMd/GPW1lj oL46zeus4gwOrCM7ZAuuKmjcIbAYyQyDgu3P5Tt9Uabsn+cMKaxeBZ5Huj22T4XwnnZP a49ME/430y9KXUC6Nfit4fSanGtDxjBiKQF4oFg6s5uNq9RD5sVPG2m4wgP9ns8GVKVn dgnw849SQUjzOg1Fso9MKjjIi7IEE08W9RPx/FhAd+x/HuTVkUMPfc8Wq7IvfoKM2czD 4+Pg== X-Gm-Message-State: APjAAAVrmB+u13vi6NCxQl3gBo/QKDCrjQSddFrW9ZwUNiZYNrvho1TA tC++GF7uk1r5Ou2i61GNDyU9zIMmZF2zE4ck8uo= X-Received: by 2002:ac8:2692:: with SMTP id 18mr4684094qto.343.1553087091631; Wed, 20 Mar 2019 06:04:51 -0700 (PDT) MIME-Version: 1.0 References: <1553062828-27798-1-git-send-email-yamada.masahiro@socionext.com> In-Reply-To: From: Arnd Bergmann Date: Wed, 20 Mar 2019 14:04:34 +0100 Message-ID: Subject: Re: [PATCH] compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING To: Masahiro Yamada Cc: linux-arch , linux-s390 , Dave Hansen , Michael Ellerman , X86 ML , linux-mips@vger.kernel.org, Linux Kernel Mailing List , Paul Burton , Ingo Molnar , linux-mtd , Andrew Morton , linuxppc-dev , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 20, 2019 at 11:19 AM Masahiro Yamada wrote: > On Wed, Mar 20, 2019 at 6:39 PM Arnd Bergmann wrote: > > > > On Wed, Mar 20, 2019 at 7:41 AM Masahiro Yamada > > wrote: > > > > > It is unclear to me how to fix it. > > > That's why I ended up with "depends on !MIPS". > > > > > > > > > MODPOST vmlinux.o > > > arch/mips/mm/sc-mips.o: In function `mips_sc_prefetch_enable.part.2': > > > sc-mips.c:(.text+0x98): undefined reference to `mips_gcr_base' > > > sc-mips.c:(.text+0x9c): undefined reference to `mips_gcr_base' > > > sc-mips.c:(.text+0xbc): undefined reference to `mips_gcr_base' > > > sc-mips.c:(.text+0xc8): undefined reference to `mips_gcr_base' > > > sc-mips.c:(.text+0xdc): undefined reference to `mips_gcr_base' > > > arch/mips/mm/sc-mips.o:sc-mips.c:(.text.unlikely+0x44): more undefined > > > references to `mips_gcr_base' > > > > > > > > > Perhaps, MIPS folks may know how to fix it. > > > > I would guess like this: > > > > diff --git a/arch/mips/include/asm/mips-cm.h b/arch/mips/include/asm/mips-cm.h > > index 8bc5df49b0e1..a27483fedb7d 100644 > > --- a/arch/mips/include/asm/mips-cm.h > > +++ b/arch/mips/include/asm/mips-cm.h > > @@ -79,7 +79,7 @@ static inline int mips_cm_probe(void) > > * > > * Returns true if a CM is present in the system, else false. > > */ > > -static inline bool mips_cm_present(void) > > +static __always_inline bool mips_cm_present(void) > > { > > #ifdef CONFIG_MIPS_CM > > return mips_gcr_base != NULL; > > @@ -93,7 +93,7 @@ static inline bool mips_cm_present(void) > > * > > * Returns true if the system implements an L2-only sync region, else false. > > */ > > -static inline bool mips_cm_has_l2sync(void) > > +static __always_inline bool mips_cm_has_l2sync(void) > > { > > #ifdef CONFIG_MIPS_CM > > return mips_cm_l2sync_base != NULL; > > > > > Thanks, I applied the above, but I still see > undefined reference to `mips_gcr_base' > > > I attached .config to produce this error. > > I use prebuilt mips-linux-gcc from > https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/ I got to this patch experimentally, it fixes the problem for me: diff --git a/arch/mips/mm/sc-mips.c b/arch/mips/mm/sc-mips.c index 394673991bab..d70d02da038b 100644 --- a/arch/mips/mm/sc-mips.c +++ b/arch/mips/mm/sc-mips.c @@ -181,7 +181,7 @@ static int __init mips_sc_probe_cm3(void) return 0; } -static inline int __init mips_sc_probe(void) +static __always_inline int __init mips_sc_probe(void) { struct cpuinfo_mips *c = ¤t_cpu_data; unsigned int config1, config2; diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h index 830c93a010c3..186c28463bf3 100644 --- a/arch/mips/include/asm/bitops.h +++ b/arch/mips/include/asm/bitops.h @@ -548,7 +548,7 @@ static inline unsigned long __fls(unsigned long word) * Returns 0..SZLONG-1 * Undefined if no bit exists, so code should check against 0 first. */ -static inline unsigned long __ffs(unsigned long word) +static __always_inline unsigned long __ffs(unsigned long word) { return __fls(word & -word); } It does look like a gcc bug though, as at least some of the references are from a function that got split out from an inlined function but that has no remaining call sites. Arnd