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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13295CE8D52 for ; Thu, 19 Sep 2024 07:21:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 747466B0082; Thu, 19 Sep 2024 03:21:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F6E76B0083; Thu, 19 Sep 2024 03:21:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5BEF06B0085; Thu, 19 Sep 2024 03:21:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 3EF386B0082 for ; Thu, 19 Sep 2024 03:21:49 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id CD7881C5325 for ; Thu, 19 Sep 2024 07:21:48 +0000 (UTC) X-FDA: 82580643096.04.79FFE3E Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf28.hostedemail.com (Postfix) with ESMTP id 123D2C000D for ; Thu, 19 Sep 2024 07:21:46 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726730474; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LPOvVFiFxkp8wPIQ25B+uct6N3jvyLIyr6Qy+Wyn0lw=; b=oR6t2IvB8RzfOD1F7vrelg7yopArPu9/k6U8iUc9Y/GkCiqWuQG0gqX5UfqCEB/XZilw+e cLP81czDvgIm0zRWOaaGl7SebBInc6DdReFDikmBfKJsFMY4YClIuq6a+zOthojQjqNqCM cE3TrV5lCookdT6XHORlzbbRfZvuksQ= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726730474; a=rsa-sha256; cv=none; b=SXV9edmJ6eskeJTg0iGSJYo0oxjpjjOOHu8zrdXBU9zHfAd7+odtmRKzakxp/yf2OZtcUM a35xVlDdQFkAY9LkCac1STfV8YxsjoCo9+qWLX18Dq3FpEj5sSW8Z0qojRecExN/J+5kU6 jImIDC0PWWFJiFAq7WXuu1WGGnIHAys= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 56B1A13D5; Thu, 19 Sep 2024 00:22:15 -0700 (PDT) Received: from [10.163.34.169] (unknown [10.163.34.169]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6A5A43F64C; Thu, 19 Sep 2024 00:21:37 -0700 (PDT) Message-ID: Date: Thu, 19 Sep 2024 12:51:33 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V2 4/7] mm: Use pmdp_get() for accessing PMD entries To: kernel test robot , linux-mm@kvack.org Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, Andrew Morton , David Hildenbrand , Ryan Roberts , "Mike Rapoport (IBM)" , Arnd Bergmann , x86@kernel.org, linux-m68k@lists.linux-m68k.org, linux-fsdevel@vger.kernel.org, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Dimitri Sivanich , Muchun Song , Andrey Ryabinin , Miaohe Lin , Naoya Horiguchi , Pasha Tatashin , Dennis Zhou , Tejun Heo , Christoph Lameter , Uladzislau Rezki , Christoph Hellwig References: <20240917073117.1531207-5-anshuman.khandual@arm.com> <202409190205.YJ5gtx3T-lkp@intel.com> Content-Language: en-US From: Anshuman Khandual In-Reply-To: <202409190205.YJ5gtx3T-lkp@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Stat-Signature: edba15gtx56zab6dksurck45rwsdw8jq X-Rspamd-Queue-Id: 123D2C000D X-Rspamd-Server: rspam11 X-HE-Tag: 1726730506-532831 X-HE-Meta: U2FsdGVkX1/9hCibssviNO4zSKGcPe/J2Uxf9crukPbaAMcliqzxJPKZGSb7ChWWDLd7YXUzNW+KC1j0W/y1Kgm+TJ1X2qHQrLe1zZh9mqxxks7i2bXgd7wwDjO8Gi3XZmV9elSy9pDSeyOeI8KIMNCawdcek8h1HumT1GtXa3ncYOzFhJNCilUipv+PDi1HfdYa5boGbpe6U0J09YUZU8ku0yzGkZJapCJ/z28G+jtnVTRHifxSIYqKc/J64TJTD6j7VAunsQ63GqJaa4sFlotmOA3l6O5Yo3gtCjsFcD7Wh/h81lwdQ2slFr0+8tmpqGKr7mnSMWebQ8jMV1sj3otCnJHEJhi57JOH0SxpE3YgNRnsRjwn+vEfa01VDhs0TZIexbkCMlPQ+SYLW4LTya+SzQ1Ts8HE8MHxw7CYZXgUOfvXvoQnpjUqpi8s3HoJvct08tXySCV+m3FWwQXGrI05xMEjvWlDqnGnQoOmcpy35oF3xKZrWTB3n14D56/o32OvNzv55VMTXLebRIDk3d80EomBtWRZBrEZCiIflzO58sGoByCbyjKit2YDtZhaEZ1IlElT6SAcxgROjMa06LAF4CFGUr5p20H4mkdk9oGvkFwkWHRl+hGbCh16mp10v9rjb9+iWcP96iezHgWipKyHM293YhuU+7WgstLhwE/hF5MGqf/JF1Sn0RNik6Bm5oY7vvqjiWSaEUEKpelayr9U5820Eujw0OE4cE4/aGp3yLl7gPvJ5HqXLkIfA4b9NaYHF9u1Eq3r0JnGusrDkCCXn3Tal8Z2wE2x/0duNcYmjaZ5LXItkSvyPnnOE1uH21GQ3C1e+1TobBBtfUuG/xIq8EypiIf3+9wYNqsb6Y/nTVqhiCSSm2WJf9F6O6qVJjtj54cezJusPuzrxvDAqs51ArtS+OTWOQykMpLgTx0bs+WK15tcGfqUnCN3xhofTUzkrZTJRrOx2XqJ8P6 J11Jj2Kh Hx5eK1DJx+UO2tiGbLljV6mrJpTLdZXt9wLvh13ZPNpCP852bvHxNjn+X+8vBC1sqvXeWGdYAREh+SNWFMsUFND26F9Fhy4nxIj8gVAcW90rI1qE5UlkDwRs/Qs4SI6IUmmoLUIVw1LMwDwlg5sZaOk9MVVjSBEvgfJUl1kyx6Yv1kQ1v4uTxXxykrsaPbxiBC7/iIZgsw6JDvbjM5Ua1hVBfDyXnBcEc6BdxdnI1hxB+Q8LGJR8Mqm02XqtoFjOZ4kVQRZsL0wnaoGI2eGdPlNI+2ESoMrjkIB86oLoUV6MYvvlIq9CiWWqIZgZq9UA/RaJuu7QVx9/rvt3FJAZFr3tXm1lfMff8qQTpAkrYSiujoJr4Ictluh6e4hQyX1tWHs1c4MMI0mGm7gulHWnKNyRPib0ZXatIDpz6n3VktozseWP6nvdJ0QHMoisP2yVeoixVpHv/my7Xa7Gu14umQYxYEUPhlxQ+6XGC 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: List-Subscribe: List-Unsubscribe: On 9/19/24 00:27, kernel test robot wrote: > Hi Anshuman, > > kernel test robot noticed the following build errors: > > [auto build test ERROR on char-misc/char-misc-testing] > [also build test ERROR on char-misc/char-misc-next char-misc/char-misc-linus brauner-vfs/vfs.all dennis-percpu/for-next linus/master v6.11] > [cannot apply to akpm-mm/mm-everything next-20240918] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: https://github.com/intel-lab-lkp/linux/commits/Anshuman-Khandual/m68k-mm-Change-pmd_val/20240917-153331 > base: char-misc/char-misc-testing > patch link: https://lore.kernel.org/r/20240917073117.1531207-5-anshuman.khandual%40arm.com > patch subject: [PATCH V2 4/7] mm: Use pmdp_get() for accessing PMD entries > config: um-allnoconfig (https://download.01.org/0day-ci/archive/20240919/202409190205.YJ5gtx3T-lkp@intel.com/config) > compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240919/202409190205.YJ5gtx3T-lkp@intel.com/reproduce) > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot > | Closes: https://lore.kernel.org/oe-kbuild-all/202409190205.YJ5gtx3T-lkp@intel.com/ > > All errors (new ones prefixed by >>): > > In file included from mm/pgtable-generic.c:10: > In file included from include/linux/pagemap.h:11: > In file included from include/linux/highmem.h:12: > In file included from include/linux/hardirq.h:11: > In file included from arch/um/include/asm/hardirq.h:5: > In file included from include/asm-generic/hardirq.h:17: > In file included from include/linux/irq.h:20: > In file included from include/linux/io.h:14: > In file included from arch/um/include/asm/io.h:24: > include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] > 548 | val = __raw_readb(PCI_IOBASE + addr); > | ~~~~~~~~~~ ^ > include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] > 561 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); > | ~~~~~~~~~~ ^ > include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu' > 37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) > | ^ > In file included from mm/pgtable-generic.c:10: > In file included from include/linux/pagemap.h:11: > In file included from include/linux/highmem.h:12: > In file included from include/linux/hardirq.h:11: > In file included from arch/um/include/asm/hardirq.h:5: > In file included from include/asm-generic/hardirq.h:17: > In file included from include/linux/irq.h:20: > In file included from include/linux/io.h:14: > In file included from arch/um/include/asm/io.h:24: > include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] > 574 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); > | ~~~~~~~~~~ ^ > include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu' > 35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) > | ^ > In file included from mm/pgtable-generic.c:10: > In file included from include/linux/pagemap.h:11: > In file included from include/linux/highmem.h:12: > In file included from include/linux/hardirq.h:11: > In file included from arch/um/include/asm/hardirq.h:5: > In file included from include/asm-generic/hardirq.h:17: > In file included from include/linux/irq.h:20: > In file included from include/linux/io.h:14: > In file included from arch/um/include/asm/io.h:24: > include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] > 585 | __raw_writeb(value, PCI_IOBASE + addr); > | ~~~~~~~~~~ ^ > include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] > 595 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); > | ~~~~~~~~~~ ^ > include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] > 605 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); > | ~~~~~~~~~~ ^ > include/asm-generic/io.h:693:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] > 693 | readsb(PCI_IOBASE + addr, buffer, count); > | ~~~~~~~~~~ ^ > include/asm-generic/io.h:701:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] > 701 | readsw(PCI_IOBASE + addr, buffer, count); > | ~~~~~~~~~~ ^ > include/asm-generic/io.h:709:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] > 709 | readsl(PCI_IOBASE + addr, buffer, count); > | ~~~~~~~~~~ ^ > include/asm-generic/io.h:718:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] > 718 | writesb(PCI_IOBASE + addr, buffer, count); > | ~~~~~~~~~~ ^ > include/asm-generic/io.h:727:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] > 727 | writesw(PCI_IOBASE + addr, buffer, count); > | ~~~~~~~~~~ ^ > include/asm-generic/io.h:736:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] > 736 | writesl(PCI_IOBASE + addr, buffer, count); Not sure if the above warnings are actually caused by this patch. > | ~~~~~~~~~~ ^ >>> mm/pgtable-generic.c:54:2: error: cannot take the address of an rvalue of type 'pgd_t' > 54 | pmd_ERROR(pmdp_get(pmd)); > | ^~~~~~~~~~~~~~~~~~~~~~~~ > include/asm-generic/pgtable-nopmd.h:36:28: note: expanded from macro 'pmd_ERROR' > 36 | #define pmd_ERROR(pmd) (pud_ERROR((pmd).pud)) > | ^~~~~~~~~~~~~~~~~~~~ > include/asm-generic/pgtable-nopud.h:32:28: note: expanded from macro 'pud_ERROR' > 32 | #define pud_ERROR(pud) (p4d_ERROR((pud).p4d)) > | ^~~~~~~~~~~~~~~~~~~~ > include/asm-generic/pgtable-nop4d.h:25:28: note: expanded from macro 'p4d_ERROR' > 25 | #define p4d_ERROR(p4d) (pgd_ERROR((p4d).pgd)) > | ^~~~~~~~~~~~~~~~~~~~ > arch/um/include/asm/pgtable-2level.h:31:67: note: expanded from macro 'pgd_ERROR' > 31 | printk("%s:%d: bad pgd %p(%08lx).\n", __FILE__, __LINE__, &(e), \ > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ > 32 | pgd_val(e)) > | ~~~~~~~~~~~ > include/linux/printk.h:465:60: note: expanded from macro 'printk' > 465 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__) > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ > include/linux/printk.h:437:19: note: expanded from macro 'printk_index_wrap' > 437 | _p_func(_fmt, ##__VA_ARGS__); \ > | ^~~~~~~~~~~ > 12 warnings and 1 error generated. > > > vim +/pgd_t +54 mm/pgtable-generic.c > > 46 > 47 /* > 48 * Note that the pmd variant below can't be stub'ed out just as for p4d/pud > 49 * above. pmd folding is special and typically pmd_* macros refer to upper > 50 * level even when folded > 51 */ > 52 void pmd_clear_bad(pmd_t *pmd) > 53 { > > 54 pmd_ERROR(pmdp_get(pmd)); > 55 pmd_clear(pmd); > 56 } > 57 > But the above build error can be fixed with the following change. diff --git a/arch/um/include/asm/pgtable-3level.h b/arch/um/include/asm/pgtable-3level.h index 8a5032ec231f..f442c1e3156a 100644 --- a/arch/um/include/asm/pgtable-3level.h +++ b/arch/um/include/asm/pgtable-3level.h @@ -43,13 +43,13 @@ #define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE) #define pte_ERROR(e) \ - printk("%s:%d: bad pte %p(%016lx).\n", __FILE__, __LINE__, &(e), \ + printk("%s:%d: bad pte (%016lx).\n", __FILE__, __LINE__, \ pte_val(e)) #define pmd_ERROR(e) \ - printk("%s:%d: bad pmd %p(%016lx).\n", __FILE__, __LINE__, &(e), \ + printk("%s:%d: bad pmd (%016lx).\n", __FILE__, __LINE__, \ pmd_val(e)) #define pgd_ERROR(e) \ - printk("%s:%d: bad pgd %p(%016lx).\n", __FILE__, __LINE__, &(e), \ + printk("%s:%d: bad pgd (%016lx).\n", __FILE__, __LINE__, \ pgd_val(e)) #define pud_none(x) (!(pud_val(x) & ~_PAGE_NEWPAGE))