tree:
https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/entry
head: 552572a83438a85d885f4638d65dee36927920ce
commit: a603685f0f8ab008afb582c6f319ceb2ad506537 [80/125] x86/entry: Convert double fault
exception to IDTENTRY_DF
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
git checkout a603685f0f8ab008afb582c6f319ceb2ad506537
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
arch/x86/kernel/doublefault_32.c: In function 'doublefault_shim':
> arch/x86/kernel/doublefault_32.c:73:2: error: implicit
declaration of function 'exc_double_fault'; did you mean 'do_page_fault'?
[-Werror=implicit-function-declaration]
exc_double_fault(®s, 0, cr2);
^~~~~~~~~~~~~~~~
do_page_fault
arch/x86/kernel/doublefault_32.c: At top level:
> arch/x86/kernel/doublefault_32.c:97:26: error:
'asm_exc_double_fault' undeclared here (not in a function); did you mean
'async_page_fault'?
.ip = (unsigned long) asm_exc_double_fault,
^~~~~~~~~~~~~~~~~~~~
async_page_fault
cc1: some warnings being treated as errors
vim +73 arch/x86/kernel/doublefault_32.c
19
20 /*
21 * Called by double_fault with CR0.TS and EFLAGS.NT cleared. The CPU thinks
22 * we're running the doublefault task. Cannot return.
23 */
24 asmlinkage noinstr void __noreturn doublefault_shim(void)
25 {
26 unsigned long cr2;
27 struct pt_regs regs;
28
29 BUILD_BUG_ON(sizeof(struct doublefault_stack) != PAGE_SIZE);
30
31 cr2 = native_read_cr2();
32
33 /* Reset back to the normal kernel task. */
34 force_reload_TR();
35 set_df_gdt_entry(smp_processor_id());
36
37 trace_hardirqs_off();
38
39 /*
40 * Fill in pt_regs. A downside of doing this in C is that the unwinder
41 * won't see it (no ENCODE_FRAME_POINTER), so a nested stack dump
42 * won't successfully unwind to the source of the double fault.
43 * The main dump from exc_double_fault() is fine, though, since it
44 * uses these regs directly.
45 *
46 * If anyone ever cares, this could be moved to asm.
47 */
48 regs.ss = TSS(ss);
49 regs.__ssh = 0;
50 regs.sp = TSS(sp);
51 regs.flags = TSS(flags);
52 regs.cs = TSS(cs);
53 /* We won't go through the entry asm, so we can leave __csh as 0. */
54 regs.__csh = 0;
55 regs.ip = TSS(ip);
56 regs.orig_ax = 0;
57 regs.gs = TSS(gs);
58 regs.__gsh = 0;
59 regs.fs = TSS(fs);
60 regs.__fsh = 0;
61 regs.es = TSS(es);
62 regs.__esh = 0;
63 regs.ds = TSS(ds);
64 regs.__dsh = 0;
65 regs.ax = TSS(ax);
66 regs.bp = TSS(bp);
67 regs.di = TSS(di);
68 regs.si = TSS(si);
69 regs.dx = TSS(dx);
70 regs.cx = TSS(cx);
71 regs.bx = TSS(bx);
72
73 exc_double_fault(®s, 0, cr2);
74
75 /*
76 * x86_32 does not save the original CR3 anywhere on a task switch.
77 * This means that, even if we wanted to return, we would need to find
78 * some way to reconstruct CR3. We could make a credible guess based
79 * on cpu_tlbstate, but that would be racy and would not account for
80 * PTI.
81 *
82 * Instead, don't bother. We can return through
83 * rewind_stack_do_exit() instead.
84 */
85 panic("cannot return from double fault\n");
86 }
87
88 DEFINE_PER_CPU_PAGE_ALIGNED(struct doublefault_stack, doublefault_stack) = {
89 .tss = {
90 /*
91 * No sp0 or ss0 -- we never run CPL != 0 with this TSS
92 * active. sp is filled in later.
93 */
94 .ldt = 0,
95 .io_bitmap_base = IO_BITMAP_OFFSET_INVALID,
96
97 .ip = (unsigned long) asm_exc_double_fault,
98 .flags = X86_EFLAGS_FIXED,
99 .es = __USER_DS,
100 .cs = __KERNEL_CS,
101 .ss = __KERNEL_DS,
102 .ds = __USER_DS,
103 .fs = __KERNEL_PERCPU,
104 #ifndef CONFIG_X86_32_LAZY_GS
105 .gs = __KERNEL_STACK_CANARY,
106 #endif
107
108 .__cr3 = __pa_nodebug(swapper_pg_dir),
109 },
110 };
111
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org