public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* Re: [PATCH RFC v2 3/5] kvm: Convert to use guest_memfd library
       [not found] <20240829-guest-memfd-lib-v2-3-b9afc1ff3656@quicinc.com>
@ 2024-09-02  8:20 ` kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-09-02  8:20 UTC (permalink / raw)
  To: Elliot Berman; +Cc: llvm, oe-kbuild-all

Hi Elliot,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:

[auto build test ERROR on 5be63fc19fcaa4c236b307420483578a56986a37]

url:    https://github.com/intel-lab-lkp/linux/commits/Elliot-Berman/mm-Introduce-guest_memfd/20240830-062545
base:   5be63fc19fcaa4c236b307420483578a56986a37
patch link:    https://lore.kernel.org/r/20240829-guest-memfd-lib-v2-3-b9afc1ff3656%40quicinc.com
patch subject: [PATCH RFC v2 3/5] kvm: Convert to use guest_memfd library
config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20240902/202409021535.vtV8F7s7-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240902/202409021535.vtV8F7s7-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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409021535.vtV8F7s7-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

>> mm/guest_memfd.c:443:5: warning: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Wformat]
     442 |         WARN_ONCE(val != expected, "folio[%x] safe ref: %d != expected %d\n",
         |                                           ~~
         |                                           %lx
     443 |                   folio_index(folio), val, expected);
         |                   ^~~~~~~~~~~~~~~~~~
   include/asm-generic/bug.h:152:38: note: expanded from macro 'WARN_ONCE'
     152 |         DO_ONCE_LITE_IF(condition, WARN, 1, format)
         |                                             ^~~~~~
   include/linux/once_lite.h:31:9: note: expanded from macro 'DO_ONCE_LITE_IF'
      31 |                         func(__VA_ARGS__);                              \
         |                              ^~~~~~~~~~~
   include/asm-generic/bug.h:134:29: note: expanded from macro 'WARN'
     134 |                 __WARN_printf(TAINT_WARN, format);                      \
         |                                           ^~~~~~
   include/asm-generic/bug.h:106:17: note: expanded from macro '__WARN_printf'
     106 |                 __warn_printk(arg);                                     \
         |                               ^~~
>> mm/guest_memfd.c:443:25: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
     442 |         WARN_ONCE(val != expected, "folio[%x] safe ref: %d != expected %d\n",
         |                                                         ~~
         |                                                         %lu
     443 |                   folio_index(folio), val, expected);
         |                                       ^~~
   include/asm-generic/bug.h:152:38: note: expanded from macro 'WARN_ONCE'
     152 |         DO_ONCE_LITE_IF(condition, WARN, 1, format)
         |                                             ^~~~~~
   include/linux/once_lite.h:31:9: note: expanded from macro 'DO_ONCE_LITE_IF'
      31 |                         func(__VA_ARGS__);                              \
         |                              ^~~~~~~~~~~
   include/asm-generic/bug.h:134:29: note: expanded from macro 'WARN'
     134 |                 __WARN_printf(TAINT_WARN, format);                      \
         |                                           ^~~~~~
   include/asm-generic/bug.h:106:17: note: expanded from macro '__WARN_printf'
     106 |                 __warn_printk(arg);                                     \
         |                               ^~~
   mm/guest_memfd.c:443:30: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
     442 |         WARN_ONCE(val != expected, "folio[%x] safe ref: %d != expected %d\n",
         |                                                                        ~~
         |                                                                        %lu
     443 |                   folio_index(folio), val, expected);
         |                                            ^~~~~~~~
   include/asm-generic/bug.h:152:38: note: expanded from macro 'WARN_ONCE'
     152 |         DO_ONCE_LITE_IF(condition, WARN, 1, format)
         |                                             ^~~~~~
   include/linux/once_lite.h:31:9: note: expanded from macro 'DO_ONCE_LITE_IF'
      31 |                         func(__VA_ARGS__);                              \
         |                              ^~~~~~~~~~~
   include/asm-generic/bug.h:134:29: note: expanded from macro 'WARN'
     134 |                 __WARN_printf(TAINT_WARN, format);                      \
         |                                           ^~~~~~
   include/asm-generic/bug.h:106:17: note: expanded from macro '__WARN_printf'
     106 |                 __warn_printk(arg);                                     \
         |                               ^~~
   3 warnings generated.
--
>> arch/x86/kvm/../../../virt/kvm/guest_memfd.c:37:14: error: use of undeclared identifier 'slot'
      37 |         gfn_t gfn = slot->base_gfn + folio_index(folio) - slot->gmem.pgoff;
         |                     ^
   arch/x86/kvm/../../../virt/kvm/guest_memfd.c:37:52: error: use of undeclared identifier 'slot'
      37 |         gfn_t gfn = slot->base_gfn + folio_index(folio) - slot->gmem.pgoff;
         |                                                           ^
>> arch/x86/kvm/../../../virt/kvm/guest_memfd.c:38:33: error: use of undeclared identifier 'kvm'
      38 |         int rc = kvm_arch_gmem_prepare(kvm, gfn, pfn, folio_order(folio));
         |                                        ^
>> arch/x86/kvm/../../../virt/kvm/guest_memfd.c:41:9: error: call to undeclared library function 'index' with type 'char *(const char *, int)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      41 |                                     index, gfn, pfn, rc);
         |                                     ^
   arch/x86/kvm/../../../virt/kvm/guest_memfd.c:41:9: note: include the header <strings.h> or explicitly provide a declaration for 'index'
>> arch/x86/kvm/../../../virt/kvm/guest_memfd.c:41:9: warning: format specifies type 'unsigned long' but the argument has type 'char *(*)(const char *, int)' [-Wformat]
      40 |                 pr_warn_ratelimited("gmem: Failed to prepare folio for index %lx GFN %llx PFN %llx error %d.\n",
         |                                                                              ~~~
      41 |                                     index, gfn, pfn, rc);
         |                                     ^~~~~
   include/linux/printk.h:675:49: note: expanded from macro 'pr_warn_ratelimited'
     675 |         printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
         |                                                ~~~     ^~~~~~~~~~~
   include/linux/printk.h:659:17: note: expanded from macro 'printk_ratelimited'
     659 |                 printk(fmt, ##__VA_ARGS__);                             \
         |                        ~~~    ^~~~~~~~~~~
   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__);                           \
         |                         ~~~~    ^~~~~~~~~~~
>> arch/x86/kvm/../../../virt/kvm/guest_memfd.c:362:3: error: use of undeclared identifier 'grab_flags'
     362 |                 grab_flags = GUEST_MEMFD_GRAB_ACCESSIBLE;
         |                 ^
   arch/x86/kvm/../../../virt/kvm/guest_memfd.c:364:3: error: use of undeclared identifier 'grab_flags'
     364 |                 grab_flags = GUEST_MEMFD_GRAB_INACCESSIBLE;
         |                 ^
   arch/x86/kvm/../../../virt/kvm/guest_memfd.c:366:46: error: use of undeclared identifier 'grab_flags'; did you mean 'iocb_flags'?
     366 |         folio = guest_memfd_grab_folio(file, index, grab_flags);
         |                                                     ^~~~~~~~~~
         |                                                     iocb_flags
   include/linux/fs.h:3431:19: note: 'iocb_flags' declared here
    3431 | static inline int iocb_flags(struct file *file)
         |                   ^
   1 warning and 7 errors generated.
--
>> arch/x86/kvm/svm/sev.c:2300:9: error: call to undeclared function 'guest_memfd_make_inaccessible'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    2300 |                 ret = guest_memfd_make_inaccessible(pfn_folio(pfn));
         |                       ^
   1 error generated.


vim +/grab_flags +362 arch/x86/kvm/../../../virt/kvm/guest_memfd.c

   336	
   337	/* Returns a locked folio on success.  */
   338	static struct folio *
   339	__kvm_gmem_get_pfn(struct file *file, struct kvm_memory_slot *slot,
   340			   gfn_t gfn, kvm_pfn_t *pfn, bool accessible,
   341			   int *max_order)
   342	{
   343		pgoff_t index = gfn - slot->base_gfn + slot->gmem.pgoff;
   344		struct kvm_gmem *gmem = file->private_data;
   345		struct folio *folio;
   346	
   347		if (file != slot->gmem.file) {
   348			WARN_ON_ONCE(slot->gmem.file);
   349			return ERR_PTR(-EFAULT);
   350		}
   351	
   352		gmem = file_to_kvm_gmem(file);
   353		if (WARN_ON_ONCE(!gmem))
   354			return ERR_PTR(-EFAULT);
   355	
   356		if (xa_load(&gmem->bindings, index) != slot) {
   357			WARN_ON_ONCE(xa_load(&gmem->bindings, index));
   358			return ERR_PTR(-EIO);
   359		}
   360	
   361		if (accessible)
 > 362			grab_flags = GUEST_MEMFD_GRAB_ACCESSIBLE;
   363		else
   364			grab_flags = GUEST_MEMFD_GRAB_INACCESSIBLE;
   365	
   366		folio = guest_memfd_grab_folio(file, index, grab_flags);
   367		if (IS_ERR(folio))
   368			return folio;
   369	
   370		if (folio_test_hwpoison(folio)) {
   371			folio_unlock(folio);
   372			guest_memfd_put_folio(folio, accessible ? 1 : 0);
   373			return ERR_PTR(-EHWPOISON);
   374		}
   375	
   376		*pfn = folio_file_pfn(folio, index);
   377		if (max_order)
   378			*max_order = 0;
   379	
   380		return folio;
   381	}
   382	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-09-02  8:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240829-guest-memfd-lib-v2-3-b9afc1ff3656@quicinc.com>
2024-09-02  8:20 ` [PATCH RFC v2 3/5] kvm: Convert to use guest_memfd library kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox