diff options
Diffstat (limited to 'arch/x86/kernel/cpu/microcode/amd.c')
| -rw-r--r-- | arch/x86/kernel/cpu/microcode/amd.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index 27a0228c9cae..b816971f5da4 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c | |||
| @@ -355,6 +355,7 @@ void load_ucode_amd_ap(void) | |||
| 355 | unsigned int cpu = smp_processor_id(); | 355 | unsigned int cpu = smp_processor_id(); |
| 356 | struct equiv_cpu_entry *eq; | 356 | struct equiv_cpu_entry *eq; |
| 357 | struct microcode_amd *mc; | 357 | struct microcode_amd *mc; |
| 358 | u8 *cont = container; | ||
| 358 | u32 rev, eax; | 359 | u32 rev, eax; |
| 359 | u16 eq_id; | 360 | u16 eq_id; |
| 360 | 361 | ||
| @@ -371,8 +372,11 @@ void load_ucode_amd_ap(void) | |||
| 371 | if (check_current_patch_level(&rev, false)) | 372 | if (check_current_patch_level(&rev, false)) |
| 372 | return; | 373 | return; |
| 373 | 374 | ||
| 375 | /* Add CONFIG_RANDOMIZE_MEMORY offset. */ | ||
| 376 | cont += PAGE_OFFSET - __PAGE_OFFSET_BASE; | ||
| 377 | |||
| 374 | eax = cpuid_eax(0x00000001); | 378 | eax = cpuid_eax(0x00000001); |
| 375 | eq = (struct equiv_cpu_entry *)(container + CONTAINER_HDR_SZ); | 379 | eq = (struct equiv_cpu_entry *)(cont + CONTAINER_HDR_SZ); |
| 376 | 380 | ||
| 377 | eq_id = find_equiv_id(eq, eax); | 381 | eq_id = find_equiv_id(eq, eax); |
| 378 | if (!eq_id) | 382 | if (!eq_id) |
| @@ -434,6 +438,9 @@ int __init save_microcode_in_initrd_amd(void) | |||
| 434 | else | 438 | else |
| 435 | container = cont_va; | 439 | container = cont_va; |
| 436 | 440 | ||
| 441 | /* Add CONFIG_RANDOMIZE_MEMORY offset. */ | ||
| 442 | container += PAGE_OFFSET - __PAGE_OFFSET_BASE; | ||
| 443 | |||
| 437 | eax = cpuid_eax(0x00000001); | 444 | eax = cpuid_eax(0x00000001); |
| 438 | eax = ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff); | 445 | eax = ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff); |
| 439 | 446 | ||
