aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/microcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/microcode.c')
-rw-r--r--arch/x86/kernel/microcode.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/arch/x86/kernel/microcode.c b/arch/x86/kernel/microcode.c
index 758b958a6637..28dba1a6e4aa 100644
--- a/arch/x86/kernel/microcode.c
+++ b/arch/x86/kernel/microcode.c
@@ -123,7 +123,6 @@ static int do_microcode_update (void)
123 void *new_mc = NULL; 123 void *new_mc = NULL;
124 int cpu; 124 int cpu;
125 cpumask_t old; 125 cpumask_t old;
126 cpumask_of_cpu_ptr_declare(newmask);
127 126
128 old = current->cpus_allowed; 127 old = current->cpus_allowed;
129 128
@@ -140,8 +139,7 @@ static int do_microcode_update (void)
140 139
141 if (!uci->valid) 140 if (!uci->valid)
142 continue; 141 continue;
143 cpumask_of_cpu_ptr_next(newmask, cpu); 142 set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
144 set_cpus_allowed_ptr(current, newmask);
145 error = microcode_ops->get_matching_microcode(new_mc, 143 error = microcode_ops->get_matching_microcode(new_mc,
146 cpu); 144 cpu);
147 if (error < 0) 145 if (error < 0)
@@ -236,12 +234,11 @@ EXPORT_SYMBOL_GPL(microcode_pdev);
236static void microcode_init_cpu(int cpu, int resume) 234static void microcode_init_cpu(int cpu, int resume)
237{ 235{
238 cpumask_t old; 236 cpumask_t old;
239 cpumask_of_cpu_ptr(newmask, cpu);
240 struct ucode_cpu_info *uci = ucode_cpu_info + cpu; 237 struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
241 238
242 old = current->cpus_allowed; 239 old = current->cpus_allowed;
243 240
244 set_cpus_allowed_ptr(current, newmask); 241 set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
245 mutex_lock(&microcode_mutex); 242 mutex_lock(&microcode_mutex);
246 microcode_ops->collect_cpu_info(cpu); 243 microcode_ops->collect_cpu_info(cpu);
247 if (uci->valid && system_state == SYSTEM_RUNNING && !resume) 244 if (uci->valid && system_state == SYSTEM_RUNNING && !resume)
@@ -263,13 +260,10 @@ static ssize_t reload_store(struct sys_device *dev,
263 if (end == buf) 260 if (end == buf)
264 return -EINVAL; 261 return -EINVAL;
265 if (val == 1) { 262 if (val == 1) {
266 cpumask_t old; 263 cpumask_t old = current->cpus_allowed;
267 cpumask_of_cpu_ptr(newmask, cpu);
268
269 old = current->cpus_allowed;
270 264
271 get_online_cpus(); 265 get_online_cpus();
272 set_cpus_allowed_ptr(current, newmask); 266 set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
273 267
274 mutex_lock(&microcode_mutex); 268 mutex_lock(&microcode_mutex);
275 if (uci->valid) 269 if (uci->valid)