2022-10-10 08:24:54

by kernel test robot

[permalink] [raw]
Subject: drivers/firmware/efi/libstub/zboot.c:163:1: sparse: sparse: symbol 'efi_zboot_entry' was not declared. Should it be static?

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 493ffd6605b2d3d4dc7008ab927dba319f36671f
commit: a050910972bb25152b42ad2e544652117c5ad915 efi/libstub: implement generic EFI zboot
date: 3 weeks ago
config: loongarch-randconfig-s042-20221010
compiler: loongarch64-linux-gcc (GCC) 12.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a050910972bb25152b42ad2e544652117c5ad915
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout a050910972bb25152b42ad2e544652117c5ad915
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=loongarch SHELL=/bin/bash drivers/firmware/efi/libstub/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>

sparse warnings: (new ones prefixed by >>)
>> drivers/firmware/efi/libstub/zboot.c:163:1: sparse: sparse: symbol 'efi_zboot_entry' was not declared. Should it be static?

vim +/efi_zboot_entry +163 drivers/firmware/efi/libstub/zboot.c

161
162 asmlinkage efi_status_t __efiapi
> 163 efi_zboot_entry(efi_handle_t handle, efi_system_table_t *systab)

--
0-DAY CI Kernel Test Service
https://01.org/lkp


Attachments:
(No filename) (1.69 kB)
config (145.62 kB)
Download all attachments

2022-10-18 19:54:51

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: drivers/firmware/efi/libstub/zboot.c:163:1: sparse: sparse: symbol 'efi_zboot_entry' was not declared. Should it be static?

This is another spurious report of an asmlinkage symbol.

On Tue, 18 Oct 2022 at 21:49, kernel test robot <[email protected]> wrote:
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: bb1a1146467ad812bb65440696df0782e2bc63c8
> commit: a050910972bb25152b42ad2e544652117c5ad915 efi/libstub: implement generic EFI zboot
> date: 4 weeks ago
> config: riscv-randconfig-s043-20221018
> compiler: riscv64-linux-gcc (GCC) 12.1.0
> reproduce:
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # apt-get install sparse
> # sparse version: v0.6.4-39-gce1a6720-dirty
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a050910972bb25152b42ad2e544652117c5ad915
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout a050910972bb25152b42ad2e544652117c5ad915
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash drivers/firmware/efi/libstub/ lib/xz/
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <[email protected]>
>
> sparse warnings: (new ones prefixed by >>)
> WARNING: invalid argument to '-march': '_zihintpause'
> drivers/firmware/efi/libstub/zboot.c: note: in included file (through drivers/firmware/efi/libstub/../../../../lib/decompress_unxz.c):
> >> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:393:28: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:393:28: sparse: expected restricted __le32 const [usertype] *p
> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:393:28: sparse: got unsigned int const [usertype] *
> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:427:48: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:427:48: sparse: expected restricted __le32 const [usertype] *p
> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:427:48: sparse: got unsigned int const [usertype] *
> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:435:37: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:435:37: sparse: expected restricted __le32 const [usertype] *p
> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:435:37: sparse: got unsigned int const [usertype] *
> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:459:28: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:459:28: sparse: expected restricted __le32 const [usertype] *p
> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:459:28: sparse: got unsigned int const [usertype] *
> >> drivers/firmware/efi/libstub/zboot.c:163:1: sparse: sparse: symbol 'efi_zboot_entry' was not declared. Should it be static?
>
> vim +/efi_zboot_entry +163 drivers/firmware/efi/libstub/zboot.c
>
> 161
> 162 asmlinkage efi_status_t __efiapi
> > 163 efi_zboot_entry(efi_handle_t handle, efi_system_table_t *systab)
>
> --
> 0-DAY CI Kernel Test Service
> https://01.org/lkp

2022-10-19 09:39:04

by Chen, Rong A

[permalink] [raw]
Subject: Re: [kbuild-all] Re: drivers/firmware/efi/libstub/zboot.c:163:1: sparse: sparse: symbol 'efi_zboot_entry' was not declared. Should it be static?



On 10/19/2022 3:50 AM, Ard Biesheuvel wrote:
> This is another spurious report of an asmlinkage symbol.

Hi Ard,

Thanks for your reply, we'll add this warning to the ignore list.

Best Regards,
Rong Chen

