mirror of https://gitee.com/openkylin/linux.git
x86/microcode/AMD: Reload proper initrd start address
When we switch to virtual addresses and, especially after reserve_initrd()->relocate_initrd() have run, we have the updated initrd address in initrd_start. Use initrd_start then instead of the address which has been passed to us through boot params. (That still gets used when we're running the very early routines on the BSP). Reported-and-tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Borislav Petkov <bp@suse.de> Link: http://lkml.kernel.org/r/20161220144012.lc4cwrg6dphqbyqu@pd.tnic Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
9120cf4fd9
commit
8877ebdd3f
|
@ -243,14 +243,12 @@ struct cpio_data find_microcode_in_initrd(const char *path, bool use_pa)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Did we relocate the ramdisk?
|
* Fixup the start address: after reserve_initrd() runs, initrd_start
|
||||||
*
|
* has the virtual address of the beginning of the initrd. It also
|
||||||
* So we possibly relocate the ramdisk *after* applying microcode on the
|
* possibly relocates the ramdisk. In either case, initrd_start contains
|
||||||
* BSP so we rely on use_pa (use physical addresses) - even if it is not
|
* the updated address so use that instead.
|
||||||
* absolutely correct - to determine whether we've done the ramdisk
|
|
||||||
* relocation already.
|
|
||||||
*/
|
*/
|
||||||
if (!use_pa && relocated_ramdisk)
|
if (!use_pa && initrd_start)
|
||||||
start = initrd_start;
|
start = initrd_start;
|
||||||
|
|
||||||
return find_cpio_data(path, (void *)start, size, NULL);
|
return find_cpio_data(path, (void *)start, size, NULL);
|
||||||
|
|
Loading…
Reference in New Issue