]> Zhao Yanbai Git Server - minix.git/commitdiff
Fix iopl flag when sysenter/exit are used 66/2866/1
authorLionel Sambuc <lionel@minix3.org>
Fri, 31 Oct 2014 21:40:23 +0000 (22:40 +0100)
committerLionel Sambuc <lionel@minix3.org>
Fri, 7 Nov 2014 15:20:39 +0000 (16:20 +0100)
Change-Id: If8c12f987c3adb8f329ae163da6b2f1cb8cc772f

minix/kernel/arch/i386/mpx.S

index 4617bfdc2bdaeea0ea6772f41bee7d8a44970262..81fb696a3c73a384a542d689abe7f6888d7bfe7d 100644 (file)
@@ -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 */