* [rppt:unmapped-alloc/rfc-v1 5/5] mm/secretmem.c:56:23: warning: unused variable 'addr'
@ 2023-03-07 14:15 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-03-07 14:15 UTC (permalink / raw)
To: Mike Rapoport (IBM); +Cc: oe-kbuild-all, Mike Rapoport
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git unmapped-alloc/rfc-v1
head: c10ae02315f6ea2dd0b6c74a8ba82ea7ca33cda2
commit: c10ae02315f6ea2dd0b6c74a8ba82ea7ca33cda2 [5/5] EXPERIMENTAL: mm/secretmem: use __GFP_UNMAPPED
config: x86_64-buildonly-randconfig-r001-20230306 (https://download.01.org/0day-ci/archive/20230307/202303072217.EtTWF7gn-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git/commit/?id=c10ae02315f6ea2dd0b6c74a8ba82ea7ca33cda2
git remote add rppt https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git
git fetch --no-tags rppt unmapped-alloc/rfc-v1
git checkout c10ae02315f6ea2dd0b6c74a8ba82ea7ca33cda2
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303072217.EtTWF7gn-lkp@intel.com/
All warnings (new ones prefixed by >>):
mm/secretmem.c: In function 'secretmem_fault':
>> mm/secretmem.c:56:23: warning: unused variable 'addr' [-Wunused-variable]
56 | unsigned long addr;
| ^~~~
vim +/addr +56 mm/secretmem.c
9a436f8ff6316c Mike Rapoport 2021-07-07 49
1507f51255c9ff Mike Rapoport 2021-07-07 50 static vm_fault_t secretmem_fault(struct vm_fault *vmf)
1507f51255c9ff Mike Rapoport 2021-07-07 51 {
1507f51255c9ff Mike Rapoport 2021-07-07 52 struct address_space *mapping = vmf->vma->vm_file->f_mapping;
1507f51255c9ff Mike Rapoport 2021-07-07 53 struct inode *inode = file_inode(vmf->vma->vm_file);
1507f51255c9ff Mike Rapoport 2021-07-07 54 pgoff_t offset = vmf->pgoff;
1507f51255c9ff Mike Rapoport 2021-07-07 55 gfp_t gfp = vmf->gfp_mask;
1507f51255c9ff Mike Rapoport 2021-07-07 @56 unsigned long addr;
1507f51255c9ff Mike Rapoport 2021-07-07 57 struct page *page;
84ac013046ccc4 Mike Rapoport 2022-07-07 58 vm_fault_t ret;
1507f51255c9ff Mike Rapoport 2021-07-07 59 int err;
1507f51255c9ff Mike Rapoport 2021-07-07 60
1507f51255c9ff Mike Rapoport 2021-07-07 61 if (((loff_t)vmf->pgoff << PAGE_SHIFT) >= i_size_read(inode))
1507f51255c9ff Mike Rapoport 2021-07-07 62 return vmf_error(-EINVAL);
1507f51255c9ff Mike Rapoport 2021-07-07 63
84ac013046ccc4 Mike Rapoport 2022-07-07 64 filemap_invalidate_lock_shared(mapping);
84ac013046ccc4 Mike Rapoport 2022-07-07 65
1507f51255c9ff Mike Rapoport 2021-07-07 66 retry:
1507f51255c9ff Mike Rapoport 2021-07-07 67 page = find_lock_page(mapping, offset);
1507f51255c9ff Mike Rapoport 2021-07-07 68 if (!page) {
c10ae02315f6ea Mike Rapoport (IBM 2022-11-17 69) page = alloc_page(gfp | __GFP_ZERO | __GFP_UNMAPPED);
84ac013046ccc4 Mike Rapoport 2022-07-07 70 if (!page) {
84ac013046ccc4 Mike Rapoport 2022-07-07 71 ret = VM_FAULT_OOM;
84ac013046ccc4 Mike Rapoport 2022-07-07 72 goto out;
84ac013046ccc4 Mike Rapoport 2022-07-07 73 }
1507f51255c9ff Mike Rapoport 2021-07-07 74
1507f51255c9ff Mike Rapoport 2021-07-07 75 __SetPageUptodate(page);
1507f51255c9ff Mike Rapoport 2021-07-07 76 err = add_to_page_cache_lru(page, mapping, offset, gfp);
1507f51255c9ff Mike Rapoport 2021-07-07 77 if (unlikely(err)) {
1507f51255c9ff Mike Rapoport 2021-07-07 78 put_page(page);
1507f51255c9ff Mike Rapoport 2021-07-07 79 if (err == -EEXIST)
1507f51255c9ff Mike Rapoport 2021-07-07 80 goto retry;
1507f51255c9ff Mike Rapoport 2021-07-07 81
84ac013046ccc4 Mike Rapoport 2022-07-07 82 ret = vmf_error(err);
84ac013046ccc4 Mike Rapoport 2022-07-07 83 goto out;
1507f51255c9ff Mike Rapoport 2021-07-07 84 }
1507f51255c9ff Mike Rapoport 2021-07-07 85 }
1507f51255c9ff Mike Rapoport 2021-07-07 86
1507f51255c9ff Mike Rapoport 2021-07-07 87 vmf->page = page;
84ac013046ccc4 Mike Rapoport 2022-07-07 88 ret = VM_FAULT_LOCKED;
84ac013046ccc4 Mike Rapoport 2022-07-07 89
84ac013046ccc4 Mike Rapoport 2022-07-07 90 out:
84ac013046ccc4 Mike Rapoport 2022-07-07 91 filemap_invalidate_unlock_shared(mapping);
84ac013046ccc4 Mike Rapoport 2022-07-07 92 return ret;
1507f51255c9ff Mike Rapoport 2021-07-07 93 }
1507f51255c9ff Mike Rapoport 2021-07-07 94
:::::: The code at line 56 was first introduced by commit
:::::: 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49 mm: introduce memfd_secret system call to create "secret" memory areas
:::::: TO: Mike Rapoport <rppt@linux.ibm.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 2+ messages in thread
* [rppt:unmapped-alloc/rfc-v1 5/5] mm/secretmem.c:56:23: warning: unused variable 'addr'
@ 2023-03-06 22:33 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-03-06 22:33 UTC (permalink / raw)
To: Mike Rapoport (IBM); +Cc: oe-kbuild-all, Mike Rapoport
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git unmapped-alloc/rfc-v1
head: 2f53d9d6383b30f320f5030bcc466b96737b9606
commit: 2f53d9d6383b30f320f5030bcc466b96737b9606 [5/5] EXPERIMENTAL: mm/secretmem: use __GFP_UNMAPPED
config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20230307/202303070609.HOppmoFR-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git/commit/?id=2f53d9d6383b30f320f5030bcc466b96737b9606
git remote add rppt https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git
git fetch --no-tags rppt unmapped-alloc/rfc-v1
git checkout 2f53d9d6383b30f320f5030bcc466b96737b9606
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303070609.HOppmoFR-lkp@intel.com/
All warnings (new ones prefixed by >>):
mm/secretmem.c: In function 'secretmem_fault':
>> mm/secretmem.c:56:23: warning: unused variable 'addr' [-Wunused-variable]
56 | unsigned long addr;
| ^~~~
vim +/addr +56 mm/secretmem.c
9a436f8ff6316c Mike Rapoport 2021-07-07 49
1507f51255c9ff Mike Rapoport 2021-07-07 50 static vm_fault_t secretmem_fault(struct vm_fault *vmf)
1507f51255c9ff Mike Rapoport 2021-07-07 51 {
1507f51255c9ff Mike Rapoport 2021-07-07 52 struct address_space *mapping = vmf->vma->vm_file->f_mapping;
1507f51255c9ff Mike Rapoport 2021-07-07 53 struct inode *inode = file_inode(vmf->vma->vm_file);
1507f51255c9ff Mike Rapoport 2021-07-07 54 pgoff_t offset = vmf->pgoff;
1507f51255c9ff Mike Rapoport 2021-07-07 55 gfp_t gfp = vmf->gfp_mask;
1507f51255c9ff Mike Rapoport 2021-07-07 @56 unsigned long addr;
1507f51255c9ff Mike Rapoport 2021-07-07 57 struct page *page;
84ac013046ccc4 Mike Rapoport 2022-07-07 58 vm_fault_t ret;
1507f51255c9ff Mike Rapoport 2021-07-07 59 int err;
1507f51255c9ff Mike Rapoport 2021-07-07 60
1507f51255c9ff Mike Rapoport 2021-07-07 61 if (((loff_t)vmf->pgoff << PAGE_SHIFT) >= i_size_read(inode))
1507f51255c9ff Mike Rapoport 2021-07-07 62 return vmf_error(-EINVAL);
1507f51255c9ff Mike Rapoport 2021-07-07 63
84ac013046ccc4 Mike Rapoport 2022-07-07 64 filemap_invalidate_lock_shared(mapping);
84ac013046ccc4 Mike Rapoport 2022-07-07 65
1507f51255c9ff Mike Rapoport 2021-07-07 66 retry:
1507f51255c9ff Mike Rapoport 2021-07-07 67 page = find_lock_page(mapping, offset);
1507f51255c9ff Mike Rapoport 2021-07-07 68 if (!page) {
2f53d9d6383b30 Mike Rapoport (IBM 2022-11-17 69) page = alloc_page(gfp | __GFP_ZERO | __GFP_UNMAPPED);
84ac013046ccc4 Mike Rapoport 2022-07-07 70 if (!page) {
84ac013046ccc4 Mike Rapoport 2022-07-07 71 ret = VM_FAULT_OOM;
84ac013046ccc4 Mike Rapoport 2022-07-07 72 goto out;
84ac013046ccc4 Mike Rapoport 2022-07-07 73 }
1507f51255c9ff Mike Rapoport 2021-07-07 74
1507f51255c9ff Mike Rapoport 2021-07-07 75 __SetPageUptodate(page);
1507f51255c9ff Mike Rapoport 2021-07-07 76 err = add_to_page_cache_lru(page, mapping, offset, gfp);
1507f51255c9ff Mike Rapoport 2021-07-07 77 if (unlikely(err)) {
1507f51255c9ff Mike Rapoport 2021-07-07 78 put_page(page);
1507f51255c9ff Mike Rapoport 2021-07-07 79 if (err == -EEXIST)
1507f51255c9ff Mike Rapoport 2021-07-07 80 goto retry;
1507f51255c9ff Mike Rapoport 2021-07-07 81
84ac013046ccc4 Mike Rapoport 2022-07-07 82 ret = vmf_error(err);
84ac013046ccc4 Mike Rapoport 2022-07-07 83 goto out;
1507f51255c9ff Mike Rapoport 2021-07-07 84 }
1507f51255c9ff Mike Rapoport 2021-07-07 85 }
1507f51255c9ff Mike Rapoport 2021-07-07 86
1507f51255c9ff Mike Rapoport 2021-07-07 87 vmf->page = page;
84ac013046ccc4 Mike Rapoport 2022-07-07 88 ret = VM_FAULT_LOCKED;
84ac013046ccc4 Mike Rapoport 2022-07-07 89
84ac013046ccc4 Mike Rapoport 2022-07-07 90 out:
84ac013046ccc4 Mike Rapoport 2022-07-07 91 filemap_invalidate_unlock_shared(mapping);
84ac013046ccc4 Mike Rapoport 2022-07-07 92 return ret;
1507f51255c9ff Mike Rapoport 2021-07-07 93 }
1507f51255c9ff Mike Rapoport 2021-07-07 94
:::::: The code at line 56 was first introduced by commit
:::::: 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49 mm: introduce memfd_secret system call to create "secret" memory areas
:::::: TO: Mike Rapoport <rppt@linux.ibm.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-07 14:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-07 14:15 [rppt:unmapped-alloc/rfc-v1 5/5] mm/secretmem.c:56:23: warning: unused variable 'addr' kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2023-03-06 22:33 kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.