linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [efi:next 3/4] arch/x86/platform/efi/efi_64.c:163:23: warning: passing argument 1 of 'virt_to_phys' discards 'const' qualifier from pointer target type
@ 2021-03-12 17:10 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-03-12 17:10 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: kbuild-all, linux-efi

[-- Attachment #1: Type: text/plain, Size: 7087 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
head:   23efbcdb197f07d67f7dcac9037fdf9972b88d9b
commit: 71703d1e1b51e986ad5be41594328d5afa902672 [3/4] efi: use const* paramaters for get/setvar by-ref arguments annotated as IN
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?id=71703d1e1b51e986ad5be41594328d5afa902672
        git remote add efi https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
        git fetch --no-tags efi next
        git checkout 71703d1e1b51e986ad5be41594328d5afa902672
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   arch/x86/platform/efi/efi_64.c: In function 'virt_to_phys_or_null_size':
>> arch/x86/platform/efi/efi_64.c:163:23: warning: passing argument 1 of 'virt_to_phys' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     163 |   return virt_to_phys(va);
         |                       ^~
   In file included from arch/x86/include/asm/dma.h:13,
                    from include/linux/memblock.h:14,
                    from arch/x86/platform/efi/efi_64.c:26:
   arch/x86/include/asm/io.h:129:55: note: expected 'volatile void *' but argument is of type 'const void *'
     129 | static inline phys_addr_t virt_to_phys(volatile void *address)
         |                                        ~~~~~~~~~~~~~~~^~~~~~~
>> arch/x86/platform/efi/efi_64.c:165:25: warning: passing argument 1 of 'slow_virt_to_phys' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     165 |  pa = slow_virt_to_phys(va);
         |                         ^~
   In file included from arch/x86/include/asm/paravirt_types.h:44,
                    from arch/x86/include/asm/ptrace.h:94,
                    from arch/x86/include/asm/math_emu.h:5,
                    from arch/x86/include/asm/processor.h:13,
                    from arch/x86/include/asm/cpufeature.h:5,
                    from arch/x86/include/asm/thread_info.h:53,
                    from include/linux/thread_info.h:58,
                    from arch/x86/include/asm/preempt.h:7,
                    from include/linux/preempt.h:78,
                    from include/linux/spinlock.h:51,
                    from include/linux/mmzone.h:8,
                    from include/linux/gfp.h:6,
                    from include/linux/mm.h:10,
                    from arch/x86/platform/efi/efi_64.c:23:
   arch/x86/include/asm/pgtable_types.h:569:44: note: expected 'void *' but argument is of type 'const void *'
     569 | extern phys_addr_t slow_virt_to_phys(void *__address);
         |                                      ~~~~~~^~~~~~~~~
   arch/x86/platform/efi/efi_64.c: In function 'efi_thunk_get_variable':
   arch/x86/platform/efi/efi_64.c:592:60: warning: passing argument 1 of 'efi_name_size' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     592 |  phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
         |                                                            ^~~~
   arch/x86/platform/efi/efi_64.c:570:50: note: expected 'efi_char16_t *' {aka 'short unsigned int *'} but argument is of type 'const efi_char16_t *' {aka 'const short unsigned int *'}
     570 | static unsigned long efi_name_size(efi_char16_t *name)
         |                                    ~~~~~~~~~~~~~~^~~~
   arch/x86/platform/efi/efi_64.c: In function 'efi_thunk_set_variable':
   arch/x86/platform/efi/efi_64.c:621:60: warning: passing argument 1 of 'efi_name_size' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     621 |  phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
         |                                                            ^~~~
   arch/x86/platform/efi/efi_64.c:570:50: note: expected 'efi_char16_t *' {aka 'short unsigned int *'} but argument is of type 'const efi_char16_t *' {aka 'const short unsigned int *'}
     570 | static unsigned long efi_name_size(efi_char16_t *name)
         |                                    ~~~~~~~~~~~~~~^~~~
   arch/x86/platform/efi/efi_64.c: In function 'efi_thunk_set_variable_nonblocking':
   arch/x86/platform/efi/efi_64.c:653:60: warning: passing argument 1 of 'efi_name_size' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     653 |  phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
         |                                                            ^~~~
   arch/x86/platform/efi/efi_64.c:570:50: note: expected 'efi_char16_t *' {aka 'short unsigned int *'} but argument is of type 'const efi_char16_t *' {aka 'const short unsigned int *'}
     570 | static unsigned long efi_name_size(efi_char16_t *name)
         |                                    ~~~~~~~~~~~~~~^~~~


vim +163 arch/x86/platform/efi/efi_64.c

d2f7cbe7b26a74 Borislav Petkov 2013-10-31  150  
f6697df36bdf0b Matt Fleming    2016-11-12  151  /*
f6697df36bdf0b Matt Fleming    2016-11-12  152   * Wrapper for slow_virt_to_phys() that handles NULL addresses.
f6697df36bdf0b Matt Fleming    2016-11-12  153   */
f6697df36bdf0b Matt Fleming    2016-11-12  154  static inline phys_addr_t
71703d1e1b51e9 Ard Biesheuvel  2021-03-12  155  virt_to_phys_or_null_size(const void *va, unsigned long size)
f6697df36bdf0b Matt Fleming    2016-11-12  156  {
8319e9d5ad98ff Ard Biesheuvel  2020-02-21  157  	phys_addr_t pa;
f6697df36bdf0b Matt Fleming    2016-11-12  158  
f6697df36bdf0b Matt Fleming    2016-11-12  159  	if (!va)
f6697df36bdf0b Matt Fleming    2016-11-12  160  		return 0;
f6697df36bdf0b Matt Fleming    2016-11-12  161  
f6697df36bdf0b Matt Fleming    2016-11-12  162  	if (virt_addr_valid(va))
f6697df36bdf0b Matt Fleming    2016-11-12 @163  		return virt_to_phys(va);
f6697df36bdf0b Matt Fleming    2016-11-12  164  
8319e9d5ad98ff Ard Biesheuvel  2020-02-21 @165  	pa = slow_virt_to_phys(va);
f6697df36bdf0b Matt Fleming    2016-11-12  166  
8319e9d5ad98ff Ard Biesheuvel  2020-02-21  167  	/* check if the object crosses a page boundary */
8319e9d5ad98ff Ard Biesheuvel  2020-02-21  168  	if (WARN_ON((pa ^ (pa + size - 1)) & PAGE_MASK))
8319e9d5ad98ff Ard Biesheuvel  2020-02-21  169  		return 0;
f6697df36bdf0b Matt Fleming    2016-11-12  170  
8319e9d5ad98ff Ard Biesheuvel  2020-02-21  171  	return pa;
f6697df36bdf0b Matt Fleming    2016-11-12  172  }
f6697df36bdf0b Matt Fleming    2016-11-12  173  

:::::: The code at line 163 was first introduced by commit
:::::: f6697df36bdf0bf7fce984605c2918d4a7b4269f x86/efi: Prevent mixed mode boot corruption with CONFIG_VMAP_STACK=y

:::::: TO: Matt Fleming <matt@codeblueprint.co.uk>
:::::: CC: Ingo Molnar <mingo@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 65454 bytes --]

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

only message in thread, other threads:[~2021-03-12 17:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12 17:10 [efi:next 3/4] arch/x86/platform/efi/efi_64.c:163:23: warning: passing argument 1 of 'virt_to_phys' discards 'const' qualifier from pointer target type 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;
as well as URLs for NNTP newsgroup(s).