Commit 2c7f5db1 authored by Dave Jones's avatar Dave Jones

[PATCH] make x86 MSR driver preempt safe

parent 96e5445b
...@@ -115,9 +115,13 @@ static void msr_smp_rdmsr(void *cmd_block) ...@@ -115,9 +115,13 @@ static void msr_smp_rdmsr(void *cmd_block)
static inline int do_wrmsr(int cpu, u32 reg, u32 eax, u32 edx) static inline int do_wrmsr(int cpu, u32 reg, u32 eax, u32 edx)
{ {
struct msr_command cmd; struct msr_command cmd;
int ret;
preempt_disable();
if ( cpu == smp_processor_id() ) { if ( cpu == smp_processor_id() ) {
return wrmsr_eio(reg, eax, edx); ret = wrmsr_eio(reg, eax, edx);
preempt_enable();
return ret;
} else { } else {
cmd.cpu = cpu; cmd.cpu = cpu;
cmd.reg = reg; cmd.reg = reg;
...@@ -125,6 +129,7 @@ static inline int do_wrmsr(int cpu, u32 reg, u32 eax, u32 edx) ...@@ -125,6 +129,7 @@ static inline int do_wrmsr(int cpu, u32 reg, u32 eax, u32 edx)
cmd.data[1] = edx; cmd.data[1] = edx;
smp_call_function(msr_smp_wrmsr, &cmd, 1, 1); smp_call_function(msr_smp_wrmsr, &cmd, 1, 1);
preempt_enable();
return cmd.err; return cmd.err;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment