Re: [PATCH 3/4] x86/smp: send capped cpus to a stable state when smp_init()

From: kbuild test robot
Date: Thu Aug 08 2019 - 01:19:12 EST


Hi Pingfan,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[cannot apply to v5.3-rc3 next-20190807]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Pingfan-Liu/x86-mce-protect-nr_cpus-from-rebooting-by-broadcast-mce/20190806-101748
config: i386-randconfig-a004-201931 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.2-10+deb8u1) 4.9.2
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

ld: arch/x86/kernel/smpboot.o: in function `do_stable_cpu':
>> arch/x86/kernel/smpboot.c:1057: undefined reference to `initial_gs'

vim +1057 arch/x86/kernel/smpboot.c

1048
1049 static void __init do_stable_cpu(int cpu)
1050 {
1051 static char capped_tmp_stack[512];
1052 int cpu0_nmi_registered = 0, apicid = cpuid_to_apicid[cpu];
1053 unsigned long start_ip = real_mode_header->trampoline_start;
1054 unsigned long timeout, boot_error = 0;
1055
1056 /* invalid percpu area */
> 1057 initial_gs = 0;
1058 /*
1059 * Borrow the value of cpu 0. Since capped cpu segment shadow register
1060 * can cache the content, and keep it unchanged.
1061 */
1062 early_gdt_descr.address = (unsigned long)get_cpu_gdt_rw(0);
1063 initial_code = (unsigned long)make_capped_cpu_stable;
1064 initial_stack = (unsigned long)&capped_tmp_stack;
1065
1066 if (apic->wakeup_secondary_cpu)
1067 boot_error = apic->wakeup_secondary_cpu(apicid, start_ip);
1068 else
1069 boot_error = wakeup_cpu_via_init_nmi(cpu, start_ip, apicid,
1070 &cpu0_nmi_registered);
1071 if (cpu0_nmi_registered)
1072 unregister_nmi_handler(NMI_LOCAL, "wake_cpu0");
1073
1074 if (!boot_error) {
1075 /* Wait 10s total for first sign of life from capped cpu */
1076 boot_error = -1;
1077 timeout = jiffies + 10*HZ;
1078 while (time_before(jiffies, timeout)) {
1079 if (cpumask_test_cpu(cpu, cpu_capped_done_mask))
1080 break;
1081 schedule();
1082 }
1083 }
1084 }
1085

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip