From: Mike Kravetz <mike.kravetz@oracle.com>
To: kbuild test robot <fengguang.wu@intel.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: kbuild-all@01.org, Johannes Weiner <hannes@cmpxchg.org>,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [mmotm:master 8/285] fs//hugetlbfs/inode.c:142:22: note: in expansion of macro 'PGOFF_LOFFT_MAX'
Date: Wed, 14 Mar 2018 11:52:51 -0700 [thread overview]
Message-ID: <0d54df0b-1e53-58a0-81ff-e496ae2f7cd8@oracle.com> (raw)
In-Reply-To: <201803141423.WZYJTFEz%fengguang.wu@intel.com>
On 03/13/2018 11:15 PM, kbuild test robot wrote:
> tree: git://git.cmpxchg.org/linux-mmotm.git master
> head: ead058c4ec49752a4e0323368f1d695385c66020
> commit: af7abfba1161d2814301844fe11adac16910ea80 [8/285] hugetlbfs-check-for-pgoff-value-overflow-v3
> config: sh-defconfig (attached as .config)
> compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
> reproduce:
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> git checkout af7abfba1161d2814301844fe11adac16910ea80
> # save the attached .config to linux build tree
> make.cross ARCH=sh
>
> All warnings (new ones prefixed by >>):
>
> fs//hugetlbfs/inode.c: In function 'hugetlbfs_file_mmap':
>>> fs//hugetlbfs/inode.c:118:36: warning: left shift count is negative [-Wshift-count-negative]
> #define PGOFF_LOFFT_MAX (PAGE_MASK << (BITS_PER_LONG - (2 * PAGE_SHIFT) - 1))
> ^
BITS_PER_LONG = 32 (32bit config)
PAGE_SHIFT = 16 (64K pages)
This results in the negative shift value.
I had proposed another (not so pretty way) to create the mask.
#define PGOFF_LOFFT_MAX \
(((1UL << (PAGE_SHIFT + 1)) - 1) << (BITS_PER_LONG - (PAGE_SHIFT + 1)))
This works for the above config, and should work for any.
Andrew, how would you like me to update the patch? I can send a new
version but know you have also made some changes for VM_WARN. Would
you simply like a delta on top of the current patch?
--
Mike Kravetz
next prev parent reply other threads:[~2018-03-14 18:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-14 6:15 kbuild test robot
2018-03-14 18:52 ` Mike Kravetz [this message]
2018-03-14 21:46 ` Andrew Morton
2018-03-14 21:50 ` Mike Kravetz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0d54df0b-1e53-58a0-81ff-e496ae2f7cd8@oracle.com \
--to=mike.kravetz@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=fengguang.wu@intel.com \
--cc=hannes@cmpxchg.org \
--cc=kbuild-all@01.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox