On 2/13/2023 7:31 PM, Dionna Amalie Glaze wrote:
I'm rather confused at the moment how our internal testing succeeds given the premise of the protocol is to use the specified behavior that the OS must call get_memory_map again if ebs fails with efi_invalid_parameter, but upstream does not appear to do this. If you're able to make progress by applying this patch to your linux build, then we might be back at square one, since the protocol's whole purpose is to work with older SEV-SNP kernels.diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c index a0bfd31358ba..795db2315f35 100644 --- a/drivers/firmware/efi/libstub/x86-stub.c +++ b/drivers/firmware/efi/libstub/x86-stub.c @@ -747,6 +747,18 @@ static efi_status_t exit_boot(struct boot_params *boot_params, void *handle) /* Might as well exit boot services now */ status = efi_exit_boot_services(handle, &priv, exit_boot_func); + /* + * EBS may fail once with INVALID_PARAMETER, which means the OS must call + * get_memory_map again and try EBS one more time. + */ + if (status == EFI_INVALID_PARAMETER) { + status = allocate_e820(boot_params, &e820ext, &e820ext_size); + if (status != EFI_SUCCESS) + return status; + + status = efi_exit_boot_services(handle, &priv, exit_boot_func); + } + if (status != EFI_SUCCESS) return status;
Not solving the issue. Now, getting 4 calls. See below: ConvertPages: range 1000000 - 41AEFFF covers multiple entries ConvertPages: range 1000000 - 41AEFFF covers multiple entries Accepting all memory Accepting all memory Accepting all memory Accepting all memory EFI stub: ERROR: exit_boot() failed! EFI stub: ERROR: efi_main() failed! StartImage failed: Invalid Parameter Thanks, Pankaj -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#100130): https://edk2.groups.io/g/devel/message/100130 Mute This Topic: https://groups.io/mt/96534752/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
