public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: X86 ML <x86@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Borislav Petkov <bp@suse.de>,
	Kim Naru <kim.naru@amd.com>, Thomas Renninger <trenn@suse.de>
Subject: [PATCH 0/4] x86, microcode, AMD: Fix early loading
Date: Fri,  6 Dec 2013 00:32:24 +0100	[thread overview]
Message-ID: <1386286348-5144-1-git-send-email-bp@alien8.de> (raw)

From: Borislav Petkov <bp@suse.de>

A couple of openSUSE bugzillas made me look at the early ucode loading
on AMD.

The problem is, we're doing memory allocation too early with IRQs
disabled and we really want to avoid that. Also, 32-bit has other
problems like calling rd/wrmsr*/cpuid functions at their virtual
addresses while paging is not enabled yet. Bah.

So, fix that by *always* using the initrd image handed in from the
bootloader and cache the ucode patches only late, right before the
initrd is jettisoned. This avoids the allocation issue completely. While
at it, take care of the 32-bit issues too.

Testing on 32-bit and 64-bit passes here.

@Kim: I'd appreciate it if you guys ran those patches too,
by creating an early ucode initrd as it is described in
Documentation/x86/early-microcode.txt.

Thanks.

Borislav Petkov (4):
  x86, ramdisk: Export relocated ramdisk VA
  x86, microcode: Share native MSR accessing variants
  x86, microcode, AMD: Fix early ucode loading
  x86, microcode: Move to a proper location

 arch/x86/include/asm/microcode.h                   |  15 ++
 arch/x86/include/asm/microcode_amd.h               |   7 +-
 arch/x86/include/asm/setup.h                       |   3 +-
 arch/x86/kernel/Makefile                           |   9 -
 arch/x86/kernel/cpu/Makefile                       |   1 +
 arch/x86/kernel/cpu/microcode/Makefile             |  11 +
 .../{microcode_amd.c => cpu/microcode/amd.c}       |  13 +-
 .../microcode/amd_early.c}                         | 239 ++++++++++++++-------
 .../{microcode_core.c => cpu/microcode/core.c}     |   0
 .../microcode/core_early.c}                        |   0
 .../{microcode_intel.c => cpu/microcode/intel.c}   |   0
 .../microcode/intel_early.c}                       |  10 -
 .../microcode/intel_lib.c}                         |   0
 arch/x86/kernel/setup.c                            |  19 +-
 14 files changed, 209 insertions(+), 118 deletions(-)
 create mode 100644 arch/x86/kernel/cpu/microcode/Makefile
 rename arch/x86/kernel/{microcode_amd.c => cpu/microcode/amd.c} (96%)
 rename arch/x86/kernel/{microcode_amd_early.c => cpu/microcode/amd_early.c} (55%)
 rename arch/x86/kernel/{microcode_core.c => cpu/microcode/core.c} (100%)
 rename arch/x86/kernel/{microcode_core_early.c => cpu/microcode/core_early.c} (100%)
 rename arch/x86/kernel/{microcode_intel.c => cpu/microcode/intel.c} (100%)
 rename arch/x86/kernel/{microcode_intel_early.c => cpu/microcode/intel_early.c} (98%)
 rename arch/x86/kernel/{microcode_intel_lib.c => cpu/microcode/intel_lib.c} (100%)

-- 
1.8.4


             reply	other threads:[~2013-12-05 23:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-05 23:32 Borislav Petkov [this message]
2013-12-05 23:32 ` [PATCH 1/4] x86, ramdisk: Export relocated ramdisk VA Borislav Petkov
2013-12-05 23:32 ` [PATCH 2/4] x86, microcode: Share native MSR accessing variants Borislav Petkov
2013-12-05 23:32 ` [PATCH 3/4] x86, microcode, AMD: Fix early ucode loading Borislav Petkov
2013-12-05 23:32 ` [PATCH 4/4] x86, microcode: Move to a proper location Borislav Petkov
2013-12-05 23:37   ` [PATCH -v1.1 " Borislav Petkov
2013-12-06 15:27 ` [PATCH 0/4] x86, microcode, AMD: Fix early loading Naru, Kim

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=1386286348-5144-1-git-send-email-bp@alien8.de \
    --to=bp@alien8.de \
    --cc=bp@suse.de \
    --cc=kim.naru@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trenn@suse.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