tree: https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git lam head: ca9762d59aa41bc0a580c2f7668038d31c991f59 commit: ce8762cf0c572b53a82a08a369376c28cfb6fda4 [4/13] x86/mm: Handle LAM on context switch config: x86_64-randconfig-a002 compiler: gcc-11 (Debian 11.3.0-3) 11.3.0 reproduce (this is a W=1 build): # https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git/commit/?id=ce8762cf0c572b53a82a08a369376c28cfb6fda4 git remote add kas https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git git fetch --no-tags kas lam git checkout ce8762cf0c572b53a82a08a369376c28cfb6fda4 # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash mm/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot All errors (new ones prefixed by >>): In file included from include/asm-generic/percpu.h:7, from arch/x86/include/asm/percpu.h:390, from arch/x86/include/asm/current.h:6, from arch/x86/include/asm/processor.h:17, from arch/x86/include/asm/timex.h:5, from include/linux/timex.h:67, from include/linux/time32.h:13, from include/linux/time.h:60, from include/linux/stat.h:19, from include/linux/module.h:13, from mm/zsmalloc.c:41: arch/x86/include/asm/tlbflush.h: In function 'tlbstate_lam_cr3_mask': >> arch/x86/include/asm/tlbflush.h:380:43: error: 'cpu_tlbstate' undeclared (first use in this function) 380 | unsigned long lam = this_cpu_read(cpu_tlbstate.lam); | ^~~~~~~~~~~~ include/linux/percpu-defs.h:318:16: note: in definition of macro '__pcpu_size_call_return' 318 | typeof(variable) pscr_ret__; \ | ^~~~~~~~ arch/x86/include/asm/tlbflush.h:380:29: note: in expansion of macro 'this_cpu_read' 380 | unsigned long lam = this_cpu_read(cpu_tlbstate.lam); | ^~~~~~~~~~~~~ arch/x86/include/asm/tlbflush.h:380:43: note: each undeclared identifier is reported only once for each function it appears in 380 | unsigned long lam = this_cpu_read(cpu_tlbstate.lam); | ^~~~~~~~~~~~ include/linux/percpu-defs.h:318:16: note: in definition of macro '__pcpu_size_call_return' 318 | typeof(variable) pscr_ret__; \ | ^~~~~~~~ arch/x86/include/asm/tlbflush.h:380:29: note: in expansion of macro 'this_cpu_read' 380 | unsigned long lam = this_cpu_read(cpu_tlbstate.lam); | ^~~~~~~~~~~~~ arch/x86/include/asm/tlbflush.h: In function 'set_tlbstate_cr3_lam_mask': arch/x86/include/asm/tlbflush.h:387:24: error: 'cpu_tlbstate' undeclared (first use in this function) 387 | this_cpu_write(cpu_tlbstate.lam, mask >> X86_CR3_LAM_U57_BIT); | ^~~~~~~~~~~~ include/linux/percpu-defs.h:219:54: note: in definition of macro '__verify_pcpu_ptr' 219 | const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \ | ^~~ include/linux/percpu-defs.h:508:41: note: in expansion of macro '__pcpu_size_call' 508 | #define this_cpu_write(pcp, val) __pcpu_size_call(this_cpu_write_, pcp, val) | ^~~~~~~~~~~~~~~~ arch/x86/include/asm/tlbflush.h:387:9: note: in expansion of macro 'this_cpu_write' 387 | this_cpu_write(cpu_tlbstate.lam, mask >> X86_CR3_LAM_U57_BIT); | ^~~~~~~~~~~~~~ vim +/cpu_tlbstate +380 arch/x86/include/asm/tlbflush.h 376 377 #ifdef CONFIG_X86_64 378 static inline unsigned long tlbstate_lam_cr3_mask(void) 379 { > 380 unsigned long lam = this_cpu_read(cpu_tlbstate.lam); 381 382 return lam << X86_CR3_LAM_U57_BIT; 383 } 384 -- 0-DAY CI Kernel Test Service https://01.org/lkp