>
> On Tue, 18 Oct 2022 at 21:49, kernel test robot <[email protected]> wrote:
>>
>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>> head: bb1a1146467ad812bb65440696df0782e2bc63c8
>> commit: a050910972bb25152b42ad2e544652117c5ad915 efi/libstub: implement generic EFI zboot
>> date: 4 weeks ago
>> config: riscv-randconfig-s043-20221018
>> compiler: riscv64-linux-gcc (GCC) 12.1.0
>> reproduce:
>> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>> chmod +x ~/bin/make.cross
>> # apt-get install sparse
>> # sparse version: v0.6.4-39-gce1a6720-dirty
>> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a050910972bb25152b42ad2e544652117c5ad915
>> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>> git fetch --no-tags linus master
>> git checkout a050910972bb25152b42ad2e544652117c5ad915
>> # save the config file
>> mkdir build_dir && cp config build_dir/.config
>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash drivers/firmware/efi/libstub/ lib/xz/
>>
>> If you fix the issue, kindly add following tag where applicable
>> | Reported-by: kernel test robot <[email protected]>
>>
>> sparse warnings: (new ones prefixed by >>)
>> WARNING: invalid argument to '-march': '_zihintpause'
>> drivers/firmware/efi/libstub/zboot.c: note: in included file (through drivers/firmware/efi/libstub/../../../../lib/decompress_unxz.c):
>>>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:393:28: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:393:28: sparse: expected restricted __le32 const [usertype] *p
>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:393:28: sparse: got unsigned int const [usertype] *
>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:427:48: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:427:48: sparse: expected restricted __le32 const [usertype] *p
>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:427:48: sparse: got unsigned int const [usertype] *
>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:435:37: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:435:37: sparse: expected restricted __le32 const [usertype] *p
>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:435:37: sparse: got unsigned int const [usertype] *
>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:459:28: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:459:28: sparse: expected restricted __le32 const [usertype] *p
>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:459:28: sparse: got unsigned int const [usertype] *
>>>> drivers/firmware/efi/libstub/zboot.c:163:1: sparse: sparse: symbol 'efi_zboot_entry' was not declared. Should it be static?
>>
>> vim +/efi_zboot_entry +163 drivers/firmware/efi/libstub/zboot.c
>>
>> 161
>> 162 asmlinkage efi_status_t __efiapi
>> > 163 efi_zboot_entry(efi_handle_t handle, efi_system_table_t *systab)
>>
>> --
>> 0-DAY CI Kernel Test Service
>> https://01.org/lkp
> _______________________________________________
> kbuild-all mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
>

2022-10-19 11:10:37

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [kbuild-all] Re: drivers/firmware/efi/libstub/zboot.c:163:1: sparse: sparse: symbol 'efi_zboot_entry' was not declared. Should it be static?

On Wed, 19 Oct 2022 at 11:10, Chen, Rong A <[email protected]> wrote:
>
>
>
> On 10/19/2022 3:50 AM, Ard Biesheuvel wrote:
> > This is another spurious report of an asmlinkage symbol.
>
> Hi Ard,
>
> Thanks for your reply, we'll add this warning to the ignore list.
>

Thank you Rong.

Wouldn't it be easier to detect the asmlinkage and never warn on it?
Maybe this should be sparse's job instead ...


>
> >
> > On Tue, 18 Oct 2022 at 21:49, kernel test robot <[email protected]> wrote:
> >>
> >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> >> head: bb1a1146467ad812bb65440696df0782e2bc63c8
> >> commit: a050910972bb25152b42ad2e544652117c5ad915 efi/libstub: implement generic EFI zboot
> >> date: 4 weeks ago
> >> config: riscv-randconfig-s043-20221018
> >> compiler: riscv64-linux-gcc (GCC) 12.1.0
> >> reproduce:
> >> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >> chmod +x ~/bin/make.cross
> >> # apt-get install sparse
> >> # sparse version: v0.6.4-39-gce1a6720-dirty
> >> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a050910972bb25152b42ad2e544652117c5ad915
> >> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> >> git fetch --no-tags linus master
> >> git checkout a050910972bb25152b42ad2e544652117c5ad915
> >> # save the config file
> >> mkdir build_dir && cp config build_dir/.config
> >> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash drivers/firmware/efi/libstub/ lib/xz/
> >>
> >> If you fix the issue, kindly add following tag where applicable
> >> | Reported-by: kernel test robot <[email protected]>
> >>
> >> sparse warnings: (new ones prefixed by >>)
> >> WARNING: invalid argument to '-march': '_zihintpause'
> >> drivers/firmware/efi/libstub/zboot.c: note: in included file (through drivers/firmware/efi/libstub/../../../../lib/decompress_unxz.c):
> >>>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:393:28: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
> >> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:393:28: sparse: expected restricted __le32 const [usertype] *p
> >> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:393:28: sparse: got unsigned int const [usertype] *
> >> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:427:48: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
> >> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:427:48: sparse: expected restricted __le32 const [usertype] *p
> >> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:427:48: sparse: got unsigned int const [usertype] *
> >> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:435:37: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
> >> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:435:37: sparse: expected restricted __le32 const [usertype] *p
> >> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:435:37: sparse: got unsigned int const [usertype] *
> >> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:459:28: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
> >> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:459:28: sparse: expected restricted __le32 const [usertype] *p
> >> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:459:28: sparse: got unsigned int const [usertype] *
> >>>> drivers/firmware/efi/libstub/zboot.c:163:1: sparse: sparse: symbol 'efi_zboot_entry' was not declared. Should it be static?
> >>
> >> vim +/efi_zboot_entry +163 drivers/firmware/efi/libstub/zboot.c
> >>
> >> 161
> >> 162 asmlinkage efi_status_t __efiapi
> >> > 163 efi_zboot_entry(efi_handle_t handle, efi_system_table_t *systab)
> >>
> >> --
> >> 0-DAY CI Kernel Test Service
> >> https://01.org/lkp
> > _______________________________________________
> > kbuild-all mailing list -- [email protected]
> > To unsubscribe send an email to [email protected]
> >

