Re: [PATCH] x86/fred: Fix early boot failures on SEV-ES/SNP guests
From: Nikunj A. Dadhania
Date: Fri Feb 06 2026 - 07:13:04 EST
On 2/5/2026 9:40 PM, Dave Hansen wrote:
> On 2/4/26 21:10, Nikunj A Dadhania wrote:
> ...
>> --- a/arch/x86/entry/entry_fred.c
>> +++ b/arch/x86/entry/entry_fred.c
>> @@ -208,6 +208,11 @@ static noinstr void fred_hwexc(struct pt_regs *regs, unsigned long error_code)
>> #ifdef CONFIG_X86_CET
>> case X86_TRAP_CP: return exc_control_protection(regs, error_code);
>> #endif
>> + case X86_TRAP_VC:
>> + if (user_mode(regs))
>> + return user_exc_vmm_communication(regs, error_code);
>> + else
>> + return kernel_exc_vmm_communication(regs, error_code);
>> default: return fred_bad_type(regs, error_code);
>> }
>
> Please look at the code in the ~20 lines above this hunk. It has a nice,
> consistent form of:
>
> case X86_TRAP_FOO: return exc_foo_action(...);
>
> Could we keep that going, please?
There are couple of options, I will test and get back.
> Second, these functions are defined in arch/x86/coco/sev/vc-handle.c.
> That looks suspiciously like CONFIG_AMD_MEM_ENCRYPT code and not
> something that will compile everywhere. Also note the other features in
> the switch() block. See all the #ifdefs on those?
>
> Have you compiled this?
Compiled and tested. I missed testing without CONFIG_AMD_MEM_ENCRYPT, will add.
Regards,
Nikunj