Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1463977
| From | Borislav Petkov <bp@alien8.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [tip:x86/boot] x86/mm: Enable KASLR for physical mapping memory regions |
| Date | 2016-08-16 20:00 +0200 |
| Message-ID | <s6QOC-686-11@gated-at.bofh.it> (permalink) |
| References | (3 earlier) <s6d0R-6dM-1@gated-at.bofh.it> <s6KSS-2v8-27@gated-at.bofh.it> <s6MUF-3Kl-5@gated-at.bofh.it> <s6MUG-3Kl-11@gated-at.bofh.it> <s6OWu-4Xh-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, Aug 16, 2016 at 05:54:12PM +0200, Borislav Petkov wrote:
> Ok, I ran this in a guest and it finds the microcode patches properly.
Here's a better version to take care of the APs too:
---
diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
index 27a0228c9cae..05242322e324 100644
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c
@@ -355,6 +355,7 @@ void load_ucode_amd_ap(void)
unsigned int cpu = smp_processor_id();
struct equiv_cpu_entry *eq;
struct microcode_amd *mc;
+ u8 *cont;
u32 rev, eax;
u16 eq_id;
@@ -371,8 +372,12 @@ void load_ucode_amd_ap(void)
if (check_current_patch_level(&rev, false))
return;
+#ifdef CONFIG_RANDOMIZE_MEMORY
+ cont = container + PAGE_OFFSET - __PAGE_OFFSET_BASE;
+#endif
+
eax = cpuid_eax(0x00000001);
- eq = (struct equiv_cpu_entry *)(container + CONTAINER_HDR_SZ);
+ eq = (struct equiv_cpu_entry *)(cont + CONTAINER_HDR_SZ);
eq_id = find_equiv_id(eq, eax);
if (!eq_id)
@@ -434,6 +439,10 @@ int __init save_microcode_in_initrd_amd(void)
else
container = cont_va;
+#ifdef CONFIG_RANDOMIZE_MEMORY
+ container += PAGE_OFFSET - __PAGE_OFFSET_BASE;
+#endif
+
eax = cpuid_eax(0x00000001);
eax = ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff);
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
--
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [tip:x86/boot] x86/mm: Enable KASLR for physical mapping memory regions Brian Gerst <brgerst@gmail.com> - 2016-08-14 11:50 +0200
Re: [tip:x86/boot] x86/mm: Enable KASLR for physical mapping memory regions Baoquan He <bhe@redhat.com> - 2016-08-15 01:30 +0200
Re: [tip:x86/boot] x86/mm: Enable KASLR for physical mapping memory regions Brian Gerst <brgerst@gmail.com> - 2016-08-16 13:40 +0200
Re: [tip:x86/boot] x86/mm: Enable KASLR for physical mapping memory regions Borislav Petkov <bp@alien8.de> - 2016-08-16 15:50 +0200
Re: [tip:x86/boot] x86/mm: Enable KASLR for physical mapping memory regions Borislav Petkov <bp@alien8.de> - 2016-08-16 15:50 +0200
Re: [tip:x86/boot] x86/mm: Enable KASLR for physical mapping memory regions Borislav Petkov <bp@alien8.de> - 2016-08-16 18:00 +0200
Re: [tip:x86/boot] x86/mm: Enable KASLR for physical mapping memory regions Borislav Petkov <bp@alien8.de> - 2016-08-16 20:00 +0200
Re: [tip:x86/boot] x86/mm: Enable KASLR for physical mapping memory regions Kees Cook <keescook@chromium.org> - 2016-08-16 22:00 +0200
Re: [tip:x86/boot] x86/mm: Enable KASLR for physical mapping memory regions Borislav Petkov <bp@alien8.de> - 2016-08-16 23:20 +0200
Re: [tip:x86/boot] x86/mm: Enable KASLR for physical mapping memory regions Brian Gerst <brgerst@gmail.com> - 2016-08-17 02:40 +0200
Re: [tip:x86/boot] x86/mm: Enable KASLR for physical mapping memory regions Borislav Petkov <bp@alien8.de> - 2016-08-17 11:20 +0200
Re: [tip:x86/boot] x86/mm: Enable KASLR for physical mapping memory regions Ingo Molnar <mingo@kernel.org> - 2016-08-17 12:30 +0200
Re: [tip:x86/boot] x86/mm: Enable KASLR for physical mapping memory regions Borislav Petkov <bp@alien8.de> - 2016-08-17 13:40 +0200
[tip:x86/urgent] x86/microcode/AMD: Fix initrd loading with CONFIG_RANDOMIZE_MEMORY=y tip-bot for Borislav Petkov <tipbot@zytor.com> - 2016-08-18 13:00 +0200
csiph-web