2022-10-20 01:01:24

by Chen, Rong A

[permalink] [raw]
Subject: Re: [kbuild-all] Re: drivers/firmware/efi/libstub/zboot.c:163:1: sparse: sparse: symbol 'efi_zboot_entry' was not declared. Should it be static?



On 10/19/2022 5:11 PM, Ard Biesheuvel wrote:
> On Wed, 19 Oct 2022 at 11:10, Chen, Rong A <[email protected]> wrote:
>>
>>
>>
>> On 10/19/2022 3:50 AM, Ard Biesheuvel wrote:
>>> This is another spurious report of an asmlinkage symbol.
>>
>> Hi Ard,
>>
>> Thanks for your reply, we'll add this warning to the ignore list.
>>
>
> Thank you Rong.
>
> Wouldn't it be easier to detect the asmlinkage and never warn on it?

Hi Ard,

We'll try to search asmlinkage from code if the sparse warning occurred.

Best Regards,
Rong Chen

> Maybe this should be sparse's job instead ...
>
>
>>
>>>
>>> On Tue, 18 Oct 2022 at 21:49, kernel test robot <[email protected]> wrote:
>>>>
>>>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>>>> head: bb1a1146467ad812bb65440696df0782e2bc63c8
>>>> commit: a050910972bb25152b42ad2e544652117c5ad915 efi/libstub: implement generic EFI zboot
>>>> date: 4 weeks ago
>>>> config: riscv-randconfig-s043-20221018
>>>> compiler: riscv64-linux-gcc (GCC) 12.1.0
>>>> reproduce:
>>>> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>>> chmod +x ~/bin/make.cross
>>>> # apt-get install sparse
>>>> # sparse version: v0.6.4-39-gce1a6720-dirty
>>>> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a050910972bb25152b42ad2e544652117c5ad915
>>>> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>>>> git fetch --no-tags linus master
>>>> git checkout a050910972bb25152b42ad2e544652117c5ad915
>>>> # save the config file
>>>> mkdir build_dir && cp config build_dir/.config
>>>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash drivers/firmware/efi/libstub/ lib/xz/
>>>>
>>>> If you fix the issue, kindly add following tag where applicable
>>>> | Reported-by: kernel test robot <[email protected]>
>>>>
>>>> sparse warnings: (new ones prefixed by >>)
>>>> WARNING: invalid argument to '-march': '_zihintpause'
>>>> drivers/firmware/efi/libstub/zboot.c: note: in included file (through drivers/firmware/efi/libstub/../../../../lib/decompress_unxz.c):
>>>>>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:393:28: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
>>>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:393:28: sparse: expected restricted __le32 const [usertype] *p
>>>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:393:28: sparse: got unsigned int const [usertype] *
>>>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:427:48: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
>>>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:427:48: sparse: expected restricted __le32 const [usertype] *p
>>>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:427:48: sparse: got unsigned int const [usertype] *
>>>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:435:37: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
>>>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:435:37: sparse: expected restricted __le32 const [usertype] *p
>>>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:435:37: sparse: got unsigned int const [usertype] *
>>>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:459:28: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 const [usertype] *p @@ got unsigned int const [usertype] * @@
>>>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:459:28: sparse: expected restricted __le32 const [usertype] *p
>>>> drivers/firmware/efi/libstub/../../../../lib/xz/xz_dec_stream.c:459:28: sparse: got unsigned int const [usertype] *
>>>>>> drivers/firmware/efi/libstub/zboot.c:163:1: sparse: sparse: symbol 'efi_zboot_entry' was not declared. Should it be static?
>>>>
>>>> vim +/efi_zboot_entry +163 drivers/firmware/efi/libstub/zboot.c
>>>>
>>>> 161
>>>> 162 asmlinkage efi_status_t __efiapi
>>>> > 163 efi_zboot_entry(efi_handle_t handle, efi_system_table_t *systab)
>>>>
>>>> --
>>>> 0-DAY CI Kernel Test Service
>>>> https://01.org/lkp
>>> _______________________________________________
>>> kbuild-all mailing list -- [email protected]
>>> To unsubscribe send an email to [email protected]
>>>
> _______________________________________________
> kbuild-all mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
>