aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/ioport.c
diff options
context:
space:
mode:
authorChris Wright <chrisw@sous-sol.org>2008-01-30 07:33:10 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:10 -0500
commit9718769d298f8642d5ef41eb5f55669d7c5b9fd6 (patch)
tree466491e290a48b03426b9ee20ab364f53b8efb55 /arch/x86/kernel/ioport.c
parentccafa59a0061d7c44d15d02403120fd02b52c667 (diff)
x86: fix ioport unification on 32-bit
ioport unification was broken for 32-bit; it was missing the acutal pushf/popf EFLAGS manipulation (set_iopl_mask()). Also, use of volatile looks like leftover cruft. Cc: mboton@gmail.com Cc: Kevin Winchester <kjwinchester@gmail.com> Cc: Zach Brown <zach.brown@oracle.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/ioport.c')
-rw-r--r--arch/x86/kernel/ioport.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c
index e723ff3b1d53..be72d809bce7 100644
--- a/arch/x86/kernel/ioport.c
+++ b/arch/x86/kernel/ioport.c
@@ -116,9 +116,10 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
116#ifdef CONFIG_X86_32 116#ifdef CONFIG_X86_32
117asmlinkage long sys_iopl(unsigned long regsp) 117asmlinkage long sys_iopl(unsigned long regsp)
118{ 118{
119 volatile struct pt_regs *regs = (struct pt_regs *)&regsp; 119 struct pt_regs *regs = (struct pt_regs *)&regsp;
120 unsigned int level = regs->bx; 120 unsigned int level = regs->bx;
121 unsigned int old = (regs->flags >> 12) & 3; 121 unsigned int old = (regs->flags >> 12) & 3;
122 struct thread_struct *t = &current->thread;
122 123
123 if (level > 3) 124 if (level > 3)
124 return -EINVAL; 125 return -EINVAL;
@@ -127,8 +128,9 @@ asmlinkage long sys_iopl(unsigned long regsp)
127 if (!capable(CAP_SYS_RAWIO)) 128 if (!capable(CAP_SYS_RAWIO))
128 return -EPERM; 129 return -EPERM;
129 } 130 }
131 t->iopl = level << 12;
130 regs->flags = (regs->flags & ~X86_EFLAGS_IOPL) | (level << 12); 132 regs->flags = (regs->flags & ~X86_EFLAGS_IOPL) | (level << 12);
131 133 set_iopl_mask(t->iopl);
132 return 0; 134 return 0;
133} 135}
134#else 136#else