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.8 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 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 3A73AC433E6 for ; Fri, 28 Aug 2020 17:32:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C2AF12074A for ; Fri, 28 Aug 2020 17:32:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="RoIcs7O4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2AF12074A 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 5AA0D6B0002; Fri, 28 Aug 2020 13:32:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 533F18E0003; Fri, 28 Aug 2020 13:32:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3FACB6B0005; Fri, 28 Aug 2020 13:32:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0253.hostedemail.com [216.40.44.253]) by kanga.kvack.org (Postfix) with ESMTP id 26A8D6B0002 for ; Fri, 28 Aug 2020 13:32:24 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DBBB45DEA for ; Fri, 28 Aug 2020 17:32:23 +0000 (UTC) X-FDA: 77200671366.07.women92_600058a27077 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id AE3AC1803F9B2 for ; Fri, 28 Aug 2020 17:32:23 +0000 (UTC) X-HE-Tag: women92_600058a27077 X-Filterd-Recvd-Size: 10079 Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Fri, 28 Aug 2020 17:32:22 +0000 (UTC) Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07SHTtjJ139480; Fri, 28 Aug 2020 17:32:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=qi1ykCg7MLfFlE9SrKFqxBtliqwro3Dde1aQSwevJu0=; b=RoIcs7O4yHs1pwm77NqXFzcHJBS6FHNERa0gSewRM5n46489K8i2t6twR1O6nA0B5QyL uvNREjz/9hUZjJp1c5exXtUNtobnvS8sLDwKFLrQIvDM2YQYga2TL6H6nfpmBa96L7GY Qk2pkFX7bvOQ72XT3JDkNPEyQT8uRgWRsyeMQ7beYrfOYShC2g2ZuEToeneJGXDm/L1l tpku/LnukzB5ZgQxQKhpbDTUjEuNrjO1ZUybewfkEyzqnu1h5BoXx3UVmTr+ZGjH4IRZ HjLIaS4x4dCmVE7rtX9WsIa8zVzZsnALb7vaZO3wI/P/fCBM8UDCvkPkPxgu7NpJXZcP GA== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 333dbsd6ev-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 28 Aug 2020 17:32:19 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07SHVTZZ007547; Fri, 28 Aug 2020 17:32:19 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3030.oracle.com with ESMTP id 333r9puc8e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Aug 2020 17:32:19 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 07SHWHZ8032169; Fri, 28 Aug 2020 17:32:17 GMT Received: from [10.175.206.8] (/10.175.206.8) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 28 Aug 2020 10:32:17 -0700 Subject: Re: [linux-next:master 3165/3717] drivers/dax/dax-private.h:94:12: warning: result of comparison of constant 68719476736 with expression of type 'unsigned int' is always false To: Andrew Morton Cc: kernel test robot , kbuild-all@lists.01.org, clang-built-linux@googlegroups.com, Dan Williams , Linux Memory Management List References: <202008280906.WPrik7QQ%lkp@intel.com> From: Joao Martins Message-ID: <435778c3-65c2-7e5d-578d-68cf89ae19bd@oracle.com> Date: Fri, 28 Aug 2020 18:32:12 +0100 MIME-Version: 1.0 In-Reply-To: <202008280906.WPrik7QQ%lkp@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9727 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008280127 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9727 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 clxscore=1011 priorityscore=1501 impostorscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 spamscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008280127 X-Rspamd-Queue-Id: AE3AC1803F9B2 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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/28/20 2:01 AM, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > head: 88abac0b753dfdd85362a26d2da8277cb1e0842b > commit: f464f9a6a06f2f521f78a6e1ac8680bca2e929e4 [3165/3717] device-dax: add an 'align' attribute > config: arm64-randconfig-r013-20200827 (attached as .config) > compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 71f3169e1baeff262583b35ef88f8fb6df7be85e) > 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 arm64 cross compiling tool for clang build > # apt-get install binutils-aarch64-linux-gnu > git checkout f464f9a6a06f2f521f78a6e1ac8680bca2e929e4 > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64 > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > > All warnings (new ones prefixed by >>): > > In file included from drivers/dax/super.c:18: >>> drivers/dax/dax-private.h:94:12: warning: result of comparison of constant 68719476736 with expression of type 'unsigned int' is always false [-Wtautological-constant-out-of-range-compare] > if (align == PUD_SIZE && IS_ENABLED(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD)) > ~~~~~ ^ ~~~~~~~~ > In file included from drivers/dax/bus.c:10: >>> drivers/dax/dax-private.h:94:12: warning: result of comparison of constant 68719476736 with expression of type 'unsigned int' is always false [-Wtautological-constant-out-of-range-compare] > if (align == PUD_SIZE && IS_ENABLED(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD)) > ~~~~~ ^ ~~~~~~~~ > 1 warning generated. > -- > In file included from drivers/dax/device.c:14: >>> drivers/dax/dax-private.h:94:12: warning: result of comparison of constant 68719476736 with expression of type 'unsigned int' is always false [-Wtautological-constant-out-of-range-compare] > if (align == PUD_SIZE && IS_ENABLED(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD)) > ~~~~~ ^ ~~~~~~~~ Despite HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD being x86 only, arm64 would still need the following fixup: device-dax-add-an-align-attribute-fix.patch: From: Joao Martins Date: Fri, 28 Aug 2020 11:33:14 -0400 Subject: [PATCH] device-dax: Fix dax_align_valid() to work on PAGE_SHIFT>=14 With ARM64_PAGE_SHIFT=14, we get: In file included from drivers/dax/device.c:14: drivers/dax/dax-private.h:94:12: warning: result of comparison of constant 68719476736 with expression of type 'unsigned int' is always false [-Wtautological-constant-out-of-range-compare] if (align == PUD_SIZE && IS_ENABLED(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD)) ~~~~~ ^ ~~~~~~~~ In file included from drivers/dax/super.c:18: drivers/dax/dax-private.h:94:12: warning: result of comparison of constant 68719476736 with expression of type 'unsigned int' is always false [-Wtautological-constant-out-of-range-compare] if (align == PUD_SIZE && IS_ENABLED(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD)) ~~~~~ ^ ~~~~~~~~ In file included from drivers/dax/bus.c:10: drivers/dax/dax-private.h:94:12: warning: result of comparison of constant 68719476736 with expression of type 'unsigned int' is always false [-Wtautological-constant-out-of-range-compare] if (align == PUD_SIZE && IS_ENABLED(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD)) ~~~~~ ^ ~~~~~~~~ Or with ARM64_PAGE_SHIFT=16 && ARM64_VA_BITS_52=y: In file included from drivers/dax/device.c:14: drivers/dax/dax-private.h:94:12: warning: result of comparison of constant 4398046511104 with expression of type 'unsigned int' is always false [-Wtautological-constant-out-of-range-compare] if (align == PUD_SIZE && IS_ENABLED(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD)) ~~~~~ ^ ~~~~~~~~ In file included from drivers/dax/super.c:18: drivers/dax/dax-private.h:94:12: warning: result of comparison of constant 4398046511104 with expression of type 'unsigned int' is always false [-Wtautological-constant-out-of-range-compare] if (align == PUD_SIZE && IS_ENABLED(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD)) In file included from drivers/dax/bus.c:10: drivers/dax/dax-private.h:94:12: warning: result of comparison of constant 4398046511104 with expression of type 'unsigned int' is always false [-Wtautological-constant-out-of-range-compare] if (align == PUD_SIZE && IS_ENABLED(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD)) ~~~~~ ^ ~~~~~~~~ Change dax_align_valid() to unsigned long (dax_align_valid() already is unsigned long). Note that in practice CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD is only set on x86, so a dax_align_valid(PUD_SIZE) check always return false. An alternative would be to invert the check to: if (IS_ENABLED(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD) && align == PUD_SIZE) Cc: Dan Williams Cc: Vishal Verma Link: https://lore.kernel.org/linux-mm/202008280906.WPrik7QQ%25lkp@intel.com/ Reported-by: kernel test robot Signed-off-by: Joao Martins --- drivers/dax/dax-private.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dax/dax-private.h b/drivers/dax/dax-private.h index fe337436d7f5..1c974b7caae6 100644 --- a/drivers/dax/dax-private.h +++ b/drivers/dax/dax-private.h @@ -89,7 +89,7 @@ static inline struct dax_mapping *to_dax_mapping(struct device *dev) phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff, unsigned long size); #ifdef CONFIG_TRANSPARENT_HUGEPAGE -static inline bool dax_align_valid(unsigned int align) +static inline bool dax_align_valid(unsigned long align) { if (align == PUD_SIZE && IS_ENABLED(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD)) return true; @@ -100,7 +100,7 @@ static inline bool dax_align_valid(unsigned int align) return false; } #else -static inline bool dax_align_valid(unsigned int align) +static inline bool dax_align_valid(unsigned long align) { return align == PAGE_SIZE; } -- 2.17.1