diff options
Diffstat (limited to 'arch/x86/kernel/microcode.c')
-rw-r--r-- | arch/x86/kernel/microcode.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/x86/kernel/microcode.c b/arch/x86/kernel/microcode.c index fc4790638b69..6994c751590e 100644 --- a/arch/x86/kernel/microcode.c +++ b/arch/x86/kernel/microcode.c | |||
@@ -388,6 +388,7 @@ static int do_microcode_update (void) | |||
388 | void *new_mc = NULL; | 388 | void *new_mc = NULL; |
389 | int cpu; | 389 | int cpu; |
390 | cpumask_t old; | 390 | cpumask_t old; |
391 | cpumask_of_cpu_ptr_declare(newmask); | ||
391 | 392 | ||
392 | old = current->cpus_allowed; | 393 | old = current->cpus_allowed; |
393 | 394 | ||
@@ -404,7 +405,8 @@ static int do_microcode_update (void) | |||
404 | 405 | ||
405 | if (!uci->valid) | 406 | if (!uci->valid) |
406 | continue; | 407 | continue; |
407 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); | 408 | cpumask_of_cpu_ptr_next(newmask, cpu); |
409 | set_cpus_allowed_ptr(current, newmask); | ||
408 | error = get_maching_microcode(new_mc, cpu); | 410 | error = get_maching_microcode(new_mc, cpu); |
409 | if (error < 0) | 411 | if (error < 0) |
410 | goto out; | 412 | goto out; |
@@ -574,6 +576,7 @@ static int apply_microcode_check_cpu(int cpu) | |||
574 | struct cpuinfo_x86 *c = &cpu_data(cpu); | 576 | struct cpuinfo_x86 *c = &cpu_data(cpu); |
575 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; | 577 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; |
576 | cpumask_t old; | 578 | cpumask_t old; |
579 | cpumask_of_cpu_ptr(newmask, cpu); | ||
577 | unsigned int val[2]; | 580 | unsigned int val[2]; |
578 | int err = 0; | 581 | int err = 0; |
579 | 582 | ||
@@ -582,7 +585,7 @@ static int apply_microcode_check_cpu(int cpu) | |||
582 | return 0; | 585 | return 0; |
583 | 586 | ||
584 | old = current->cpus_allowed; | 587 | old = current->cpus_allowed; |
585 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); | 588 | set_cpus_allowed_ptr(current, newmask); |
586 | 589 | ||
587 | /* Check if the microcode we have in memory matches the CPU */ | 590 | /* Check if the microcode we have in memory matches the CPU */ |
588 | if (c->x86_vendor != X86_VENDOR_INTEL || c->x86 < 6 || | 591 | if (c->x86_vendor != X86_VENDOR_INTEL || c->x86 < 6 || |
@@ -620,11 +623,12 @@ static int apply_microcode_check_cpu(int cpu) | |||
620 | static void microcode_init_cpu(int cpu, int resume) | 623 | static void microcode_init_cpu(int cpu, int resume) |
621 | { | 624 | { |
622 | cpumask_t old; | 625 | cpumask_t old; |
626 | cpumask_of_cpu_ptr(newmask, cpu); | ||
623 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; | 627 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; |
624 | 628 | ||
625 | old = current->cpus_allowed; | 629 | old = current->cpus_allowed; |
626 | 630 | ||
627 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); | 631 | set_cpus_allowed_ptr(current, newmask); |
628 | mutex_lock(µcode_mutex); | 632 | mutex_lock(µcode_mutex); |
629 | collect_cpu_info(cpu); | 633 | collect_cpu_info(cpu); |
630 | if (uci->valid && system_state == SYSTEM_RUNNING && !resume) | 634 | if (uci->valid && system_state == SYSTEM_RUNNING && !resume) |
@@ -658,11 +662,12 @@ static ssize_t reload_store(struct sys_device *dev, | |||
658 | return -EINVAL; | 662 | return -EINVAL; |
659 | if (val == 1) { | 663 | if (val == 1) { |
660 | cpumask_t old; | 664 | cpumask_t old; |
665 | cpumask_of_cpu_ptr(newmask, cpu); | ||
661 | 666 | ||
662 | old = current->cpus_allowed; | 667 | old = current->cpus_allowed; |
663 | 668 | ||
664 | get_online_cpus(); | 669 | get_online_cpus(); |
665 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); | 670 | set_cpus_allowed_ptr(current, newmask); |
666 | 671 | ||
667 | mutex_lock(µcode_mutex); | 672 | mutex_lock(µcode_mutex); |
668 | if (uci->valid) | 673 | if (uci->valid) |