[tip:x86/boot 9/9] arch/x86/include/asm/desc.h:60:16: sparse: sparse: incorrect type in initializer (different address spaces)

From: kernel test robot
Date: Thu Feb 29 2024 - 19:04:32 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/boot
head: 891f8890a4a3663da7056542757022870b499bc1
commit: 11e36b0f7c2150a6453872b79555767b43c846d0 [9/9] x86/boot/64: Load the final kernel GDT during early boot directly, remove startup_gdt[]
config: i386-randconfig-061-20240229 (https://download.01.org/0day-ci/archive/20240301/202403010704.oGQZPu0P-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240301/202403010704.oGQZPu0P-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403010704.oGQZPu0P-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> arch/x86/events/core.c:2809:24: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct desc_struct * @@
arch/x86/events/core.c:2809:24: sparse: expected void const [noderef] __percpu *__vpp_verify
arch/x86/events/core.c:2809:24: sparse: got struct desc_struct *
arch/x86/events/core.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/mm.h, ...):
include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false
--
arch/x86/kernel/doublefault_32.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/mm.h):
include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false
arch/x86/kernel/doublefault_32.c: note: in included file (through arch/x86/include/asm/elf.h, include/linux/elf.h, include/linux/module.h, ...):
>> arch/x86/include/asm/desc.h:60:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct gdt_page * @@
arch/x86/include/asm/desc.h:60:16: sparse: expected void const [noderef] __percpu *__vpp_verify
arch/x86/include/asm/desc.h:60:16: sparse: got struct gdt_page *
arch/x86/include/asm/desc.h:54:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct gdt_page * @@
arch/x86/include/asm/desc.h:54:16: sparse: expected void const [noderef] __percpu *__vpp_verify
arch/x86/include/asm/desc.h:54:16: sparse: got struct gdt_page *
--
arch/x86/kernel/process.c:798:33: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct cpuinfo_x86 * @@
arch/x86/kernel/process.c:798:33: sparse: expected void const [noderef] __percpu *__vpp_verify
arch/x86/kernel/process.c:798:33: sparse: got struct cpuinfo_x86 *
arch/x86/kernel/process.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/mm.h):
include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false
arch/x86/kernel/process.c: note: in included file (through arch/x86/include/asm/elf.h, include/linux/elf.h, include/linux/module.h, ...):
>> arch/x86/include/asm/desc.h:60:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct gdt_page * @@
arch/x86/include/asm/desc.h:60:16: sparse: expected void const [noderef] __percpu *__vpp_verify
arch/x86/include/asm/desc.h:60:16: sparse: got struct gdt_page *

vim +60 arch/x86/include/asm/desc.h

a939098afcfa5f include/asm-x86/desc.h Glauber Costa 2008-05-28 56
69218e47994da6 arch/x86/include/asm/desc.h Thomas Garnier 2017-03-14 57 /* Provide the current original GDT */
69218e47994da6 arch/x86/include/asm/desc.h Thomas Garnier 2017-03-14 58 static inline struct desc_struct *get_current_gdt_rw(void)
69218e47994da6 arch/x86/include/asm/desc.h Thomas Garnier 2017-03-14 59 {
69218e47994da6 arch/x86/include/asm/desc.h Thomas Garnier 2017-03-14 @60 return this_cpu_ptr(&gdt_page)->gdt;
69218e47994da6 arch/x86/include/asm/desc.h Thomas Garnier 2017-03-14 61 }
69218e47994da6 arch/x86/include/asm/desc.h Thomas Garnier 2017-03-14 62

:::::: The code at line 60 was first introduced by commit
:::::: 69218e47994da614e7af600bf06887750ab6657a x86: Remap GDT tables in the fixmap section

:::::: TO: Thomas Garnier <thgarnie@xxxxxxxxxx>
:::::: CC: Ingo Molnar <mingo@xxxxxxxxxx>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki