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

Re: [Minios-devel] [UNIKRAFT PATCH 4/9] plat/kvm: create separate linker script for QEMU and Firecracker


  • To: "minios-devel@xxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxx>
  • From: "Haibo Xu (Arm Technology China)" <Haibo.Xu@xxxxxxx>
  • Date: Mon, 14 Oct 2019 08:03:00 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v/CQ28vPNT4d0NOeXSuKTDLcPOnpf7zYFNVBYSxMezc=; b=UA62wZiOcHysMjMBVqLGUipr3xXjz+Ekp4WTPRA9YP4JHkKE/L3EFjCr7Z2FJp5oDEM+HzT7MSj8YGPXz6t/MD6J6aS+rqlpMtn+p9jnos5Dfhu7YDxz0144sBbWPvuOzuvN0p+tywHMSwu7YsEt0YlSQbTgLmY1dDlBbAz1U5vF8dCnxxqEzQQRKMyT/Wlc9PBAArb+om2D9r0W+L49t9k96A2Z+yUidI71GT5PVVxbQS44t3Geo9jrerGiHWL3G/jBdgcPZtO3A1L8vd2ojlMWdoVP83Te9ZYeVrYcvHuTJ/LcWu7dYbz0rKf7PImjTmW2XfcwJCFNScxWnaNg2Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UU5L9go7FWEJgIAdNjNhkF1VZT12UtQMx6gA506ng7FAtyYwxkqf4d1KxLTmSGbXdYy+qdkKcgjUId8IIg8ZRFCkHLkcgyZzhdL1Mg8sayp3M3jsLrYMVii1K/OvCEac+2AXKJh+AR1zRFoKgUWVVYY5pLEQlKNDBmc+HIspezn3/qe8asmcA4IC7jt9Q8S9CB2ieVrQL4rdcsqVxoqv31JIMrweFp4fSX0d0DUqtf9z9KCNYafq9VmmCBSTVv8TfztV0YY71kX9gHRE0W7eyPqcT/NiOL9ek/ajb7Fvg6QA5+hnAaauaNVfhM8HE/2+aEWLaFS6h7BEjZv/PgpE0Q==
  • Authentication-results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xen.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xen.org; dmarc=none action=none header.from=arm.com;
  • Authentication-results-original: spf=none (sender IP is ) smtp.mailfrom=Haibo.Xu@xxxxxxx;
  • Cc: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
  • Delivery-date: Mon, 14 Oct 2019 08:03:16 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Haibo.Xu@xxxxxxx;
  • Thread-index: AQHVgmXMfenlDnypc0qq5ycBil74BA==
  • Thread-topic: [Minios-devel] [UNIKRAFT PATCH 4/9] plat/kvm: create separate linker script for QEMU and Firecracker

This patch looks good except one typo in the commit message.

Reviewed-by: Haibo Xu <haibo.xu@xxxxxxx>

On 2019/6/3 22:56, Florian Schmidt wrote:
> The linker scripts are very similar, but we need to of them to support
> building both QEMU and Firecracker in one build run.

should be "but we need two of them"

