Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1544621

[PATCH] x86/microcode: Adjust ramdisk address when accessing by virtual address

From Boris Ostrovsky <boris.ostrovsky@oracle.com>
Newsgroups linux.kernel
Subject [PATCH] x86/microcode: Adjust ramdisk address when accessing by virtual address
Date 2016-12-19 16:40 +0100
Message-ID <sQ8cF-1hT-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] x86/microcode: Adjust ramdisk address when accessing by virtual address Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-12-19 16:40 +0100

csiph-web