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=-15.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 6C78FC433E2 for ; Tue, 1 Sep 2020 12:57:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2C27E206EF for ; Tue, 1 Sep 2020 12:57:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="K8iCk18A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C27E206EF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 98F5F6B005C; Tue, 1 Sep 2020 08:57:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 93ECF6B005D; Tue, 1 Sep 2020 08:57:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 830828E0001; Tue, 1 Sep 2020 08:57:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0089.hostedemail.com [216.40.44.89]) by kanga.kvack.org (Postfix) with ESMTP id 6DF3F6B005C for ; Tue, 1 Sep 2020 08:57:34 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 2DE13181AEF0B for ; Tue, 1 Sep 2020 12:57:34 +0000 (UTC) X-FDA: 77214494028.11.trick01_551091627098 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id E5EF9180F8B86 for ; Tue, 1 Sep 2020 12:57:33 +0000 (UTC) X-HE-Tag: trick01_551091627098 X-Filterd-Recvd-Size: 7853 Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Tue, 1 Sep 2020 12:57:33 +0000 (UTC) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 081Ct2hB156553; Tue, 1 Sep 2020 12:57:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : subject : to : cc : references : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=HAKNvx3l5Tt7LtBd890ED7ThEE8qBuU28oMDLEHkW5k=; b=K8iCk18A49xsaagyzRa9huXnyLV0Mg4vQoXaFfMrqL7axP0TLI6F6i7iQw0aXEJrQp87 ZKx57K5tWU2/jUH508s5CnScKUedxGLKjzWSmkuas0N/x3qUpYy66lmVDg6ryP+f5soD GwEB2wSSocsZuR+dkgLUhEh3gUHhLH7QGMgT11M7ubqk88JG4ZkVQR0HU4ggh+6M/XXi hBobMr4LMNAucd0hKu1YRHgnX3zHF8K3zEnOo2sf2CRncN4+g9PzO5bNnLICwzIyuNVc J3b9RYrhztPvybqWyQpdiK1SK5sa4ZSe25tAg98nt0td5OR1/D7HhmyXeA4lIQgDPY4d Pg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 337eeqv4xs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 01 Sep 2020 12:57:30 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 081CtBa7158076; Tue, 1 Sep 2020 12:57:30 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 3380kn52m5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 01 Sep 2020 12:57:29 +0000 Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 081CvSt5022069; Tue, 1 Sep 2020 12:57:29 GMT Received: from [10.175.165.105] (/10.175.165.105) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 01 Sep 2020 05:57:28 -0700 From: Joao Martins Subject: Re: [linux-next:master 3093/3958] drivers/acpi/numa/hmat.c:658: undefined reference to `hmem_register_device' To: Andrew Morton , Vishal Verma Cc: kernel test robot , Dan Williams , kbuild-all@lists.01.org, Linux Memory Management List References: <202008311538.99SbVGFx%lkp@intel.com> <20200831123802.e23a24b03ef54bfd5091ecff@linux-foundation.org> Message-ID: <2d7f64b4-b3f6-fb5e-4e44-2b9e987d74d3@oracle.com> Date: Tue, 1 Sep 2020 13:57:25 +0100 MIME-Version: 1.0 In-Reply-To: <20200831123802.e23a24b03ef54bfd5091ecff@linux-foundation.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9730 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 adultscore=0 mlxscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009010112 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9730 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxscore=0 phishscore=0 impostorscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009010112 X-Rspamd-Queue-Id: E5EF9180F8B86 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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 8/31/20 8:38 PM, Andrew Morton wrote: > (cc Vishal & Joao) > > On Mon, 31 Aug 2020 15:11:42 +0800 kernel test robot wrote: > >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master >> head: b36c969764ab12faebb74711c942fa3e6eaf1e96 >> commit: f7782cc946fea99b8a4a0a83b6c3775a6beff8ce [3093/3958] ACPI: HMAT: refactor hmat_register_target_device to hmem_register_device >> config: arm64-randconfig-r016-20200831 (attached as .config) >> compiler: aarch64-linux-gcc (GCC) 9.3.0 >> 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 >> git checkout f7782cc946fea99b8a4a0a83b6c3775a6beff8ce >> # save the attached .config to linux build tree >> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64 >> >> If you fix the issue, kindly add following tag as appropriate >> Reported-by: kernel test robot >> >> All errors (new ones prefixed by >>): >> >> aarch64-linux-ld: drivers/acpi/numa/hmat.o: in function `hmat_register_target_devices': >>>> drivers/acpi/numa/hmat.c:658: undefined reference to `hmem_register_device' >> Here's a proposed fix (first patch) but I'm not sure if there's a better one, though. Also, after fixing the one reported above, there's an additional flaw with the reported kconfig. Specifically ARM64 with NUMA=y and MEMORY_HOTPLUG=n. It wasn't reported above, but we would see it right after. See the second patch for that. The two patches could be just one patch as they are introduced by the refactor above ("ACPI: HMAT: refactor hmat_register_target_device to hmem_register_device"), but thought I would split them up per-issue while we discuss the fix. I can attach them merged if you prefer. Joao ---------------------->8------------------- From: Joao Martins Date: Tue, 1 Sep 2020 07:29:44 -0400 Subject: [PATCH 1/2] device-dax: CONFIG_DEV_DAX_HMEM_DEVICES should depend on CONFIG_DAX=y HMAT requires hmem_register_device() which is now placed under drivers/dax. ACPI_HMAT is a bool and built-in, and to use hmem_register_device() CONFIG_DAX also needs to be builtin. Reported-by: kernel test robot Signed-off-by: Joao Martins --- drivers/dax/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dax/Kconfig b/drivers/dax/Kconfig index a229f45d34aa..a66dff78f298 100644 --- a/drivers/dax/Kconfig +++ b/drivers/dax/Kconfig @@ -49,7 +49,7 @@ config DEV_DAX_HMEM Say M if unsure. config DEV_DAX_HMEM_DEVICES - depends on DEV_DAX_HMEM + depends on DEV_DAX_HMEM && DAX=y def_bool y config DEV_DAX_KMEM -- 2.17.1 From: Joao Martins Date: Tue, 1 Sep 2020 08:06:35 -0400 Subject: [PATCH 2/2] device-dax: Require MEMORY_HOTPLUG 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, so reflect that in its header file declaration. Otherwise, ARM64 configs with CONFIG_NUMA=y and CONFIG_MEMORY_HOTPLUG=n see: drivers/dax/hmem/device.o: in function `hmem_register_one': drivers/dax/hmem/device.c:85: undefined reference to `phys_to_target_node' X86 is a special case in which both can be defined without depending on MEMORY_HOTPLUG. The other case is powerpc but like ARM64 dependencies, the arch-specific override requires CONFIG_NUMA and CONFIG_MEMORY_HOTPLUG. Signed-off-by: Joao Martins --- drivers/dax/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dax/Kconfig b/drivers/dax/Kconfig index a66dff78f298..6e86ac52f41a 100644 --- a/drivers/dax/Kconfig +++ b/drivers/dax/Kconfig @@ -49,6 +49,7 @@ config DEV_DAX_HMEM Say M if unsure. config DEV_DAX_HMEM_DEVICES + depends on NUMA && (MEMORY_HOTPLUG || X86) # for phys_to_target_node() depends on DEV_DAX_HMEM && DAX=y def_bool y -- 2.17.1