>
> Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
> Signed-off-by: Florian Schmidt <florian.schmidt@xxxxxxxxx>
> ---
>  plat/kvm/Linker_fc.uk               | 67 +++++++++++++++++++++++++++++
>  plat/kvm/{Linker.uk => Linker_q.uk} | 41 ++++++++++--------
>  plat/kvm/Makefile.uk                | 42 +++++++++++++++---
>  3 files changed, 126 insertions(+), 24 deletions(-)
>  create mode 100644 plat/kvm/Linker_fc.uk
>  rename plat/kvm/{Linker.uk => Linker_q.uk} (50%)
>
> diff --git a/plat/kvm/Linker_fc.uk b/plat/kvm/Linker_fc.uk
> new file mode 100644
> index 00000000..992f6c86
> --- /dev/null
> +++ b/plat/kvm/Linker_fc.uk
> @@ -0,0 +1,67 @@
> +ifeq (x86_64,$(CONFIG_UK_ARCH))
> +KVMFC_LDFLAGS-y += -Wl,-m,elf_x86_64
> +else ifeq (arm64,$(CONFIG_UK_ARCH))
> +KVMFC_LDFLAGS-y       += -Wl,-m,aarch64elf
> +endif
> +
> +KVMFC_LDSCRIPT     := $(call src2lds,libkvmfcplat,$(KVM_LDSCRIPT_SRC-y))
> +
> +##
> +## Link image
> +##
> +KVMFC_IMAGE := $(BUILD_DIR)/$(CONFIG_UK_NAME)_kvmfc-$(CONFIG_UK_ARCH)
> +
> +KVMFC_LD_SCRIPT_FLAGS := $(addprefix -Wl$(comma)-T$(comma),\
> +                     $(KVMFC_LD_SCRIPT-y) $(EXTRA_LD_SCRIPT-y))
> +
> +$(KVMFC_IMAGE): $(KVM_ALIBS) $(KVM_ALIBS-y) $(KVM_OLIBS) $(KVM_OLIBS-y) \
> +              $(KVMFC_ALIBS) $(KVMFC_ALIBS-y) $(KVMFC_OLIBS) 
> $(KVMFC_OLIBS-y) \
> +              $(UK_ALIBS) $(UK_ALIBS-y) $(UK_OLIBS) $(UK_OLIBS-y) \
> +              $(KVMFC_LDSCRIPT)
> +     $(call build_cmd,LD,,$@.ld.o,\
> +            $(LD) -r $(LIBLDFLAGS) $(LIBLDFLAGS-y) \
> +                     $(KVMFC_LDFLAGS) $(KVMFC_LDFLAGS-y) \
> +                     $(KVM_OLIBS) $(KVM_OLIBS-y) \
> +                     $(KVMFC_OLIBS) $(KVMFC_OLIBS-y) \
> +                     $(UK_OLIBS) $(UK_OLIBS-y) \
> +                     -Wl$(comma)--start-group \
> +                     $(KVM_ALIBS) $(KVM_ALIBS-y) \
> +                     $(KVMFC_ALIBS) $(KVMFC_ALIBS-y) \
> +                     $(UK_ALIBS) $(UK_ALIBS-y) \
> +                     -Wl$(comma)--end-group \
> +                     -o $@.ld.o)
> +     $(call build_cmd,OBJCOPY,,$@.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) \
> +                  $(KVMFC_LDFLAGS) $(KVMFC_LDFLAGS-y) \
> +                  -Wl$(comma)-dT$(comma)$(call strip,$(KVMFC_LDSCRIPT)) \
> +                  $(KVMFC_LD_SCRIPT_FLAGS) \
> +                  $@.o -o $@.dbg)
> +     $(call verbose_cmd,SCSTRIP,$(notdir $@),\
> +             $(SCRIPTS_DIR)/sect-strip.py \
> +                     $(SECT_STRIP_FLAGS) $(SECT_STRIP_FLAGS-y) \
> +                     --with-objcopy=$(OBJCOPY) \
> +                     $@.dbg -o $@)
> +     $(call verbose_cmd,STRIP,$(notdir $@), $(STRIP) -s $@)
> +
> +ifeq ($(CONFIG_OPTIMIZE_SYMFILE),y)
> +     $(call build_cmd,NM,,$@.sym,\
> +            $(NM) -n $@.dbg > $@.sym)
> +endif
> +     $(call build_cmd,GZ,,$@.gz,\
> +            $(GZIP) -f -9 -c $@ >$@.gz)
> +endif
> +
> +# register image to the build
> +UK_IMAGES-$(CONFIG_KVM_VMM_FIRECRACKER) += $(KVMFC_IMAGE)
> +
> +# ...for cleaning:
> +LIBKVMFCPLAT_CLEAN += $(call build_clean,$(KVMFC_IMAGE))
> +LIBKVMFCPLAT_CLEAN += $(call build_clean,$(KVMFC_IMAGE).gz)
> +LIBKVMFCPLAT_CLEAN += $(call build_clean,$(KVMFC_IMAGE).dbg)
> +LIBKVMFCPLAT_CLEAN += $(call build_clean,$(KVMFC_IMAGE).sym)
> +LIBKVMFCPLAT_CLEAN += $(call build_clean,$(KVMFC_IMAGE).o)
> +LIBKVMFCPLAT_CLEAN += $(call build_clean,$(KVMFC_IMAGE).ld.o)
> diff --git a/plat/kvm/Linker.uk b/plat/kvm/Linker_q.uk
> similarity index 50%
> rename from plat/kvm/Linker.uk
> rename to plat/kvm/Linker_q.uk
> index 9be40612..a603b5d1 100644
> --- a/plat/kvm/Linker.uk
> +++ b/plat/kvm/Linker_q.uk
> @@ -1,29 +1,32 @@
>  ifeq (x86_64,$(CONFIG_UK_ARCH))
> -KVM_LDFLAGS-y += -Wl,-m,elf_x86_64
> +KVMQ_LDFLAGS-y += -Wl,-m,elf_x86_64
>  else ifeq (arm64,$(CONFIG_UK_ARCH))
> -KVM_LDFLAGS-y         += -Wl,-m,aarch64elf
> +KVMQ_LDFLAGS-y        += -Wl,-m,aarch64elf
>  endif
>
> -KVM_LDSCRIPT     := $(call src2lds,libkvmplat,$(KVM_LDSCRIPT_SRC-y))
> +KVMQ_LDSCRIPT     := $(call src2lds,libkvmqplat,$(KVM_LDSCRIPT_SRC-y))
>
>  ##
>  ## Link image
>  ##
> -KVM_IMAGE := $(BUILD_DIR)/$(CONFIG_UK_NAME)_kvm-$(CONFIG_UK_ARCH)
> +KVMQ_IMAGE := $(BUILD_DIR)/$(CONFIG_UK_NAME)_kvmq-$(CONFIG_UK_ARCH)
>
> -KVM_LD_SCRIPT_FLAGS := $(addprefix -Wl$(comma)-T$(comma),\
> -                     $(KVM_LD_SCRIPT-y) $(EXTRA_LD_SCRIPT-y))
> +KVMQ_LD_SCRIPT_FLAGS := $(addprefix -Wl$(comma)-T$(comma),\
> +                     $(KVMQ_LD_SCRIPT-y) $(EXTRA_LD_SCRIPT-y))
>
> -$(KVM_IMAGE): $(KVM_ALIBS) $(KVM_ALIBS-y) $(KVM_OLIBS) $(KVM_OLIBS-y) \
> +$(KVMQ_IMAGE): $(KVM_ALIBS) $(KVM_ALIBS-y) $(KVM_OLIBS) $(KVM_OLIBS-y) \
> +              $(KVMQ_ALIBS) $(KVMQ_ALIBS-y) $(KVMQ_OLIBS) $(KVMQ_OLIBS-y) \
>                $(UK_ALIBS) $(UK_ALIBS-y) $(UK_OLIBS) $(UK_OLIBS-y) \
> -              $(KVM_LDSCRIPT)
> +              $(KVMQ_LDSCRIPT)
>       $(call build_cmd,LD,,$@.ld.o,\
>              $(LD) -r $(LIBLDFLAGS) $(LIBLDFLAGS-y) \
> -                     $(KVM_LDFLAGS) $(KVM_LDFLAGS-y) \
> +                     $(KVMQ_LDFLAGS) $(KVMQ_LDFLAGS-y) \
>                       $(KVM_OLIBS) $(KVM_OLIBS-y) \
> +                     $(KVMQ_OLIBS) $(KVMQ_OLIBS-y) \
>                       $(UK_OLIBS) $(UK_OLIBS-y) \
>                       -Wl$(comma)--start-group \
>                       $(KVM_ALIBS) $(KVM_ALIBS-y) \
> +                     $(KVMQ_ALIBS) $(KVMQ_ALIBS-y) \
>                       $(UK_ALIBS) $(UK_ALIBS-y) \
>                       -Wl$(comma)--end-group \
>                       -o $@.ld.o)
> @@ -33,9 +36,9 @@ $(KVM_IMAGE): $(KVM_ALIBS) $(KVM_ALIBS-y) $(KVM_OLIBS) 
> $(KVM_OLIBS-y) \
>  ifneq ($(filter x86_64 arm64,$(CONFIG_UK_ARCH)),)
>       $(call build_cmd,LD,,$@.dbg,\
>              $(LD) $(LDFLAGS) $(LDFLAGS-y) \
> -                  $(KVM_LDFLAGS) $(KVM_LDFLAGS-y) \
> -                  -Wl$(comma)-dT$(comma)$(call strip,$(KVM_LDSCRIPT)) \
> -                  $(KVM_LD_SCRIPT_FLAGS) \
> +                  $(KVMQ_LDFLAGS) $(KVMQ_LDFLAGS-y) \
> +                  -Wl$(comma)-dT$(comma)$(call strip,$(KVMQ_LDSCRIPT)) \
> +                  $(KVMQ_LD_SCRIPT_FLAGS) \
>                    $@.o -o $@.dbg)
>       $(call verbose_cmd,SCSTRIP,$(notdir $@),\
>               $(SCRIPTS_DIR)/sect-strip.py \
> @@ -53,12 +56,12 @@ endif
>  endif
>
>  # register image to the build
> -UK_IMAGES-$(CONFIG_PLAT_KVM) += $(KVM_IMAGE)
> +UK_IMAGES-$(CONFIG_KVM_VMM_QEMU) += $(KVMQ_IMAGE)
>
>  # ...for cleaning:
> -LIBKVMPLAT_CLEAN += $(call build_clean,$(KVM_IMAGE))
> -LIBKVMPLAT_CLEAN += $(call build_clean,$(KVM_IMAGE).gz)
> -LIBKVMPLAT_CLEAN += $(call build_clean,$(KVM_IMAGE).dbg)
> -LIBKVMPLAT_CLEAN += $(call build_clean,$(KVM_IMAGE).sym)
> -LIBKVMPLAT_CLEAN += $(call build_clean,$(KVM_IMAGE).o)
> -LIBKVMPLAT_CLEAN += $(call build_clean,$(KVM_IMAGE).ld.o)
> +LIBKVMQPLAT_CLEAN += $(call build_clean,$(KVMQ_IMAGE))
> +LIBKVMQPLAT_CLEAN += $(call build_clean,$(KVMQ_IMAGE).gz)
> +LIBKVMQPLAT_CLEAN += $(call build_clean,$(KVMQ_IMAGE).dbg)
> +LIBKVMQPLAT_CLEAN += $(call build_clean,$(KVMQ_IMAGE).sym)
> +LIBKVMQPLAT_CLEAN += $(call build_clean,$(KVMQ_IMAGE).o)
> +LIBKVMQPLAT_CLEAN += $(call build_clean,$(KVMQ_IMAGE).ld.o)
> diff --git a/plat/kvm/Makefile.uk b/plat/kvm/Makefile.uk
> index 633348ab..9516c58d 100644
> --- a/plat/kvm/Makefile.uk
> +++ b/plat/kvm/Makefile.uk
> @@ -1,15 +1,30 @@
>  ##
>  ## KVM platform registration
>  ##
> -$(eval $(call addplat_s,kvm,$(CONFIG_PLAT_KVM)))
> +$(eval $(call addplat_s,kvmq,$(CONFIG_KVM_VMM_QEMU)))
> +UK_PLAT_KVMQ_LINKER := $(UK_PLAT_KVMQ_BASE)/Linker_q.uk
> +$(eval $(call addplat_s,kvmfc,$(CONFIG_KVM_VMM_FIRECRACKER)))
> +UK_PLAT_KVMFC_LINKER := $(UK_PLAT_KVMFC_BASE)/Linker_fc.uk
> +
> +##
> +## Populate LIBKVMPLAT_BASE for common files
> +##
> +ifeq ($(CONFIG_KVM_VMM_QEMU),y)
> +LIBKVMPLAT_BASE := $(UK_PLAT_KVMQ_BASE)
> +else ifeq ($(CONFIG_KVM_VMM_FIRECRACKER),y)
> +LIBKVMPLAT_BASE := $(UK_PLAT_KVMFC_BASE)
> +endif
>
>  ##
>  ## KVM platform library registration
>  ##
> -$(eval $(call addplatlib,kvm,libkvmplat))
> -$(eval $(call addplatlib_s,kvm,libkvmpci,$(CONFIG_KVM_PCI)))
> -$(eval $(call addplatlib_s,kvm,libkvmvirtio,$(CONFIG_VIRTIO_BUS)))
> -$(eval $(call addplatlib_s,kvm,libkvmvirtionet,$(CONFIG_VIRTIO_NET)))
> +$(eval $(call addplatlib,kvmq,libkvmqplat,$(CONFIG_KVM_VMM_QEMU)))
> +$(eval $(call addplatlib,kvmfc,libkvmfcplat,$(CONFIG_KVM_VMM_FIRECRACKER)))
> +$(eval $(call addplatlib_s,kvmq,libkvmpci,$(CONFIG_KVM_PCI)))
> +$(eval $(call addplatlib_s,kvmq,libkvmvirtio,$(CONFIG_VIRTIO_BUS)))
> +$(eval $(call addplatlib_s,kvmfc,libkvmvirtio,$(CONFIG_VIRTIO_BUS)))
> +$(eval $(call addplatlib_s,kvmq,libkvmvirtionet,$(CONFIG_VIRTIO_NET)))
> +$(eval $(call addplatlib_s,kvmfc,libkvmvirtionet,$(CONFIG_VIRTIO_NET)))
>
>  ##
>  ## Platform library definitions
> @@ -80,6 +95,23 @@ LIBKVMPLAT_SRCS-y              += 
> $(UK_PLAT_COMMON_BASE)/lcpu.c|common
>  LIBKVMPLAT_SRCS-y              += $(UK_PLAT_COMMON_BASE)/memory.c|common
>  LIBKVMPLAT_SRCS-y              += $(KVM_LDSCRIPT_SRC-y)
>
> +ifeq ($(CONFIG_KVM_VMM_QEMU),y)
> +LIBKVMQPLAT_SRCS-y        := $(LIBKVMPLAT_SRCS-y)
> +LIBKVMQPLAT_ASINCLUDES-y  := $(LIBKVMPLAT_ASINCLUDES-y)
> +LIBKVMQPLAT_CINCLUDES-y   := $(LIBKVMPLAT_CINCLUDES-y)
> +LIBKVMQPLAT_ASFLAGS       := $(LIBKVMPLAT_ASFLAGS) -DKVMQPLAT
> +LIBKVMQPLAT_CFLAGS        := $(LIBKVMPLAT_CFLAGS) -DKVMQPLAT
> +LIBKVMQPLAT_CXXFLAGS      := $(LIBKVMPLAT_CXXFLAGS) -DKVMQPLAT
> +endif
> +ifeq ($(CONFIG_KVM_VMM_FIRECRACKER),y)
> +LIBKVMFCPLAT_SRCS-y        := $(LIBKVMPLAT_SRCS-y)
> +LIBKVMFCPLAT_ASINCLUDES-y  := $(LIBKVMPLAT_ASINCLUDES-y)
> +LIBKVMFCPLAT_CINCLUDES-y   := $(LIBKVMPLAT_CINCLUDES-y)
> +LIBKVMFCPLAT_ASFLAGS       := $(LIBKVMPLAT_ASFLAGS) -DKVMFCPLAT
> +LIBKVMFCPLAT_CFLAGS        := $(LIBKVMPLAT_CFLAGS) -DKVMFCPLAT
> +LIBKVMFCPLAT_CXXFLAGS      := $(LIBKVMPLAT_CXXFLAGS) -DKVMFCPLAT
> +endif
> +
>  ##
>  ## PCI library definitions
>  ##
>
IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
_______________________________________________
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®.