mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: x86@kernel.org
Cc: Brijesh Singh <brijesh.singh@amd.com>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH v1 0/3] x86: SME: BSP/SME microcode update fix
Date: Thu, 07 Dec 2017 17:33:42 -0600	[thread overview]
Message-ID: <20171207233342.29646.12858.stgit@tlendack-t1.amdoffice.net> (raw)

This patch series addresses an issue when SME is active and the BSP
is attempting to check for and load microcode during load_ucode_bsp().
Since the initrd has not been decrypted (yet) and the virtual address
of the initrd treats the memory as encrypted, the CPIO archive parsing
fails to locate the microcode.

This series moves the encryption of the initrd into the early boot code
and encrypts it at the same time that the kernel is encrypted.  Since
the initrd is now encrypted, the CPIO archive parsing succeeds in
properly locating the microcode.

The following patches are included in this fix:
- Centralize the use of the PMD flags used in sme_encrypt_kernel() in
  preparation for using PTE flags also.
- Prepare sme_encrypt_kernel() to handle PAGE aligned encryption, not
  just 2MB large page aligned encryption.
- Encrypt the initrd in sme_encrypt_kernel() when the kernel is being
  encrypted.

This patch series is based on tip/master.

---

Tom Lendacky (3):
      x86/mm: Centralize PMD flags in sme_encrypt_kernel()
      x86/mm: Prepare sme_encrypt_kernel() for PAGE aligned encryption
      x86/mm: Encrypt the initrd earlier for BSP microcode update


 arch/x86/include/asm/mem_encrypt.h |    4 -
 arch/x86/kernel/head64.c           |    4 -
 arch/x86/kernel/setup.c            |   10 -
 arch/x86/mm/mem_encrypt.c          |  264 +++++++++++++++++++++++++++---------
 arch/x86/mm/mem_encrypt_boot.S     |   66 +++++----
 5 files changed, 243 insertions(+), 105 deletions(-)

-- 
Tom Lendacky

             reply	other threads:[~2017-12-07 23:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07 23:33 Tom Lendacky [this message]
2017-12-07 23:33 ` [PATCH v1 1/3] x86/mm: Centralize PMD flags in sme_encrypt_kernel() Tom Lendacky
2017-12-20 19:13   ` Borislav Petkov
2017-12-20 19:59     ` Tom Lendacky
2017-12-07 23:34 ` [PATCH v1 2/3] x86/mm: Prepare sme_encrypt_kernel() for PAGE aligned encryption Tom Lendacky
2017-12-21 12:58   ` Borislav Petkov
2017-12-21 16:35     ` Tom Lendacky
2017-12-07 23:34 ` [PATCH v1 3/3] x86/mm: Encrypt the initrd earlier for BSP microcode update Tom Lendacky
2017-12-21 14:49   ` Borislav Petkov
2017-12-21 16:48     ` Tom Lendacky
2017-12-21 17:13       ` 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=20171207233342.29646.12858.stgit@tlendack-t1.amdoffice.net \
    --to=thomas.lendacky@amd.com \
    --cc=bp@alien8.de \
    --cc=brijesh.singh@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.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®