From: tip-bot for Borislav Petkov <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, hpa@zytor.com, boris.ostrovsky@oracle.com,
bp@suse.de, linux-kernel@vger.kernel.org, tglx@linutronix.de
Subject: [tip:x86/urgent] x86/microcode/AMD: Reload proper initrd start address
Date: Wed, 21 Dec 2016 01:55:07 -0800 [thread overview]
Message-ID: <tip-8877ebdd3f9a3ffc84c4b67562d257c5f553bc49@git.kernel.org> (raw)
In-Reply-To: <20161220144012.lc4cwrg6dphqbyqu@pd.tnic>
Commit-ID: 8877ebdd3f9a3ffc84c4b67562d257c5f553bc49
Gitweb: http://git.kernel.org/tip/8877ebdd3f9a3ffc84c4b67562d257c5f553bc49
Author: Borislav Petkov <bp@suse.de>
AuthorDate: Tue, 20 Dec 2016 11:54:30 +0100
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 21 Dec 2016 10:50:04 +0100
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>
---
arch/x86/kernel/cpu/microcode/core.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index c4bb2f7..2af69d2 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -243,14 +243,12 @@ struct cpio_data find_microcode_in_initrd(const char *path, bool use_pa)
# endif
/*
- * Did we relocate the ramdisk?
- *
- * So we possibly relocate the ramdisk *after* applying microcode on the
- * BSP so we rely on use_pa (use physical addresses) - even if it is not
- * absolutely correct - to determine whether we've done the ramdisk
- * relocation already.
+ * Fixup the start address: after reserve_initrd() runs, initrd_start
+ * has the virtual address of the beginning of the initrd. It also
+ * possibly relocates the ramdisk. In either case, initrd_start contains
+ * the updated address so use that instead.
*/
- if (!use_pa && relocated_ramdisk)
+ if (!use_pa && initrd_start)
start = initrd_start;
return find_cpio_data(path, (void *)start, size, NULL);
prev parent reply other threads:[~2016-12-21 9:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
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-bot for Borislav Petkov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-8877ebdd3f9a3ffc84c4b67562d257c5f553bc49@git.kernel.org \
--to=tipbot@zytor.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@suse.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome