From 9393439a2026e4f08e99a30854a71517c1e57b79 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Fri, 31 Oct 2014 22:40:23 +0100 Subject: [PATCH] Fix iopl flag when sysenter/exit are used Change-Id: If8c12f987c3adb8f329ae163da6b2f1cb8cc772f --- minix/kernel/arch/i386/mpx.S | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 */