diff --git a/arch/x86/kernel/entry32.asm b/arch/x86/kernel/entry32.asm index 84542d87..c1e90e70 100644 --- a/arch/x86/kernel/entry32.asm +++ b/arch/x86/kernel/entry32.asm @@ -810,6 +810,11 @@ common_switch: add ebx, KERNEL_STACK_SIZE-16 mov [eax+4], ebx + ; set task switched flag + mov eax, cr0 + or eax, 8 + mov cr0, eax + ; call cleanup code call finish_task_switch diff --git a/arch/x86/kernel/entry64.asm b/arch/x86/kernel/entry64.asm index ba38163c..627a8682 100644 --- a/arch/x86/kernel/entry64.asm +++ b/arch/x86/kernel/entry64.asm @@ -1155,6 +1155,11 @@ common_switch: add rbx, KERNEL_STACK_SIZE-16 mov [rax+4], rbx + ; set task switched flag + mov rax, cr0 + or eax, 8 + mov cr0, rax + ; call cleanup code call finish_task_switch