All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] x86: SME: BSP/SME microcode update fix
@ 2018-01-10 19:25 Tom Lendacky
  2018-01-10 19:25 ` [PATCH v3 1/5] x86/mm: Cleanup register saving in mem_encrypt_boot.S Tom Lendacky
                   ` (6 more replies)
  0 siblings, 7 replies; 25+ messages in thread
From: Tom Lendacky @ 2018-01-10 19:25 UTC (permalink / raw)
  To: x86
  Cc: Brijesh Singh, linux-kernel, Ingo Molnar, Borislav Petkov,
	H. Peter Anvin, Thomas Gleixner

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:
- Cleanup register saving in arch/x86/mm/mem_encrypt_boot.S
- Reduce parameters and complexity for creating the SME PGD mappings
- 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.

---

Changes from v2:
- General code cleanup based on feedback.

Changes from v1:
- Additional patch to cleanup the register saving performed in
  arch/x86/mm/mem_encrypt_boot.S in prep for changes made in the
  remainder of the patchset.
- Additional patch to reduce parameters and complexity for creating the
  SME PGD mappings by introducing and using a structure for referencing
  the PGD to populate, the pagetable allocation area, the virtual/physical
  addresses being mapped and the pagetable flags to be used.
- Consolidate PMD/PTE mapping code to reduce duplication.

Tom Lendacky (5):
      x86/mm: Cleanup register saving in mem_encrypt_boot.S
      x86/mm: Use a struct to reduce parameters for SME PGD mapping
      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          |  356 ++++++++++++++++++++++++++----------
 arch/x86/mm/mem_encrypt_boot.S     |   80 ++++----
 5 files changed, 308 insertions(+), 146 deletions(-)

-- 
Tom Lendacky

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2018-01-19 17:15 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-10 19:25 [PATCH v3 0/5] x86: SME: BSP/SME microcode update fix Tom Lendacky
2018-01-10 19:25 ` [PATCH v3 1/5] x86/mm: Cleanup register saving in mem_encrypt_boot.S Tom Lendacky
2018-01-16  3:38   ` [tip:x86/urgent] x86/mm: Clean up register saving in the __enc_copy() assembly code tip-bot for Tom Lendacky
2018-01-10 19:26 ` [PATCH v3 2/5] x86/mm: Use a struct to reduce parameters for SME PGD mapping Tom Lendacky
2018-01-16  3:38   ` [tip:x86/urgent] " tip-bot for Tom Lendacky
2018-01-10 19:26 ` [PATCH v3 3/5] x86/mm: Centralize PMD flags in sme_encrypt_kernel() Tom Lendacky
2018-01-16  3:39   ` [tip:x86/urgent] " tip-bot for Tom Lendacky
2018-01-10 19:26 ` [PATCH v3 4/5] x86/mm: Prepare sme_encrypt_kernel() for PAGE aligned encryption Tom Lendacky
2018-01-16  3:39   ` [tip:x86/urgent] " tip-bot for Tom Lendacky
2018-01-10 19:26 ` [PATCH v3 5/5] x86/mm: Encrypt the initrd earlier for BSP microcode update Tom Lendacky
2018-01-16  3:40   ` [tip:x86/urgent] " tip-bot for Tom Lendacky
2018-01-10 21:14 ` [PATCH v3 0/5] x86: SME: BSP/SME microcode update fix Gabriel C
2018-01-10 21:26   ` Tom Lendacky
2018-01-10 22:20     ` Gabriel C
2018-01-11 18:33 ` Borislav Petkov
2018-01-15 22:47   ` Gabriel C
2018-01-19 15:03     ` Tom Lendacky
2018-01-19 15:11       ` Greg Kroah-Hartman
2018-01-19 15:27         ` Tom Lendacky
2018-01-19 15:35           ` Greg Kroah-Hartman
2018-01-19 15:38             ` Greg Kroah-Hartman
2018-01-19 15:56             ` Tom Lendacky
2018-01-19 16:02               ` Gabriel C
2018-01-19 17:15                 ` Tom Lendacky
2018-01-19 15:39           ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.