From: Sergiu Moga Date: Mon, 24 Apr 2023 05:42:49 +0000 (+0300) Subject: plat/kvm/x86: Add UEFI entry stub X-Git-Tag: RELEASE-0.14.0~75 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1eefc342d29121bd1e8f97ce7f4f62c083ecc26f;p=unikraft%2Funikraft.git plat/kvm/x86: Add UEFI entry stub Implements the small x86 specific UEFI entry point which will call the early self relocator, adjust the initially unaligned stack and finally jump to the architecture generic EFI stub. Signed-off-by: Sergiu Moga Reviewed-by: Michalis Pappas Approved-by: Razvan Deaconescu Tested-by: Unikraft CI GitHub-Closes: #909 --- diff --git a/plat/kvm/x86/efi_entry64.S b/plat/kvm/x86/efi_entry64.S new file mode 100644 index 000000000..4e184d372 --- /dev/null +++ b/plat/kvm/x86/efi_entry64.S @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright (c) 2023, Unikraft GmbH and The Unikraft Authors. + * Licensed under the BSD-3-Clause License (the "License"). + * You may not use this file except in compliance with the License. + */ +#include +#include + +.section .text +ENTRY(uk_efi_entry64) + /* EFI gives us a stack misaligned by 8 */ + and $~0xf, %rsp + + xorq %rdi, %rdi + xorq %rsi, %rsi + pushq %rdx + pushq %rcx + call do_uk_reloc + popq %rcx + popq %rdx + + call uk_efi_main + +uk_efi_fail: + hlt + jmp uk_efi_fail +END(uk_efi_entry64)