[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH 3/9] plat/kvm: change entry point for x86



The linker script set the entry point for the linked ELF to the C entry
point. So far, this didn't matter, because QEMU boots the image via
multiboot, ignoring the entry point information and instead searching
for the multiboot header in the first 8k of the image. Firecracker,
however, does not use multiboot and identifies the entry from the ELF
header. So set the entry point to the beginning of the long-mode early
boot sequence.

Signed-off-by: Florian Schmidt <florian.schmidt@xxxxxxxxx>
---
 plat/kvm/Linker.uk        | 3 ++-
 plat/kvm/x86/link64.lds.S | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/plat/kvm/Linker.uk b/plat/kvm/Linker.uk
index d68f908e..9be40612 100644
--- a/plat/kvm/Linker.uk
+++ b/plat/kvm/Linker.uk
@@ -28,7 +28,8 @@ $(KVM_IMAGE): $(KVM_ALIBS) $(KVM_ALIBS-y) $(KVM_OLIBS) 
$(KVM_OLIBS-y) \
                        -Wl$(comma)--end-group \
                        -o $@.ld.o)
        $(call build_cmd,OBJCOPY,,$@.o,\
-              $(OBJCOPY) -w -G kvmos_* -G _libkvmplat_entry $@.ld.o $@.o)
+              $(OBJCOPY) -w -G kvmos_* -G _libkvmplat_entry \
+                       -G _libkvmplat_start64 $@.ld.o $@.o)
 ifneq ($(filter x86_64 arm64,$(CONFIG_UK_ARCH)),)
        $(call build_cmd,LD,,$@.dbg,\
               $(LD) $(LDFLAGS) $(LDFLAGS-y) \
diff --git a/plat/kvm/x86/link64.lds.S b/plat/kvm/x86/link64.lds.S
index 362ba3e6..181ce6ae 100644
--- a/plat/kvm/x86/link64.lds.S
+++ b/plat/kvm/x86/link64.lds.S
@@ -26,7 +26,7 @@
 #include <uk/arch/limits.h> /* for __PAGE_SIZE */
 #include <common.lds.h>
 
-ENTRY(_libkvmplat_entry)
+ENTRY(_libkvmplat_start64)
 SECTIONS
 {
        . = 0x100000;
-- 
2.21.0


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.