[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202103101334.y2cQeyjh-lkp@intel.com>
Date: Wed, 10 Mar 2021 13:41:41 +0800
From: kernel test robot <lkp@...el.com>
To: Chester Lin <clin@...e.com>
Cc: kbuild-all@...ts.01.org, clang-built-linux@...glegroups.com,
linux-kernel@...r.kernel.org, Ard Biesheuvel <ardb@...nel.org>
Subject: include/linux/efi.h:1101:34: warning: passing 1-byte aligned
argument to 4-byte aligned parameter 2 of 'get_var' may result in an
unaligned pointer access
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 05a59d79793d482f628a31753c671f2e92178a21
commit: e1ac4b2406d94eddce8ac2c5ab4235f6075a9602 efi: generalize efi_get_secureboot
date: 4 months ago
config: x86_64-randconfig-a016-20210308 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project cd9a69289c7825d54450cb6829fef2c8e0f1963a)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e1ac4b2406d94eddce8ac2c5ab4235f6075a9602
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout e1ac4b2406d94eddce8ac2c5ab4235f6075a9602
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
In file included from drivers/firmware/dmi_scan.c:8:
>> include/linux/efi.h:1101:34: warning: passing 1-byte aligned argument to 4-byte aligned parameter 2 of 'get_var' may result in an unaligned pointer access [-Walign-mismatch]
status = get_var(L"SecureBoot", &EFI_GLOBAL_VARIABLE_GUID, NULL, &size,
^
include/linux/efi.h:1109:24: warning: passing 1-byte aligned argument to 4-byte aligned parameter 2 of 'get_var' may result in an unaligned pointer access [-Walign-mismatch]
get_var(L"SetupMode", &EFI_GLOBAL_VARIABLE_GUID, NULL, &size, &setupmode);
^
2 warnings generated.
--
In file included from init/main.c:50:
>> include/linux/efi.h:1101:34: warning: passing 1-byte aligned argument to 4-byte aligned parameter 2 of 'get_var' may result in an unaligned pointer access [-Walign-mismatch]
status = get_var(L"SecureBoot", &EFI_GLOBAL_VARIABLE_GUID, NULL, &size,
^
include/linux/efi.h:1109:24: warning: passing 1-byte aligned argument to 4-byte aligned parameter 2 of 'get_var' may result in an unaligned pointer access [-Walign-mismatch]
get_var(L"SetupMode", &EFI_GLOBAL_VARIABLE_GUID, NULL, &size, &setupmode);
^
init/main.c:766:20: warning: no previous prototype for function 'mem_encrypt_init' [-Wmissing-prototypes]
void __init __weak mem_encrypt_init(void) { }
^
init/main.c:766:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __init __weak mem_encrypt_init(void) { }
^
static
3 warnings generated.
--
In file included from arch/x86/mm/ioremap.c:18:
>> include/linux/efi.h:1101:34: warning: passing 1-byte aligned argument to 4-byte aligned parameter 2 of 'get_var' may result in an unaligned pointer access [-Walign-mismatch]
status = get_var(L"SecureBoot", &EFI_GLOBAL_VARIABLE_GUID, NULL, &size,
^
include/linux/efi.h:1109:24: warning: passing 1-byte aligned argument to 4-byte aligned parameter 2 of 'get_var' may result in an unaligned pointer access [-Walign-mismatch]
get_var(L"SetupMode", &EFI_GLOBAL_VARIABLE_GUID, NULL, &size, &setupmode);
^
arch/x86/mm/ioremap.c:737:17: warning: no previous prototype for function 'early_memremap_pgprot_adjust' [-Wmissing-prototypes]
pgprot_t __init early_memremap_pgprot_adjust(resource_size_t phys_addr,
^
arch/x86/mm/ioremap.c:737:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
pgprot_t __init early_memremap_pgprot_adjust(resource_size_t phys_addr,
^
static
3 warnings generated.
vim +/get_var +1101 include/linux/efi.h
1092
1093 static inline
1094 enum efi_secureboot_mode efi_get_secureboot_mode(efi_get_variable_t *get_var)
1095 {
1096 u8 secboot, setupmode = 0;
1097 efi_status_t status;
1098 unsigned long size;
1099
1100 size = sizeof(secboot);
> 1101 status = get_var(L"SecureBoot", &EFI_GLOBAL_VARIABLE_GUID, NULL, &size,
1102 &secboot);
1103 if (status == EFI_NOT_FOUND)
1104 return efi_secureboot_mode_disabled;
1105 if (status != EFI_SUCCESS)
1106 return efi_secureboot_mode_unknown;
1107
1108 size = sizeof(setupmode);
1109 get_var(L"SetupMode", &EFI_GLOBAL_VARIABLE_GUID, NULL, &size, &setupmode);
1110 if (secboot == 0 || setupmode == 1)
1111 return efi_secureboot_mode_disabled;
1112 return efi_secureboot_mode_enabled;
1113 }
1114
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (36096 bytes)
Powered by blists - more mailing lists