Skip to content

x86/fred: Fix SEV-ES/SNP guest boot failures

Nikunj A Dadhania kvm lkml stable 3 versions – Applied

Status from this message: The following commit has been merged into the x86/urgent branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 12 repliesApplied
  2. v22 patches 33 repliesSuperseded
  3. v11 patch 24 repliesSuperseded

Changes in v3 from the cover letter

* Fix SNP guest boot failure reported by Borislav Petkov - the CR pinning disable patch exposed an implicit FSGSBASE dependency that is now fixed by moving FSGSBASE enablement to cpu_init_exception_handling() (Boris/Sohil)

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/3x86/cpu: Enable FSGSBASE early in cpu_init_exception_handling()arch/x86/kernel/cpu/common.c+12 -64 replies
2/3x86/cpu: Disable CR pinning during CPU bringuparch/x86/kernel/cpu/common.c+19 -49 replies
3/3x86/fred: Fix early boot failures on SEV-ES/SNP guestsarch/x86/coco/sev/noinstr.c arch/x86/entry/entry_fred.c+20 -00 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchSohil MehtaTom Lendacky
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/3] x86/fred: Fix SEV-ES/SNP guest boot failures

SEV-ES and SNP guests fail to boot when FRED is enabled due to missing #VC exception handling and a CR-pinning issue that prematurely enables FRED before its MSRs are configured.

Patch 1 fixes the implicit FSGSBASE dependency by moving FSGSBASE enablement to cpu_init_exception_handling(), ensuring it's enabled before exception handling infrastructure is set up on both boot and secondary CPUs.

Patch 2 fixes the CR-pinning issue by deferring enforcement during secondary CPU bringup, preventing FRED from being enabled before it is configured and able to handle exceptions.

Patch 3 adds #VC exception handling to FRED and fixes early GHCB access to use boot_ghcb before per-CPU GHCBs are initialized.

These fixes enable SEV-ES/SNP guests to boot successfully with FRED enabled.

Changelog:
v2 -> v3:
* Fix SNP guest boot failure reported by Borislav Petkov - the CR pinning disable patch exposed an implicit FSGSBASE dependency that is now fixed by moving FSGSBASE enablement to cpu_init_exception_handling() (Boris/Sohil)

v1 -> v2:
https://lore.kernel.org/kvm/[email protected]/
* Instead of moving pr_info(), fix the root cause by disabling CR pinning during secondary CPU bringup (Dave Hansen)
* Use unified #VC exception handler in fred_hwexc() (Dave Hansen)
* Collect RoB (Sohil Mehta)

v1: https://lore.kernel.org/kvm/[email protected]/

Dave Hansen (1):
x86/cpu: Disable CR pinning during CPU bringup

Nikunj A Dadhania (2):
x86/cpu: Enable FSGSBASE early in cpu_init_exception_handling() x86/fred: Fix early boot failures on SEV-ES/SNP guests

 arch/x86/coco/sev/noinstr.c  |  6 ++++++
 arch/x86/entry/entry_fred.c  | 14 ++++++++++++
 arch/x86/kernel/cpu/common.c | 41 +++++++++++++++++++++++++++---------
 3 files changed, 51 insertions(+), 10 deletions(-)

base-commit: 270b06a2452b0a20b149591ee90e22e3d8d55358

Signature · 1 line
2.48.1