From: Lionel Sambuc Date: Fri, 31 Oct 2014 21:40:23 +0000 (+0100) Subject: Fix iopl flag when sysenter/exit are used X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=refs%2Fchanges%2F66%2F2866%2F1;p=minix.git Fix iopl flag when sysenter/exit are used Change-Id: If8c12f987c3adb8f329ae163da6b2f1cb8cc772f --- diff --git a/minix/kernel/arch/i386/mpx.S b/minix/kernel/arch/i386/mpx.S index 4617bfdc2..81fb696a3 100644 --- a/minix/kernel/arch/i386/mpx.S +++ b/minix/kernel/arch/i386/mpx.S @@ -402,7 +402,12 @@ ENTRY(restore_user_context_sysenter) mov SPREG(%ebp), %ecx /* sysexit restores ESP using ECX */ mov AXREG(%ebp), %eax /* trap return value */ mov BXREG(%ebp), %ebx /* secondary return value */ - movl PSWREG(%ebp), %edi /* load desired PSW to EDI */ + + /* restore PSW */ + movl PSWREG(%ebp), %edi /* load desired PSW to EDI */ + push %edi + popf + sti /* enable interrupts */ sysexit /* jump to EIP in user */