All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/microcode: Adjust ramdisk address when accessing by virtual address
@ 2016-12-19 15:32 Boris Ostrovsky
  2016-12-19 15:37 ` Borislav Petkov
  0 siblings, 1 reply; 16+ messages in thread
From: Boris Ostrovsky @ 2016-12-19 15:32 UTC (permalink / raw)
  To: bp; +Cc: x86, linux-kernel, Boris Ostrovsky

When searching for microcode in the ramdisk image we need to adjust the
start address after paging has been turned on (in 32-bit mode).

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 arch/x86/kernel/cpu/microcode/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index c4bb2f7..bc8c3345 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -227,8 +227,11 @@ struct cpio_data find_microcode_in_initrd(const char *path, bool use_pa)
 	 * Set start only if we have an initrd image. We cannot use initrd_start
 	 * because it is not set that early yet.
 	 */
-	if (size)
+	if (size) {
 		start = params->hdr.ramdisk_image;
+		if (!use_pa)
+			start += PAGE_OFFSET;
+	}
 
 # else /* CONFIG_X86_64 */
 	size  = (unsigned long)boot_params.ext_ramdisk_size << 32;
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-12-21  9:55 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-19 15:32 [PATCH] x86/microcode: Adjust ramdisk address when accessing by virtual address Boris Ostrovsky
2016-12-19 15:37 ` Borislav Petkov
2016-12-19 16:10   ` Boris Ostrovsky
2016-12-19 16:40     ` Borislav Petkov
2016-12-19 18:07       ` Borislav Petkov
2016-12-19 18:12         ` Boris Ostrovsky
2016-12-19 18:43           ` Borislav Petkov
2016-12-19 23:32             ` Borislav Petkov
2016-12-20  1:27               ` Boris Ostrovsky
2016-12-20  1:40                 ` Boris Ostrovsky
2016-12-20 14:40                   ` Borislav Petkov
2016-12-20 19:26                     ` Boris Ostrovsky
2016-12-20 19:31                       ` Borislav Petkov
2016-12-20 22:48                         ` Boris Ostrovsky
2016-12-20 22:55                           ` Borislav Petkov
2016-12-21  9:55                     ` [tip:x86/urgent] x86/microcode/AMD: Reload proper initrd start address tip-bot for Borislav Petkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.