Re: [PATCH v2 2/2] x86/fred: Fix early boot failures on SEV-ES/SNP guests
From: Nikunj A. Dadhania
Date: Thu Feb 26 2026 - 23:25:08 EST
On 2/26/2026 7:44 PM, Tom Lendacky wrote:
> On 2/26/26 03:23, Nikunj A Dadhania wrote:
>> FRED-enabled SEV-ES and SNP guests fail to boot due to the following issues
>> in the early boot sequence:
>>
>> * FRED does not have a #VC exception handler in the dispatch logic
>>
>> * Early FRED #VC exceptions attempt to use uninitialized per-CPU GHCBs
>> instead of boot_ghcb
>>
>> Add X86_TRAP_VC case to fred_hwexc() with a new exc_vmm_communication()
>> function that provides the unified entry point FRED requires, dispatching
>> to existing user/kernel handlers based on privilege level. The function is
>> already declared via DECLARE_IDTENTRY_VC().
>>
>> Fix early GHCB access by falling back to boot_ghcb in
>> __sev_{get,put}_ghcb() when per-CPU GHCBs are not yet initialized.
>>
>> Fixes: 14619d912b65 ("x86/fred: FRED entry/exit and dispatch code")
>> Cc: stable@xxxxxxxxxxxxxxx # 6.9+
>> Signed-off-by: Nikunj A Dadhania <nikunj@xxxxxxx>
>
> Reviewed-by: Tom Lendacky <thomas.lendacky@xxxxxxx>
Thank you!
> Looking at the code, I think there are a couple of call sights that can
> be simplified now. Can you verify that? Then as a follow-on patch,
> replace the checks in arch/x86/coco/sev/core.c to just call
> __sev_{get,put}_ghcb() now (svsm_perform_call_protocol() and
> __set_pages_state())?
Sure, will send a follow-on patch.
Regards,
Nikunj