Hi Peter, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on tip/x86/core] [also build test WARNING on tip/master linus/master v5.13-rc1 next-20210510] [cannot apply to bp/for-next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/H-Peter-Anvin/x86-irq-trap-and-interrupt-cleanups/20210511-085650 base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 2c88d45edbb89029c1190bb3b136d2602f057c98 config: i386-randconfig-s002-20210511 (attached as .config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.3-341-g8af24329-dirty # https://github.com/0day-ci/linux/commit/c9c68d8ad1ef0923798c18f7e9a9570fa23aee0e git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review H-Peter-Anvin/x86-irq-trap-and-interrupt-cleanups/20210511-085650 git checkout c9c68d8ad1ef0923798c18f7e9a9570fa23aee0e # save the attached .config to linux build tree make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=i386 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> arch/x86/kernel/machine_kexec_32.c:236:17: sparse: sparse: Using plain integer as NULL pointer vim +236 arch/x86/kernel/machine_kexec_32.c 188 189 save_ftrace_enabled = __ftrace_enabled_save(); 190 191 /* Interrupts aren't acceptable while we reboot */ 192 local_irq_disable(); 193 hw_breakpoint_disable(); 194 195 if (image->preserve_context) { 196 #ifdef CONFIG_X86_IO_APIC 197 /* 198 * We need to put APICs in legacy mode so that we can 199 * get timer interrupts in second kernel. kexec/kdump 200 * paths already have calls to restore_boot_irq_mode() 201 * in one form or other. kexec jump path also need one. 202 */ 203 clear_IO_APIC(); 204 restore_boot_irq_mode(); 205 #endif 206 } 207 208 control_page = page_address(image->control_code_page); 209 memcpy(control_page, relocate_kernel, KEXEC_CONTROL_CODE_MAX_SIZE); 210 211 relocate_kernel_ptr = control_page; 212 page_list[PA_CONTROL_PAGE] = __pa(control_page); 213 page_list[VA_CONTROL_PAGE] = (unsigned long)control_page; 214 page_list[PA_PGD] = __pa(image->arch.pgd); 215 216 if (image->type == KEXEC_TYPE_DEFAULT) 217 page_list[PA_SWAP_PAGE] = (page_to_pfn(image->swap_page) 218 << PAGE_SHIFT); 219 220 /* 221 * The segment registers are funny things, they have both a 222 * visible and an invisible part. Whenever the visible part is 223 * set to a specific selector, the invisible part is loaded 224 * with from a table in memory. At no other time is the 225 * descriptor table in memory accessed. 226 * 227 * I take advantage of this here by force loading the 228 * segments, before I zap the gdt with an invalid value. 229 */ 230 load_segments(); 231 /* 232 * The gdt & idt are now invalid. 233 * If you want to load them you must set up your own idt & gdt. 234 */ 235 idt_invalidate(); > 236 set_gdt(0, 0); 237 238 /* now call it */ 239 image->start = relocate_kernel_ptr((unsigned long)image->head, 240 (unsigned long)page_list, 241 image->start, 242 boot_cpu_has(X86_FEATURE_PAE), 243 image->preserve_context); 244 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org