Loading arch/x86/kernel/microcode_amd.c +14 −11 Original line number Original line Diff line number Diff line Loading @@ -32,9 +32,9 @@ #include <linux/platform_device.h> #include <linux/platform_device.h> #include <linux/pci.h> #include <linux/pci.h> #include <linux/pci_ids.h> #include <linux/pci_ids.h> #include <linux/uaccess.h> #include <asm/msr.h> #include <asm/msr.h> #include <asm/uaccess.h> #include <asm/processor.h> #include <asm/processor.h> #include <asm/microcode.h> #include <asm/microcode.h> Loading Loading @@ -256,7 +256,8 @@ static void * get_next_ucode(u8 *buf, unsigned int size, mc = vmalloc(UCODE_MAX_SIZE); mc = vmalloc(UCODE_MAX_SIZE); if (mc) { if (mc) { memset(mc, 0, UCODE_MAX_SIZE); memset(mc, 0, UCODE_MAX_SIZE); if (get_ucode_data(mc, buf + UCODE_CONTAINER_SECTION_HDR, total_size)) { if (get_ucode_data(mc, buf + UCODE_CONTAINER_SECTION_HDR, total_size)) { vfree(mc); vfree(mc); mc = NULL; mc = NULL; } else } else Loading Loading @@ -332,7 +333,8 @@ static int generic_load_microcode(int cpu, void *data, size_t size, unsigned int uninitialized_var(mc_size); unsigned int uninitialized_var(mc_size); struct microcode_header_amd *mc_header; struct microcode_header_amd *mc_header; mc = get_next_ucode(ucode_ptr, leftover, get_ucode_data, &mc_size); mc = get_next_ucode(ucode_ptr, leftover, get_ucode_data, &mc_size); if (!mc) if (!mc) break; break; Loading @@ -354,8 +356,8 @@ static int generic_load_microcode(int cpu, void *data, size_t size, if (uci->mc) if (uci->mc) vfree(uci->mc); vfree(uci->mc); uci->mc = new_mc; uci->mc = new_mc; pr_debug("microcode: CPU%d found a matching microcode update with" pr_debug("microcode: CPU%d found a matching microcode " " version 0x%x (current=0x%x)\n", "update with version 0x%x (current=0x%x)\n", cpu, new_rev, uci->cpu_sig.rev); cpu, new_rev, uci->cpu_sig.rev); } else } else vfree(new_mc); vfree(new_mc); Loading Loading @@ -383,7 +385,8 @@ static int request_microcode_fw(int cpu, struct device *device) ret = request_firmware(&firmware, fw_name, device); ret = request_firmware(&firmware, fw_name, device); if (ret) { if (ret) { printk(KERN_ERR "microcode: ucode data file %s load failed\n", fw_name); printk(KERN_ERR "microcode: ucode data file %s load failed\n", fw_name); return ret; return ret; } } Loading @@ -397,8 +400,8 @@ static int request_microcode_fw(int cpu, struct device *device) static int request_microcode_user(int cpu, const void __user *buf, size_t size) static int request_microcode_user(int cpu, const void __user *buf, size_t size) { { printk(KERN_WARNING "microcode: AMD microcode update via /dev/cpu/microcode" printk(KERN_WARNING "microcode: AMD microcode update via " "is not supported\n"); "/dev/cpu/microcode is not supported\n"); return -1; return -1; } } Loading Loading
arch/x86/kernel/microcode_amd.c +14 −11 Original line number Original line Diff line number Diff line Loading @@ -32,9 +32,9 @@ #include <linux/platform_device.h> #include <linux/platform_device.h> #include <linux/pci.h> #include <linux/pci.h> #include <linux/pci_ids.h> #include <linux/pci_ids.h> #include <linux/uaccess.h> #include <asm/msr.h> #include <asm/msr.h> #include <asm/uaccess.h> #include <asm/processor.h> #include <asm/processor.h> #include <asm/microcode.h> #include <asm/microcode.h> Loading Loading @@ -256,7 +256,8 @@ static void * get_next_ucode(u8 *buf, unsigned int size, mc = vmalloc(UCODE_MAX_SIZE); mc = vmalloc(UCODE_MAX_SIZE); if (mc) { if (mc) { memset(mc, 0, UCODE_MAX_SIZE); memset(mc, 0, UCODE_MAX_SIZE); if (get_ucode_data(mc, buf + UCODE_CONTAINER_SECTION_HDR, total_size)) { if (get_ucode_data(mc, buf + UCODE_CONTAINER_SECTION_HDR, total_size)) { vfree(mc); vfree(mc); mc = NULL; mc = NULL; } else } else Loading Loading @@ -332,7 +333,8 @@ static int generic_load_microcode(int cpu, void *data, size_t size, unsigned int uninitialized_var(mc_size); unsigned int uninitialized_var(mc_size); struct microcode_header_amd *mc_header; struct microcode_header_amd *mc_header; mc = get_next_ucode(ucode_ptr, leftover, get_ucode_data, &mc_size); mc = get_next_ucode(ucode_ptr, leftover, get_ucode_data, &mc_size); if (!mc) if (!mc) break; break; Loading @@ -354,8 +356,8 @@ static int generic_load_microcode(int cpu, void *data, size_t size, if (uci->mc) if (uci->mc) vfree(uci->mc); vfree(uci->mc); uci->mc = new_mc; uci->mc = new_mc; pr_debug("microcode: CPU%d found a matching microcode update with" pr_debug("microcode: CPU%d found a matching microcode " " version 0x%x (current=0x%x)\n", "update with version 0x%x (current=0x%x)\n", cpu, new_rev, uci->cpu_sig.rev); cpu, new_rev, uci->cpu_sig.rev); } else } else vfree(new_mc); vfree(new_mc); Loading Loading @@ -383,7 +385,8 @@ static int request_microcode_fw(int cpu, struct device *device) ret = request_firmware(&firmware, fw_name, device); ret = request_firmware(&firmware, fw_name, device); if (ret) { if (ret) { printk(KERN_ERR "microcode: ucode data file %s load failed\n", fw_name); printk(KERN_ERR "microcode: ucode data file %s load failed\n", fw_name); return ret; return ret; } } Loading @@ -397,8 +400,8 @@ static int request_microcode_fw(int cpu, struct device *device) static int request_microcode_user(int cpu, const void __user *buf, size_t size) static int request_microcode_user(int cpu, const void __user *buf, size_t size) { { printk(KERN_WARNING "microcode: AMD microcode update via /dev/cpu/microcode" printk(KERN_WARNING "microcode: AMD microcode update via " "is not supported\n"); "/dev/cpu/microcode is not supported\n"); return -1; return -1; } } Loading