Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753536AbcLSPbW (ORCPT ); Mon, 19 Dec 2016 10:31:22 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:41292 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754837AbcLSPak (ORCPT ); Mon, 19 Dec 2016 10:30:40 -0500 From: Boris Ostrovsky To: bp@alien8.de Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Boris Ostrovsky Subject: [PATCH] x86/microcode: Adjust ramdisk address when accessing by virtual address Date: Mon, 19 Dec 2016 10:32:13 -0500 Message-Id: <1482161533-21097-1-git-send-email-boris.ostrovsky@oracle.com> X-Mailer: git-send-email 2.7.4 X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 933 Lines: 27 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 --- 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