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 9FE84C43461 for ; Sat, 5 Sep 2020 21:58:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AD71B20760 for ; Sat, 5 Sep 2020 21:58:29 +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="c9OQ4/de" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD71B20760 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 B2C9B6B0002; Sat, 5 Sep 2020 17:58:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AB64D6B0037; Sat, 5 Sep 2020 17:58:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9A4536B0055; Sat, 5 Sep 2020 17:58:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0135.hostedemail.com [216.40.44.135]) by kanga.kvack.org (Postfix) with ESMTP id 7FE606B0002 for ; Sat, 5 Sep 2020 17:58:28 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 42C66180AD807 for ; Sat, 5 Sep 2020 21:58:28 +0000 (UTC) X-FDA: 77230372296.22.cloud95_110a114270be Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 140A618038E67 for ; Sat, 5 Sep 2020 21:58:28 +0000 (UTC) X-HE-Tag: cloud95_110a114270be X-Filterd-Recvd-Size: 6591 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Sat, 5 Sep 2020 21:58:27 +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:References:Cc:To:From:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=tIAS2G8p/d1TmDFaHTTdfEnkyxuVw87sares/jVzh7M=; b=c9OQ4/de0deZUWHGqTyjlR+6TI FVev1DesZ9wVnLdGbhuiQXVThziyXj5rS5SX++yUz1QrO3Ea7EQE5jmMH59C9KsttG2ECSlXc5Sn1 86oJcUokZTV4YqC5+PmHuyZADZyCsdvPwy1Dl8Oaj5zm4+XZjJn96BAkluoFXtjlyop5qrSyb0XWX eY4AN6o+kBkzACMBCXMoqYf/IDJilgXIWR3K3bvKnuE4tcSMfuzFoLlpaYPNwGJ1G8WyjbEchl9PB Gmfv1v9QQKgiMPWHXtLSzvbWv6a02es1igi6kDLlPYKDMEg/NnHUMAR8R25nwdFHUmZ2C7zzvcSey Faa0dO3w==; Received: from [2601:1c0:6280:3f0::19c2] by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEgCT-0007Vj-8J; Sat, 05 Sep 2020 21:58:21 +0000 Subject: Re: [linux-next:master 2890/4758] ld.lld: error: undefined symbol: phys_to_target_node From: Randy Dunlap 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> Message-ID: <56f1cfa0-35e3-e88a-826b-3ebe2780b973@infradead.org> Date: Sat, 5 Sep 2020 14:58:16 -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: 140A618038E67 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/5/20 2:24 PM, Randy Dunlap wrote: > 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... > OK, Matt's patch doesn't fix this x86_64 dax + hmem build error, so apparently Joao's patch is needed. -- ~Randy