...
 
Commits (2)
......@@ -579,10 +579,15 @@ END(irq_entries_start)
call sync_stacks
movq %rax, %rsp /* switch stack */
movq vmfunc_state_page + VMFUNC_lcd_stack_saved, %rax
testq $1, %rax
jnz 1f
/* Save LCD stack into current->lcd_stack */
movq %rsp, %rdi
call save_lcd_stack
movq $1, vmfunc_state_page + VMFUNC_lcd_stack_saved
1:
/* We've restored gs and kernel stack -- it's safe to update the
entered_lcd flag */
movq $0, vmfunc_state_page + VMFUNC_entered_lcd
......
......@@ -45,7 +45,9 @@ struct vmfunc_state {
unsigned long kernel_gs_base;
unsigned long lcd_gs_base;
unsigned long entered_lcd;
unsigned long kernel_esp;
unsigned long kernel_esp;
unsigned long lcd_stack_saved;
};
union vmfunc_state_page {
......
......@@ -58,6 +58,7 @@ int main(void)
OFFSET(VMFUNC_lcd_gs_base, vmfunc_state, lcd_gs_base);
OFFSET(VMFUNC_entered_lcd, vmfunc_state, entered_lcd);
OFFSET(VMFUNC_kernel_esp, vmfunc_state, kernel_esp);
OFFSET(VMFUNC_lcd_stack_saved, vmfunc_state, lcd_stack_saved);
OFFSET(TSS_ist, tss_struct, x86_tss.ist);
......
......@@ -149,7 +149,8 @@ EXPORT_PER_CPU_SYMBOL_GPL(gdt_page);
union vmfunc_state_page vmfunc_state_page = {
.vmfunc_state.in_kernel = 1,
.vmfunc_state.entered_lcd = 0,
.vmfunc_state.entered_lcd = 0,
.vmfunc_state.lcd_stack_saved = 1,
};
EXPORT_SYMBOL(vmfunc_state_page);
......