Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1445042pxk; Fri, 18 Sep 2020 12:40:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqpyZ1EilQ8659YXJUyWapU5wVWYZp6X7ouGEVrtG+z0ZX7W4TNIob3tS+xnHEXUrSpFlo X-Received: by 2002:a17:907:7206:: with SMTP id dr6mr39258925ejc.546.1600458044331; Fri, 18 Sep 2020 12:40:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600458044; cv=none; d=google.com; s=arc-20160816; b=S+PFk72U3dWhagk+++VVJfs2MJBwQfnAEKghnFilyfzSdHPP3TEJ28U8q/yWCxy/lU Hr6IEHfKAVbg5AO/pps+YTBvuotg7juJLcScPRpRpzLOMUBgawkNN9luxwaFSWmYAb2Y NHwG+zK5VDn1H99pJGk4CfXJwSBhnYQzkbO53VvLRQDhOHlojPpxTwUkfcTd8W2y5CyD nskt2ObqK0nU3pjcNJMwXcMNyHp2S0BMzmrY9iyQnR6iZSRMbyMPe1svZTI0VwfEWgiX LSDgU0LSKwLv2KviArfUOjH/i5RCrKZOM5MJYJumWkTkaKzKV+dWFbVOEBZyzThryxyq H4cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ugDHAjreJcjr2sWmhzBxhqb0r9L38OJhgw/SK5/hXcA=; b=ig+gDFN3EUj/7k1/2HyvHqm1+nlUzBDbn+rXZ6FNqRdAn9bhuIs8pdq8i8Offp2y6S ACOYbEwzjpgMhT13FgE+Ih2W3FJaskU7fed4t8FT4jsODrzDhWpZ5rtqQGkkQ+F/Y4DI X+Zm6zGiAs1kGaZDhVc/au4DYkp00Scp6UYzoCVBcCG1AqyJggDZg0rNjNLqY55M7Bi5 icfyrRzIh/AYlS8qIjckmVDx8puHq2dRy6AgzAfsU+FpMSnvRV7XGusw3sOO6T83pth6 mxpp3kSA6Fq1NHQ8RlHNkWTgeViLNAj+gNOC3by5vV8gGdWi63M5fC4pvOL22T8Hgwk0 PJKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MMijeS5i; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m18si930285eja.292.2020.09.18.12.40.10; Fri, 18 Sep 2020 12:40:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MMijeS5i; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726250AbgIRTjo (ORCPT + 99 others); Fri, 18 Sep 2020 15:39:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbgIRTji (ORCPT ); Fri, 18 Sep 2020 15:39:38 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1B50C0613CE for ; Fri, 18 Sep 2020 12:39:38 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id m15so3508698pls.8 for ; Fri, 18 Sep 2020 12:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ugDHAjreJcjr2sWmhzBxhqb0r9L38OJhgw/SK5/hXcA=; b=MMijeS5iSCBD6TdcsROq3wTBNGom0mymBli3Y7GoxookncCyXLPhiCD1hGXMM0OPi5 FseDWPW8AhtFzulUwDfOV2C3xvDwwnImE4cEeDboLKnfr5d0EoqWPWaiBKAtg9etgxJ1 QsnrQSM3hWlZXg8UiHNO4ulb7iMZt/9OiWq3v38GuXw68fRaJ2bKNZWfI61k64ntRwZf uzPs70jvLCyw0j05qFjWEogD5N0tr2ki5DrGgtt/3hABsWDoXC1CkjoQAc0IsqUrG0bC LACfKgVvIhbxEGYIP5RFTiKMGlbl71EUpNLtn63mpCgEKqp3RqIyxU20U5v4ocLq8a11 8OFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ugDHAjreJcjr2sWmhzBxhqb0r9L38OJhgw/SK5/hXcA=; b=mMj7KQ3c7iX0clcu5NM+XBfXsDUleO/xPX5smNvxEH4lCTpiSwfpZF48RqztqoVnAn iabQN6riSAK3c8E15Vwn86Nf9gBYT2/1Avlh6M/52iP+l83xw2FGzt4JkoLYC3FKL0dD sSPSF7G90ws1XtI3zPI0izudbTJIawt43koKJrtsS7m8nypsipCvHxFRjmo+e44zPe/7 dtEt6zWGewg/Yckoui8hZLYmMa1aCvr1joJlUF/q5gmwQVQ7X/mief/gehT8kB+Anq/+ ISAx7kO+apbevdwhIyY1HAaVNKjn2bT+6kOtPYiy8EsLKA1GhnkGyttS+T21tTZaWdf5 FuoA== X-Gm-Message-State: AOAM531TgRBcaJA9LuSwkeZriS3QCbMwgv06lLG8axJ2MrAW2We2h3iw CPoZVGc+NH6H8mrxG7vaRURERsfK0zN2HEEwLMvgSA== X-Received: by 2002:a17:90b:f18:: with SMTP id br24mr1807074pjb.32.1600457977854; Fri, 18 Sep 2020 12:39:37 -0700 (PDT) MIME-Version: 1.0 References: <20200916071950.1493-3-gilad@benyossef.com> <202009162154.fxQ0Z6wT%lkp@intel.com> In-Reply-To: From: Nick Desaulniers Date: Fri, 18 Sep 2020 12:39:26 -0700 Message-ID: Subject: Re: [PATCH 2/2] crypto: ccree - add custom cache params from DT file To: Gilad Ben-Yossef Cc: kernel test robot , Herbert Xu , "David S. Miller" , Rob Herring , kbuild-all@lists.01.org, clang-built-linux , Network Development , Ofir Drang , Linux Crypto Mailing List , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux kernel mailing list , Sami Tolvanen , Alex Elder , Jakub Kicinski Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Sep 17, 2020 at 12:20 AM Gilad Ben-Yossef wrote: > > hmm... > > On Wed, Sep 16, 2020 at 4:48 PM kernel test robot wrote: > > > > url: https://github.com/0day-ci/linux/commits/Gilad-Ben-Yossef/add-optional-cache-params-from-DT/20200916-152151 > > base: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master > > config: arm64-randconfig-r015-20200916 (attached as .config) > > compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 9e3842d60351f986d77dfe0a94f76e4fd895f188) > > 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 > > # 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 >>): > > > > >> drivers/crypto/ccree/cc_driver.c:120:18: warning: result of comparison of constant 18446744073709551615 with expression of type 'u32' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare] > > cache_params |= FIELD_PREP(mask, val); > > ^~~~~~~~~~~~~~~~~~~~~ > > include/linux/bitfield.h:94:3: note: expanded from macro 'FIELD_PREP' > > __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \ > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/bitfield.h:52:28: note: expanded from macro '__BF_FIELD_CHECK' > > BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull, \ > > ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_ON_MSG' > > #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > > ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ > > include/linux/compiler_types.h:319:22: note: expanded from macro 'compiletime_assert' > > _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > > ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/compiler_types.h:307:23: note: expanded from macro '_compiletime_assert' > > __compiletime_assert(condition, msg, prefix, suffix) > > ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/compiler_types.h:299:9: note: expanded from macro '__compiletime_assert' > > if (!(condition)) \ > > ^~~~~~~~~ > > I am unable to understand this warning. It looks like it is > complaining about a FIELD_GET sanity check that is always false, which > makes sense since we're using a constant. > > Anyone can enlighten me if I've missed something? Looked at some of this code recently. I think it may have an issue for masks where sizeof(mask) < sizeof(unsigned long long). In your code, via 0day bot: 107 u32 cache_params, ace_const, val, mask; ... > 120 cache_params |= FIELD_PREP(mask, val); then in include/linux/bitfield.h, we have: 92 #define FIELD_PREP(_mask, _val) \ 93 ({ \ 94 __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \ 44 #define __BF_FIELD_CHECK(_mask, _reg, _val, _pfx) \ ... 52 BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull, \ 53 _pfx "type of reg too small for mask"); \ so the 0ULL in FIELD_PREP is important. In __BF_FIELD_CHECK, the typeof(_reg) is unsigned long long (because 0ULL was passed). So we have a comparison between a u32 and a u64; indeed any u32 can never be greater than a u64 that we know has the value of ULLONG_MAX. I did send a series splitting these up, I wonder if they'd help here: https://lore.kernel.org/lkml/20200708230402.1644819-3-ndesaulniers@google.com/ -- Thanks, ~Nick Desaulniers