tree: git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git efi-zboot-direct head: c4954c4853a50dbfefd1beb56d466ab612164ae2 commit: cd9825c4a9e2e33b66b67cc39afff5a79411b71e [21/35] efi: libstub: Deduplicate ftrace command line argument filtering config: x86_64-allyesconfig compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 reproduce (this is a W=1 build): # https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/commit/?id=cd9825c4a9e2e33b66b67cc39afff5a79411b71e git remote add ardb git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git git fetch --no-tags ardb efi-zboot-direct git checkout cd9825c4a9e2e33b66b67cc39afff5a79411b71e # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/firmware/efi/libstub/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot Note: functions only called from assembly code should be annotated with the asmlinkage attribute All warnings (new ones prefixed by >>): >> drivers/firmware/efi/libstub/x86-stub.c:768:15: warning: no previous prototype for 'efi_main' [-Wmissing-prototypes] 768 | unsigned long efi_main(efi_handle_t handle, | ^~~~~~~~ vim +/efi_main +768 drivers/firmware/efi/libstub/x86-stub.c 291f36325f9f25 arch/x86/boot/compressed/eboot.c Matt Fleming 2011-12-12 762 9ca8f72a9297f2 arch/x86/boot/compressed/eboot.c Matt Fleming 2012-07-19 763 /* 8acf63efa1712f drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 764 * On success, we return the address of startup_32, which has potentially been 8acf63efa1712f drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 765 * relocated by efi_relocate_kernel. 8acf63efa1712f drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 766 * On failure, we exit to the firmware via efi_exit instead of returning. 9ca8f72a9297f2 arch/x86/boot/compressed/eboot.c Matt Fleming 2012-07-19 767 */ 8acf63efa1712f drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 @768 unsigned long efi_main(efi_handle_t handle, c3710de5065d63 arch/x86/boot/compressed/eboot.c Ard Biesheuvel 2019-12-24 769 efi_system_table_t *sys_table_arg, 796eb8d26a57f9 arch/x86/boot/compressed/eboot.c Ard Biesheuvel 2020-01-13 770 struct boot_params *boot_params) 9ca8f72a9297f2 arch/x86/boot/compressed/eboot.c Matt Fleming 2012-07-19 771 { 04a7d0e1560676 arch/x86/boot/compressed/eboot.c Ard Biesheuvel 2020-02-10 772 unsigned long bzimage_addr = (unsigned long)startup_32; d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 773 unsigned long buffer_start, buffer_end; 9ca8f72a9297f2 arch/x86/boot/compressed/eboot.c Matt Fleming 2012-07-19 774 struct setup_header *hdr = &boot_params->hdr; f4dc7fffa9873d drivers/firmware/efi/libstub/x86-stub.c Ard Biesheuvel 2022-09-16 775 const struct linux_efi_initrd *initrd = NULL; 9ca8f72a9297f2 arch/x86/boot/compressed/eboot.c Matt Fleming 2012-07-19 776 efi_status_t status; 54b52d87268034 arch/x86/boot/compressed/eboot.c Matt Fleming 2014-01-10 777 ccc27ae7749425 drivers/firmware/efi/libstub/x86-stub.c Ard Biesheuvel 2020-04-16 778 efi_system_table = sys_table_arg; 9ca8f72a9297f2 arch/x86/boot/compressed/eboot.c Matt Fleming 2012-07-19 779 /* Check if we were booted by the EFI firmware */ ccc27ae7749425 drivers/firmware/efi/libstub/x86-stub.c Ard Biesheuvel 2020-04-16 780 if (efi_system_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) 3b8f44fc0810d5 drivers/firmware/efi/libstub/x86-stub.c Ard Biesheuvel 2020-02-16 781 efi_exit(handle, EFI_INVALID_PARAMETER); 9ca8f72a9297f2 arch/x86/boot/compressed/eboot.c Matt Fleming 2012-07-19 782 3ba75c1316390b drivers/firmware/efi/libstub/x86-stub.c Baskov Evgeniy 2022-03-03 783 efi_dxe_table = get_efi_config_table(EFI_DXE_SERVICES_TABLE_GUID); 3ba75c1316390b drivers/firmware/efi/libstub/x86-stub.c Baskov Evgeniy 2022-03-03 784 if (efi_dxe_table && 3ba75c1316390b drivers/firmware/efi/libstub/x86-stub.c Baskov Evgeniy 2022-03-03 785 efi_dxe_table->hdr.signature != EFI_DXE_SERVICES_TABLE_SIGNATURE) { 3ba75c1316390b drivers/firmware/efi/libstub/x86-stub.c Baskov Evgeniy 2022-03-03 786 efi_warn("Ignoring DXE services table: invalid signature\n"); 3ba75c1316390b drivers/firmware/efi/libstub/x86-stub.c Baskov Evgeniy 2022-03-03 787 efi_dxe_table = NULL; 3ba75c1316390b drivers/firmware/efi/libstub/x86-stub.c Baskov Evgeniy 2022-03-03 788 } 3ba75c1316390b drivers/firmware/efi/libstub/x86-stub.c Baskov Evgeniy 2022-03-03 789 04a7d0e1560676 arch/x86/boot/compressed/eboot.c Ard Biesheuvel 2020-02-10 790 /* d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 791 * If the kernel isn't already loaded at a suitable address, d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 792 * relocate it. d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 793 * d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 794 * It must be loaded above LOAD_PHYSICAL_ADDR. d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 795 * d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 796 * The maximum address for 64-bit is 1 << 46 for 4-level paging. This d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 797 * is defined as the macro MAXMEM, but unfortunately that is not a d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 798 * compile-time constant if 5-level paging is configured, so we instead d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 799 * define our own macro for use here. d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 800 * d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 801 * For 32-bit, the maximum address is complicated to figure out, for d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 802 * now use KERNEL_IMAGE_SIZE, which will be 512MiB, the same as what d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 803 * KASLR uses. d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 804 * 21cb9b414301c7 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-04-09 805 * Also relocate it if image_offset is zero, i.e. the kernel wasn't 21cb9b414301c7 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-04-09 806 * loaded by LoadImage, but rather by a bootloader that called the 21cb9b414301c7 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-04-09 807 * handover entry. The reason we must always relocate in this case is 21cb9b414301c7 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-04-09 808 * to handle the case of systemd-boot booting a unified kernel image, 21cb9b414301c7 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-04-09 809 * which is a PE executable that contains the bzImage and an initrd as 21cb9b414301c7 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-04-09 810 * COFF sections. The initrd section is placed after the bzImage 21cb9b414301c7 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-04-09 811 * without ensuring that there are at least init_size bytes available 21cb9b414301c7 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-04-09 812 * for the bzImage, and thus the compressed kernel's startup code may 21cb9b414301c7 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-04-09 813 * overwrite the initrd unless it is moved out of the way. 04a7d0e1560676 arch/x86/boot/compressed/eboot.c Ard Biesheuvel 2020-02-10 814 */ d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 815 d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 816 buffer_start = ALIGN(bzimage_addr - image_offset, d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 817 hdr->kernel_alignment); d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 818 buffer_end = buffer_start + hdr->init_size; d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 819 d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 820 if ((buffer_start < LOAD_PHYSICAL_ADDR) || d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 821 (IS_ENABLED(CONFIG_X86_32) && buffer_end > KERNEL_IMAGE_SIZE) || d5cdf4cfeac914 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 822 (IS_ENABLED(CONFIG_X86_64) && buffer_end > MAXMEM_X86_64_4LEVEL) || 21cb9b414301c7 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-04-09 823 (image_offset == 0)) { 688eb28211abdf drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-10-11 824 extern char _bss[]; 688eb28211abdf drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-10-11 825 04a7d0e1560676 arch/x86/boot/compressed/eboot.c Ard Biesheuvel 2020-02-10 826 status = efi_relocate_kernel(&bzimage_addr, 688eb28211abdf drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-10-11 827 (unsigned long)_bss - bzimage_addr, 688eb28211abdf drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-10-11 828 hdr->init_size, 04a7d0e1560676 arch/x86/boot/compressed/eboot.c Ard Biesheuvel 2020-02-10 829 hdr->pref_address, 04a7d0e1560676 arch/x86/boot/compressed/eboot.c Ard Biesheuvel 2020-02-10 830 hdr->kernel_alignment, 04a7d0e1560676 arch/x86/boot/compressed/eboot.c Ard Biesheuvel 2020-02-10 831 LOAD_PHYSICAL_ADDR); 04a7d0e1560676 arch/x86/boot/compressed/eboot.c Ard Biesheuvel 2020-02-10 832 if (status != EFI_SUCCESS) { 36bdd0a78d5683 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-04-30 833 efi_err("efi_relocate_kernel() failed!\n"); 04a7d0e1560676 arch/x86/boot/compressed/eboot.c Ard Biesheuvel 2020-02-10 834 goto fail; 04a7d0e1560676 arch/x86/boot/compressed/eboot.c Ard Biesheuvel 2020-02-10 835 } 1887c9b653f995 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 836 /* 1887c9b653f995 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 837 * Now that we've copied the kernel elsewhere, we no longer 1887c9b653f995 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 838 * have a set up block before startup_32(), so reset image_offset 1887c9b653f995 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 839 * to zero in case it was set earlier. 1887c9b653f995 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 840 */ 1887c9b653f995 drivers/firmware/efi/libstub/x86-stub.c Arvind Sankar 2020-03-08 841 image_offset = 0; 04a7d0e1560676 arch/x86/boot/compressed/eboot.c Ard Biesheuvel 2020-02-10 842 } 04a7d0e1560676 arch/x86/boot/compressed/eboot.c Ard Biesheuvel 2020-02-10 843 :::::: The code at line 768 was first introduced by commit :::::: 8acf63efa1712fa5495425a4224378bb3e1231e0 efi/x86: Avoid using code32_start :::::: TO: Arvind Sankar :::::: CC: Ingo Molnar -- 0-DAY CI Kernel Test Service https://01.org/lkp