tree:
https://git.kernel.org/pub/scm/linux/kernel/git/joro/linux.git
sev-es-client-v5.8-rc4
head: 7ee5e0ddab7fa6efbf0937f175a5688a375d55b8
commit: ba5a7a670ef6e070d2db31d286e1073e609311e1 [47/75] x86/entry/64: Add entry code for
#VC handler
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (
https://github.com/llvm/llvm-project
02946de3802d3bc65bc9f2eb9b8d4969b5a7add8)
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
git checkout ba5a7a670ef6e070d2db31d286e1073e609311e1
# 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(a)intel.com>
All warnings (new ones prefixed by >>):
> arch/x86/kernel/traps.c:681:46: warning: no previous prototype
for function 'vc_switch_off_ist' [-Wmissing-prototypes]
asmlinkage
__visible noinstr struct pt_regs *vc_switch_off_ist(struct pt_regs *eregs)
^
arch/x86/kernel/traps.c:681:30: note: declare 'static' if the function is not
intended to be used outside of this translation unit
asmlinkage __visible noinstr struct pt_regs *vc_switch_off_ist(struct pt_regs *eregs)
^
static
1 warning generated.
vim +/vc_switch_off_ist +681 arch/x86/kernel/traps.c
679
680 #ifdef CONFIG_AMD_MEM_ENCRYPT
681 asmlinkage __visible noinstr struct pt_regs
*vc_switch_off_ist(struct pt_regs *eregs)
682 {
683 unsigned long sp, *stack;
684 struct stack_info info;
685 struct pt_regs *regs;
686
687 /*
688 * In the SYSCALL entry path the RSP value comes from user-space - don't
689 * trust it and switch to the current kernel stack
690 */
691 if (eregs->ip >= (unsigned long)entry_SYSCALL_64 &&
692 eregs->ip < (unsigned long)entry_SYSCALL_64_safe_stack) {
693 sp = this_cpu_read(cpu_current_top_of_stack);
694 goto sync;
695 }
696
697 /*
698 * From here on the the RSP value is trusted - more RSP sanity checks
699 * need to happen above.
700 *
701 * Check whether entry happened from a safe stack.
702 */
703 sp = eregs->sp;
704 stack = (unsigned long *)sp;
705 get_stack_info_noinstr(stack, current, &info);
706
707 /*
708 * Don't sync to entry stack or other unknown stacks - use the fall-back
709 * stack instead.
710 */
711 if (info.type == STACK_TYPE_UNKNOWN || info.type == STACK_TYPE_ENTRY ||
712 info.type >= STACK_TYPE_EXCEPTION_LAST)
713 sp = __this_cpu_ist_top_va(VC2);
714
715 sync:
716 /*
717 * Found a safe stack - switch to it as if the entry didn't happen via
718 * IST stack. The code below only copies pt_regs, the real switch happens
719 * in assembly code.
720 */
721 sp = ALIGN_DOWN(sp, 8) - sizeof(*regs);
722
723 regs = (struct pt_regs *)sp;
724 *regs = *eregs;
725
726 return regs;
727 }
728 #endif
729
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org