mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Nicolai Stange <nicstange@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arch/x86/kernel/cpu/microcode/intel: don't store initrd's start
Date: Mon, 25 Jul 2016 14:36:43 +0200	[thread overview]
Message-ID: <20160725123643.GE4901@nazgul.tnic> (raw)
In-Reply-To: <87bn1m5auo.fsf@gmail.com>

On Mon, Jul 25, 2016 at 11:24:31AM +0200, Nicolai Stange wrote:
> I tested on linux-next-20160722 (I wrote this below the '---' marker).

Ok, thanks.

So let's try something simpler first. That works in my kvm guest here,
can you test it on your box too please?

---
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index 6515c802346a..b98e016ba5fc 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -793,10 +793,10 @@ void __init load_ucode_intel_bsp(void)
 void load_ucode_intel_ap(void)
 {
 	struct ucode_blobs *blobs_p;
+	unsigned long *ptrs, start;
 	struct mc_saved_data *mcs;
 	struct ucode_cpu_info uci;
 	enum ucode_state ret;
-	unsigned long *ptrs;
 
 #ifdef CONFIG_X86_32
 	mcs	= (struct mc_saved_data *)__pa_nodebug(&mc_saved_data);
@@ -815,8 +815,14 @@ void load_ucode_intel_ap(void)
 	if (!mcs->num_saved)
 		return;
 
+	/*
+	 * Pay attention to CONFIG_RANDOMIZE_MEMORY as it shuffles physmem
+	 * mapping too.
+	 */
+	start = blobs_p->start + (PAGE_OFFSET - __PAGE_OFFSET_BASE);
+
 	collect_cpu_info_early(&uci);
-	ret = load_microcode(mcs, ptrs, blobs_p->start, &uci);
+	ret = load_microcode(mcs, ptrs, start, &uci);
 	if (ret != UCODE_OK)
 		return;
 
---

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--

  reply	other threads:[~2016-07-25 12:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-24 15:05 Nicolai Stange
2016-07-25  7:06 ` Borislav Petkov
2016-07-25  9:24   ` Nicolai Stange
2016-07-25 12:36     ` Borislav Petkov [this message]
2016-07-25 12:59       ` Nicolai Stange
2016-07-25 13:06         ` Nicolai Stange
2016-07-25 13:44         ` Borislav Petkov
2016-07-25 14:16           ` Nicolai Stange
2016-07-25 14:27             ` Nicolai Stange
2016-07-25 16:40               ` Borislav Petkov
2016-07-25 15:07             ` Borislav Petkov
2016-07-25 16:46             ` Borislav Petkov
2016-07-25 17:44               ` Nicolai Stange
2016-07-25 18:18                 ` Borislav Petkov

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=20160725123643.GE4901@nazgul.tnic \
    --to=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nicstange@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®