Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143298
b: refs/heads/master
c: 6f66cbc
h: refs/heads/master
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Apr 14, 2009
1 parent cdd2fb8 commit 2c5cb34
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 610f26e75176aeb896618c26b16cbc0601f0e3cf
refs/heads/master: 6f66cbc63081fd70e3191b4dbb796746780e5ae1
33 changes: 11 additions & 22 deletions trunk/arch/x86/kernel/microcode_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,40 +108,29 @@ struct ucode_cpu_info ucode_cpu_info[NR_CPUS];
EXPORT_SYMBOL_GPL(ucode_cpu_info);

#ifdef CONFIG_MICROCODE_OLD_INTERFACE
struct update_for_cpu {
const void __user *buf;
size_t size;
};

static long update_for_cpu(void *_ufc)
{
struct update_for_cpu *ufc = _ufc;
int error;

error = microcode_ops->request_microcode_user(smp_processor_id(),
ufc->buf, ufc->size);
if (error < 0)
return error;
if (!error)
microcode_ops->apply_microcode(smp_processor_id());
return error;
}

static int do_microcode_update(const void __user *buf, size_t size)
{
cpumask_t old;
int error = 0;
int cpu;
struct update_for_cpu ufc = { .buf = buf, .size = size };

old = current->cpus_allowed;

for_each_online_cpu(cpu) {
struct ucode_cpu_info *uci = ucode_cpu_info + cpu;

if (!uci->valid)
continue;
error = work_on_cpu(cpu, update_for_cpu, &ufc);

set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
error = microcode_ops->request_microcode_user(cpu, buf, size);
if (error < 0)
break;
goto out;
if (!error)
microcode_ops->apply_microcode(cpu);
}
out:
set_cpus_allowed_ptr(current, &old);
return error;
}

Expand Down

0 comments on commit 2c5cb34

Please sign in to comment.