diff options
author | Dmitry Adamushko <dmitry.adamushko@gmail.com> | 2008-09-23 16:56:35 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-24 04:32:37 -0400 |
commit | 2f9284e4e3be7b0b4d8d0638f9805603069a762d (patch) | |
tree | 7d47a26674a5120cc930c4fcea5bfead7b79c28b | |
parent | e6aa0f07cb5e81a7cbeaf3be6e2101234c2f0d30 (diff) |
x86, microcode_amd: cleanup, mark request_microcode_user() as unsupported
(1) mark mc_size in generic_load_microcode() as unitialized_var to avoid
gcc's (false) warning;
(2) mark request_microcode_user() as unsupported. The required changes
can be added later. Note, we don't break any user-space interfaces
here, as there were no kernels with support for AMD-specific ucode
update yet. The ucode has to be updated via 'firmware'.
Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/microcode_amd.c | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c index 829415208ff8..7a1f8eeac2c7 100644 --- a/arch/x86/kernel/microcode_amd.c +++ b/arch/x86/kernel/microcode_amd.c | |||
@@ -120,29 +120,7 @@ static int get_matching_microcode(int cpu, void *mc, int rev) | |||
120 | unsigned int equiv_cpu_id = 0x00; | 120 | unsigned int equiv_cpu_id = 0x00; |
121 | unsigned int i = 0; | 121 | unsigned int i = 0; |
122 | 122 | ||
123 | /* | ||
124 | * FIXME! dimm: do we need this? Why an update via /dev/... is different | ||
125 | * from the one via firmware? | ||
126 | * | ||
127 | * This is a tricky part. We might be called from a write operation | ||
128 | * to the device file instead of the usual process of firmware | ||
129 | * loading. This routine needs to be able to distinguish both | ||
130 | * cases. This is done by checking if there alread is a equivalent | ||
131 | * CPU table installed. If not, we're written through | ||
132 | * /dev/cpu/microcode. | ||
133 | * Since we ignore all checks. The error case in which going through | ||
134 | * firmware loading and that table is not loaded has already been | ||
135 | * checked earlier. | ||
136 | */ | ||
137 | BUG_ON(equiv_cpu_table == NULL); | 123 | BUG_ON(equiv_cpu_table == NULL); |
138 | #if 0 | ||
139 | if (equiv_cpu_table == NULL) { | ||
140 | printk(KERN_INFO "microcode: CPU%d microcode update with " | ||
141 | "version 0x%x (current=0x%x)\n", | ||
142 | cpu, mc_header->patch_id, uci->cpu_sig.rev); | ||
143 | goto out; | ||
144 | } | ||
145 | #endif | ||
146 | current_cpu_id = cpuid_eax(0x00000001); | 124 | current_cpu_id = cpuid_eax(0x00000001); |
147 | 125 | ||
148 | while (equiv_cpu_table[i].installed_cpu != 0) { | 126 | while (equiv_cpu_table[i].installed_cpu != 0) { |
@@ -362,7 +340,7 @@ static int generic_load_microcode(int cpu, void *data, size_t size, | |||
362 | leftover = size - offset; | 340 | leftover = size - offset; |
363 | 341 | ||
364 | while (leftover) { | 342 | while (leftover) { |
365 | unsigned int mc_size; | 343 | unsigned int uninitialized_var(mc_size); |
366 | struct microcode_header_amd *mc_header; | 344 | struct microcode_header_amd *mc_header; |
367 | 345 | ||
368 | mc = get_next_ucode(ucode_ptr, leftover, get_ucode_data, &mc_size); | 346 | mc = get_next_ucode(ucode_ptr, leftover, get_ucode_data, &mc_size); |
@@ -428,17 +406,11 @@ static int request_microcode_fw(int cpu, struct device *device) | |||
428 | return ret; | 406 | return ret; |
429 | } | 407 | } |
430 | 408 | ||
431 | static int get_ucode_user(void *to, const void *from, size_t n) | ||
432 | { | ||
433 | return copy_from_user(to, from, n); | ||
434 | } | ||
435 | |||
436 | static int request_microcode_user(int cpu, const void __user *buf, size_t size) | 409 | static int request_microcode_user(int cpu, const void __user *buf, size_t size) |
437 | { | 410 | { |
438 | /* We should bind the task to the CPU */ | 411 | printk(KERN_WARNING "microcode: AMD microcode update via /dev/cpu/microcode" |
439 | BUG_ON(cpu != raw_smp_processor_id()); | 412 | "is not supported\n"); |
440 | 413 | return -1; | |
441 | return generic_load_microcode(cpu, (void*)buf, size, &get_ucode_user); | ||
442 | } | 414 | } |
443 | 415 | ||
444 | static void microcode_fini_cpu_amd(int cpu) | 416 | static void microcode_fini_cpu_amd(int cpu) |