* [sashal-linux-stable:queue-5.11 26/181] arch/x86/boot/compressed/head_64.S:827: Error: can't resolve `sev_status' {*UND* section} - `startup_32' {.head.text section}
@ 2021-05-07 21:22 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-05-07 21:22 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 7206 bytes --]
Hi Nathan,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-5.11
head: d7b2033a36371babdec3a95b8e81f0f951622c16
commit: dd9ef8b0199cfa44a14e285de8d9ba0b36514028 [26/181] x86/boot: Add $(CLANG_FLAGS) to compressed KBUILD_CFLAGS
config: x86_64-randconfig-r011-20210507 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a3a8a1a15b524d91b5308db68e9d293b34cd88dd)
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/sashal/linux-stable.git/commit/?id=dd9ef8b0199cfa44a14e285de8d9ba0b36514028
git remote add sashal-linux-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable queue-5.11
git checkout dd9ef8b0199cfa44a14e285de8d9ba0b36514028
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
arch/x86/boot/compressed/head_64.S: Assembler messages:
>> arch/x86/boot/compressed/head_64.S:827: Error: can't resolve `sev_status' {*UND* section} - `startup_32' {.head.text section}
>> arch/x86/boot/compressed/head_64.S:842: Error: can't resolve `sev_check_data' {*UND* section} - `startup_32' {.head.text section}
arch/x86/boot/compressed/head_64.S:843: Error: can't resolve `sev_check_data' {*UND* section} - `startup_32' {.head.text section}
arch/x86/boot/compressed/head_64.S:850: Error: can't resolve `sev_check_data' {*UND* section} - `startup_32' {.head.text section}
arch/x86/boot/compressed/head_64.S:852: Error: can't resolve `sev_check_data' {*UND* section} - `startup_32' {.head.text section}
clang-13: error: assembler command failed with exit code 1 (use -v to see invocation)
vim +827 arch/x86/boot/compressed/head_64.S
b8ff87a6158886 Matt Fleming 2014-01-10 801
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 802 /*
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 803 * Check for the correct C-bit position when the startup_32 boot-path is used.
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 804 *
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 805 * The check makes use of the fact that all memory is encrypted when paging is
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 806 * disabled. The function creates 64 bits of random data using the RDRAND
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 807 * instruction. RDRAND is mandatory for SEV guests, so always available. If the
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 808 * hypervisor violates that the kernel will crash right here.
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 809 *
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 810 * The 64 bits of random data are stored to a memory location and at the same
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 811 * time kept in the %eax and %ebx registers. Since encryption is always active
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 812 * when paging is off the random data will be stored encrypted in main memory.
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 813 *
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 814 * Then paging is enabled. When the C-bit position is correct all memory is
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 815 * still mapped encrypted and comparing the register values with memory will
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 816 * succeed. An incorrect C-bit position will map all memory unencrypted, so that
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 817 * the compare will use the encrypted random data and fail.
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 818 */
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 819 SYM_FUNC_START(startup32_check_sev_cbit)
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 820 #ifdef CONFIG_AMD_MEM_ENCRYPT
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 821 pushl %eax
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 822 pushl %ebx
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 823 pushl %ecx
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 824 pushl %edx
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 825
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 826 /* Check for non-zero sev_status */
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 @827 movl rva(sev_status)(%ebp), %eax
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 828 testl %eax, %eax
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 829 jz 4f
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 830
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 831 /*
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 832 * Get two 32-bit random values - Don't bail out if RDRAND fails
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 833 * because it is better to prevent forward progress if no random value
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 834 * can be gathered.
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 835 */
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 836 1: rdrand %eax
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 837 jnc 1b
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 838 2: rdrand %ebx
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 839 jnc 2b
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 840
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 841 /* Store to memory and keep it in the registers */
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 @842 movl %eax, rva(sev_check_data)(%ebp)
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 843 movl %ebx, rva(sev_check_data+4)(%ebp)
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 844
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 845 /* Enable paging to see if encryption is active */
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 846 movl %cr0, %edx /* Backup %cr0 in %edx */
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 847 movl $(X86_CR0_PG | X86_CR0_PE), %ecx /* Enable Paging and Protected mode */
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 848 movl %ecx, %cr0
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 849
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 850 cmpl %eax, rva(sev_check_data)(%ebp)
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 851 jne 3f
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 852 cmpl %ebx, rva(sev_check_data+4)(%ebp)
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 853 jne 3f
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 854
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 855 movl %edx, %cr0 /* Restore previous %cr0 */
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 856
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 857 jmp 4f
9bcb9b5cdb1165 Joerg Roedel 2021-03-12 858
:::::: The code at line 827 was first introduced by commit
:::::: 9bcb9b5cdb1165b6dc9a2fc754ee3fc7fc8def76 x86/boot/compressed/64: Check SEV encryption in the 32-bit boot-path
:::::: TO: Joerg Roedel <jroedel@suse.de>
:::::: CC: Sasha Levin <sashal@kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36002 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-07 21:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07 21:22 [sashal-linux-stable:queue-5.11 26/181] arch/x86/boot/compressed/head_64.S:827: Error: can't resolve `sev_status' {*UND* section} - `startup_32' {.head.text section} kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.