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?

From: Ard Biesheuvel
Date: Wed Oct 19 2022 - 06:51:25 EST


On Wed, 19 Oct 2022 at 11:10, Chen, Rong A <rong.a.chen@xxxxxxxxx> 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 <lkp@xxxxxxxxx> 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 <lkp@xxxxxxxxx>
> >>
> >> 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 -- kbuild-all@xxxxxxxxxxxx
> > To unsubscribe send an email to kbuild-all-leave@xxxxxxxxxxxx
> >