]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/kvm/x86: Add UEFI entry stub
authorSergiu Moga <sergiu.moga@protonmail.com>
Mon, 24 Apr 2023 05:42:49 +0000 (08:42 +0300)
committerUnikraft <monkey@unikraft.io>
Fri, 11 Aug 2023 10:47:30 +0000 (10:47 +0000)
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 <sergiu.moga@protonmail.com>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #909

plat/kvm/x86/efi_entry64.S [new file with mode: 0644]

diff --git a/plat/kvm/x86/efi_entry64.S b/plat/kvm/x86/efi_entry64.S
new file mode 100644 (file)
index 0000000..4e184d3
--- /dev/null
@@ -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 <uk/config.h>
+#include <uk/asm.h>
+
+.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)