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, 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 2B19FC433E2 for ; Sun, 6 Sep 2020 02:58:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5A8A120760 for ; Sun, 6 Sep 2020 02:58:50 +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="QJnTvO+p" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A8A120760 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 35E276B0002; Sat, 5 Sep 2020 22:58:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2E9406B0037; Sat, 5 Sep 2020 22:58:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1AF5B6B0055; Sat, 5 Sep 2020 22:58:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0204.hostedemail.com [216.40.44.204]) by kanga.kvack.org (Postfix) with ESMTP id F363E6B0002 for ; Sat, 5 Sep 2020 22:58:48 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B11CA181AC212 for ; Sun, 6 Sep 2020 02:58:48 +0000 (UTC) X-FDA: 77231129136.21.error70_2711a28270c0 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id 83C8C180442C0 for ; Sun, 6 Sep 2020 02:58:48 +0000 (UTC) X-HE-Tag: error70_2711a28270c0 X-Filterd-Recvd-Size: 6926 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Sun, 6 Sep 2020 02:58:48 +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=nvspY8A/SyBbV9rZVSMalKu2GUedGBXvVml+zAQO9Ug=; b=QJnTvO+pu3wsCygCGQ/Fxx4JWW PSU0GRfS1X6GMqih52j9v8lOXvvOZIiBFeU6q0z1+ZjZNFNC6RXI+c46CAhgcN7VQtKVAN3EiaqtG jpwQJuX4z65NcDmyWJZSsKTnJA5NOp3P8pgTzD3tPZohuRzO8cV9ZC9hB5eQHYl2OcZ3NqvTkGgCL Zh+/cqgml7DlEPrePjqPE1Ko+sVRVzYrEWTRZEr0jBBvC8rDbfWL6LDESCMXrSmx2CH1pwf4g2grW Ofz8qg4YA1Fcw6GGsttsXv8LSvA6bi9J5aMHjp3HpE+0tA2lMu6v6YcLRlHdMQojy+BTCLMUuaoER KurXlt5Q==; Received: from [2601:1c0:6280:3f0::19c2] by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEktA-0004su-8r; Sun, 06 Sep 2020 02:58:44 +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> <56f1cfa0-35e3-e88a-826b-3ebe2780b973@infradead.org> Message-ID: Date: Sat, 5 Sep 2020 19:58:40 -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: <56f1cfa0-35e3-e88a-826b-3ebe2780b973@infradead.org> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 83C8C180442C0 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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:58 PM, Randy Dunlap wrote: > 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. > OTOH, Joao's patch doesn't fix the ppc64 and arch/sh/ build errors. I'd prefer to see one patch to fix all of these build errors... -- ~Randy