Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324040
b: refs/heads/master
c: 48e3068
h: refs/heads/master
v: v3
  • Loading branch information
Borislav Petkov authored and H. Peter Anvin committed Aug 22, 2012
1 parent 2cc48f9 commit e571787
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 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: 5f5b747282c6cc57b91baba37f76de27398b9e60
refs/heads/master: 48e30685caa8bdc4b8d4417d8ac31db59689742c
4 changes: 2 additions & 2 deletions trunk/arch/x86/include/asm/microcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ struct microcode_ops {
enum ucode_state (*request_microcode_user) (int cpu,
const void __user *buf, size_t size);

enum ucode_state (*request_microcode_fw) (int cpu,
struct device *device);
enum ucode_state (*request_microcode_fw) (int cpu, struct device *,
bool refresh_fw);

void (*microcode_fini_cpu) (int cpu);

Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/x86/kernel/microcode_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ generic_load_microcode(int cpu, const u8 *data, size_t size)
*
* These might be larger than 2K.
*/
static enum ucode_state request_microcode_amd(int cpu, struct device *device)
static enum ucode_state request_microcode_amd(int cpu, struct device *device,
bool refresh_fw)
{
char fw_name[36] = "amd-ucode/microcode_amd.bin";
const struct firmware *fw;
Expand Down
11 changes: 6 additions & 5 deletions trunk/arch/x86/kernel/microcode_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ static int reload_for_cpu(int cpu)
if (!uci->valid)
return err;

ustate = microcode_ops->request_microcode_fw(cpu, &microcode_pdev->dev);
ustate = microcode_ops->request_microcode_fw(cpu, &microcode_pdev->dev, true);
if (ustate == UCODE_OK)
apply_microcode_on_target(cpu);
else
Expand Down Expand Up @@ -377,7 +377,7 @@ static enum ucode_state microcode_resume_cpu(int cpu)
return UCODE_OK;
}

static enum ucode_state microcode_init_cpu(int cpu)
static enum ucode_state microcode_init_cpu(int cpu, bool refresh_fw)
{
enum ucode_state ustate;

Expand All @@ -388,7 +388,8 @@ static enum ucode_state microcode_init_cpu(int cpu)
if (system_state != SYSTEM_RUNNING)
return UCODE_NFOUND;

ustate = microcode_ops->request_microcode_fw(cpu, &microcode_pdev->dev);
ustate = microcode_ops->request_microcode_fw(cpu, &microcode_pdev->dev,
refresh_fw);

if (ustate == UCODE_OK) {
pr_debug("CPU%d updated upon init\n", cpu);
Expand All @@ -405,7 +406,7 @@ static enum ucode_state microcode_update_cpu(int cpu)
if (uci->valid)
return microcode_resume_cpu(cpu);

return microcode_init_cpu(cpu);
return microcode_init_cpu(cpu, false);
}

static int mc_device_add(struct device *dev, struct subsys_interface *sif)
Expand All @@ -421,7 +422,7 @@ static int mc_device_add(struct device *dev, struct subsys_interface *sif)
if (err)
return err;

if (microcode_init_cpu(cpu) == UCODE_ERROR)
if (microcode_init_cpu(cpu, true) == UCODE_ERROR)
return -EINVAL;

return err;
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/x86/kernel/microcode_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,8 @@ static int get_ucode_fw(void *to, const void *from, size_t n)
return 0;
}

static enum ucode_state request_microcode_fw(int cpu, struct device *device)
static enum ucode_state request_microcode_fw(int cpu, struct device *device,
bool refresh_fw)
{
char name[30];
struct cpuinfo_x86 *c = &cpu_data(cpu);
Expand Down

0 comments on commit e571787

Please sign in to comment.