From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37BEEC43461 for ; Sat, 5 Sep 2020 21:24:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 82AEF2074B for ; Sat, 5 Sep 2020 21:24:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="uNGSW3wj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 82AEF2074B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 655D86B0002; Sat, 5 Sep 2020 17:24:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6062F6B0037; Sat, 5 Sep 2020 17:24:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4CD886B0055; Sat, 5 Sep 2020 17:24:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0246.hostedemail.com [216.40.44.246]) by kanga.kvack.org (Postfix) with ESMTP id 374A36B0002 for ; Sat, 5 Sep 2020 17:24:39 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E2C00180AD807 for ; Sat, 5 Sep 2020 21:24:38 +0000 (UTC) X-FDA: 77230287036.03.pets56_0a0367e270be Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id AE77028A4E8 for ; Sat, 5 Sep 2020 21:24:38 +0000 (UTC) X-HE-Tag: pets56_0a0367e270be X-Filterd-Recvd-Size: 6291 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Sat, 5 Sep 2020 21:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=1az18tusBRDu/RdsUgvFWppIghn9k7TUdFnp+hGgspo=; b=uNGSW3wjAY941r+GRJW2sNooil eMo9tNnyvyDLcGce552qG3OuB1hlIQWWgxbtgoTyB5llo9jngTerD7SDdCywIj30NICEmdbZ23Wrc EhPefn65HgtmUg75/mqOoU0vuKWWYprsR2JLnGg1LE4jCcThBLQeeUSl+t3TsXcKxUD+GOWmxyywe Vs8kLEvhDimW+Irb9sIfpWjgdpD53YxS8n3eLqPTmSrpSHTvELlnIhHOG/LZ56QobV/pLJoQqgTFS dKn3fRcZcFHz8Xpk+GvXlQGjDVSF00KVukiYibWpBYwQGnRKyA6yD/JLuTXyx6gFE+dUdXkuQq2KF wflfdJOw==; Received: from [2601:1c0:6280:3f0::19c2] by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEffk-0005Wk-TF; Sat, 05 Sep 2020 21:24:33 +0000 Subject: Re: [linux-next:master 2890/4758] ld.lld: error: undefined symbol: phys_to_target_node To: Joao Martins , Andrew Morton , Vishal Verma Cc: kernel test robot , Dan Williams , kbuild-all@lists.01.org, clang-built-linux@googlegroups.com, Linux Memory Management List , Matt Fleming References: <202009031338.VZC7AOSw%lkp@intel.com> From: Randy Dunlap Message-ID: Date: Sat, 5 Sep 2020 14:24:29 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: AE77028A4E8 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 9/3/20 5:31 AM, Joao Martins wrote: > On 9/3/20 6:49 AM, kernel test robot wrote: >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master >> head: 4442749a203151a319a5bb8d0b983b84253a6931 >> commit: bd295a352cfa24e5110a53f978edb48b7c21ff8f [2890/4758] ACPI: HMAT: attach a device for each soft-reserved range >> config: x86_64-randconfig-a002-20200902 (attached as .config) >> compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 224d8153b53b16cf535ea1a55afdfe1ec5b1374f) >> reproduce (this is a W=1 build): >> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross >> chmod +x ~/bin/make.cross >> # install x86_64 cross compiling tool for clang build >> # apt-get install binutils-x86-64-linux-gnu >> git checkout bd295a352cfa24e5110a53f978edb48b7c21ff8f >> # save the attached .config to linux build tree >> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 >> >> If you fix the issue, kindly add following tag as appropriate >> Reported-by: kernel test robot >> >> All errors (new ones prefixed by >>): >> >>>> ld.lld: error: undefined symbol: phys_to_target_node >> >>> referenced by device.c:84 (drivers/dax/hmem/device.c:84) >> >>> dax/hmem/device.o:(hmem_register_one) in archive drivers/built-in.a >> > This would require the proposed fix below the scissors mark. > > I had reported this failure before, but it needed an adjustment so I'm re-sending it. > > --------------------------->8---------------------------- > > From 622c1297b7d76a319b07a29192fe9bfe5c2b6b7c Mon Sep 17 00:00:00 2001 > From: Joao Martins > Date: Tue, 1 Sep 2020 08:06:35 -0400 > Subject: [PATCH] device-dax: Require NUMA_KEEP_MEMINFO for > phys_to_target_node() > > phys_to_target_node() and memory_add_physaddr_to_nid() are only defined > with both CONFIG_NUMA=y and CONFIG_MEMORY_HOTPLUG=y. Oherwise we see: > > drivers/dax/hmem/device.o: in function `hmem_register_one': > drivers/dax/hmem/device.c:85: undefined reference to `phys_to_target_node' > > lkp also reports such build failures: > > ld.lld: error: undefined symbol: phys_to_target_node > > X86 is a special case in which both can be defined without depending on > MEMORY_HOTPLUG=y. The other case is powerpc (for > memory_add_physaddr_to_nid) but like ARM64 dependencies, the > arch-specific override requires CONFIG_NUMA and CONFIG_MEMORY_HOTPLUG. > > In all cases this ends up depending on CONFIG_NUMA_KEEP_MEMINFO to > signal the presence of phys_to_target_node() which is what > CONFIG_DEV_DAX_HMEM_DEVICES should depend on. Additionally, the X86 > arch-override is not selected unless X86_PMEM_LEGACY=y. So on > CONFIG_DEV_DAX_HMEM we select CONFIG_NUMA_KEEP_INFO ourselves if both > NUMA and X86 are set. > > Reported-by: kernel test robot > Signed-off-by: Joao Martins > --- > drivers/dax/Kconfig | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/dax/Kconfig b/drivers/dax/Kconfig > index a66dff78f298..567428e10b7b 100644 > --- a/drivers/dax/Kconfig > +++ b/drivers/dax/Kconfig > @@ -35,6 +35,7 @@ config DEV_DAX_PMEM > config DEV_DAX_HMEM > tristate "HMEM DAX: direct access to 'specific purpose' memory" > depends on EFI_SOFT_RESERVE > + select NUMA_KEEP_MEMINFO if (NUMA && X86) > default DEV_DAX > help > EFI 2.8 platforms, and others, may advertise 'specific purpose' > @@ -49,6 +50,7 @@ config DEV_DAX_HMEM > Say M if unsure. > > config DEV_DAX_HMEM_DEVICES > + depends on NUMA_KEEP_MEMINFO # for phys_to_target_node() > depends on DEV_DAX_HMEM && DAX=y > def_bool y > Hi, There is also this patch from Matt Fleming from last year that I have successfully tested (built) on ppc64 and arch/sh/, where build errors were reported. https://lore.kernel.org/lkml/20191223164220.GA14394@codeblueprint.co.uk/ but Matt doesn't seem to be replying to any emails about this patch... -- ~Randy