tree:
git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git for-kernelci
head: 5d3ec29ac0d7f5b733d85148f225bf06d6ba42ec
commit: 0c97e87b7a27b4d331c3ecba955e5e08a5b708ec [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/ardb/linux.git/commit/?id...
git remote add ardb
git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git
git fetch --no-tags ardb for-kernelci
git checkout 0c97e87b7a27b4d331c3ecba955e5e08a5b708ec
# 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(a)intel.com>
All warnings (new ones prefixed by >>):
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:592:40: warning: passing argument
1 of 'virt_to_phys_or_null_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:155:33: note: expected 'void *' but argument is
of type 'const efi_char16_t *' {aka 'const short unsigned int *'}
155 | virt_to_phys_or_null_size(void *va, unsigned long size)
| ~~~~~~^~
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:621:40: warning: passing argument 1 of
'virt_to_phys_or_null_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:155:33: note: expected 'void *' but argument is
of type 'const efi_char16_t *' {aka 'const short unsigned int *'}
155 | virt_to_phys_or_null_size(void *va, unsigned long size)
| ~~~~~~^~
arch/x86/platform/efi/efi_64.c: In function 'efi_thunk_runtime_setup':
arch/x86/platform/efi/efi_64.c:810:31: error: assignment to 'efi_status_t (*)(const
efi_char16_t *, const efi_guid_t *, u32, long unsigned int, void *)' {aka 'long
unsigned int (*)(const short unsigned int *, const struct <anonymous> *, unsigned
int, long unsigned int, void *)'} from incompatible pointer type 'efi_status_t
(*)(efi_char16_t *, efi_guid_t *, u32, long unsigned int, void *)' {aka 'long
unsigned int (*)(short unsigned int *, struct <anonymous> *, unsigned int, long
unsigned int, void *)'} [-Werror=incompatible-pointer-types]
810 | efi.set_variable_nonblocking = efi_thunk_set_variable_nonblocking;
| ^
cc1: some warnings being treated as errors
vim +592 arch/x86/platform/efi/efi_64.c
4f9dbcfc40299d Matt Fleming 2014-01-10 574
4f9dbcfc40299d Matt Fleming 2014-01-10 575 static efi_status_t
0c97e87b7a27b4 Ard Biesheuvel 2021-03-12 576 efi_thunk_get_variable(const efi_char16_t
*name, const efi_guid_t *vendor,
4f9dbcfc40299d Matt Fleming 2014-01-10 577 u32 *attr, unsigned long
*data_size, void *data)
4f9dbcfc40299d Matt Fleming 2014-01-10 578 {
63056e8b5ebf41 Ard Biesheuvel 2020-02-21 579 u8 buf[24] __aligned(8);
63056e8b5ebf41 Ard Biesheuvel 2020-02-21 580 efi_guid_t *vnd = PTR_ALIGN((efi_guid_t
*)buf, sizeof(*vnd));
4f9dbcfc40299d Matt Fleming 2014-01-10 581 efi_status_t status;
4f9dbcfc40299d Matt Fleming 2014-01-10 582 u32 phys_name, phys_vendor, phys_attr;
4f9dbcfc40299d Matt Fleming 2014-01-10 583 u32 phys_data_size, phys_data;
83a0a2ea0b9919 Ard Biesheuvel 2018-07-20 584 unsigned long flags;
83a0a2ea0b9919 Ard Biesheuvel 2018-07-20 585
83a0a2ea0b9919 Ard Biesheuvel 2018-07-20 586 spin_lock_irqsave(&efi_runtime_lock,
flags);
4f9dbcfc40299d Matt Fleming 2014-01-10 587
63056e8b5ebf41 Ard Biesheuvel 2020-02-21 588 *vnd = *vendor;
63056e8b5ebf41 Ard Biesheuvel 2020-02-21 589
f6697df36bdf0b Matt Fleming 2016-11-12 590 phys_data_size =
virt_to_phys_or_null(data_size);
63056e8b5ebf41 Ard Biesheuvel 2020-02-21 591 phys_vendor = virt_to_phys_or_null(vnd);
f6697df36bdf0b Matt Fleming 2016-11-12 @592 phys_name =
virt_to_phys_or_null_size(name, efi_name_size(name));
f6697df36bdf0b Matt Fleming 2016-11-12 593 phys_attr = virt_to_phys_or_null(attr);
f6697df36bdf0b Matt Fleming 2016-11-12 594 phys_data =
virt_to_phys_or_null_size(data, *data_size);
4f9dbcfc40299d Matt Fleming 2014-01-10 595
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 596 if (!phys_name || (data &&
!phys_data))
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 597 status = EFI_INVALID_PARAMETER;
8319e9d5ad98ff Ard Biesheuvel 2020-02-21 598 else
4f9dbcfc40299d Matt Fleming 2014-01-10 599 status = efi_thunk(get_variable,
phys_name, phys_vendor,
4f9dbcfc40299d Matt Fleming 2014-01-10 600 phys_attr, phys_data_size,
phys_data);
4f9dbcfc40299d Matt Fleming 2014-01-10 601
83a0a2ea0b9919 Ard Biesheuvel 2018-07-20 602
spin_unlock_irqrestore(&efi_runtime_lock, flags);
83a0a2ea0b9919 Ard Biesheuvel 2018-07-20 603
4f9dbcfc40299d Matt Fleming 2014-01-10 604 return status;
4f9dbcfc40299d Matt Fleming 2014-01-10 605 }
4f9dbcfc40299d Matt Fleming 2014-01-10 606
:::::: The code at line 592 was first introduced by commit
:::::: f6697df36bdf0bf7fce984605c2918d4a7b4269f x86/efi: Prevent mixed mode boot
corruption with CONFIG_VMAP_STACK=y
:::::: TO: Matt Fleming <matt(a)codeblueprint.co.uk>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org