From: "Bruce Ashfield" <bruce.ashfield@gmail.com>
To: Alistair Francis <alistair.francis@wdc.com>
Cc: meta-virtualization@lists.yoctoproject.org, alistair23@gmail.com
Subject: Re: [PATCH] xvisor: Initial commit of Xvisor Hypervisor
Date: Tue, 11 Feb 2020 16:04:36 -0500 [thread overview]
Message-ID: <20200211210433.GA36395@gmail.com> (raw)
In-Reply-To: <20200203215011.6642-2-alistair.francis@wdc.com>
In message: [PATCH] xvisor: Initial commit of Xvisor Hypervisor
on 03/02/2020 Alistair Francis wrote:
> This commit adds support for building the baremetal Xvisor Hypervisor.
>
> I have only tested this with RISC-V so currently only RISC-V is marked
> as a COMPATIBLE_HOST, although Xvisor does support multiple other
> architectures.
>
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
> ...n-t-specify-mabi-or-march-for-RISC-V.patch | 34 ++++++++++++++
> recipes-extended/xvisor/xvisor-configs.inc | 25 +++++++++++
> recipes-extended/xvisor/xvisor_0.3.0.bb | 44 +++++++++++++++++++
> 3 files changed, 103 insertions(+)
> create mode 100644 recipes-extended/xvisor/files/0001-TESTS-Don-t-specify-mabi-or-march-for-RISC-V.patch
> create mode 100644 recipes-extended/xvisor/xvisor-configs.inc
> create mode 100644 recipes-extended/xvisor/xvisor_0.3.0.bb
>
> diff --git a/recipes-extended/xvisor/files/0001-TESTS-Don-t-specify-mabi-or-march-for-RISC-V.patch b/recipes-extended/xvisor/files/0001-TESTS-Don-t-specify-mabi-or-march-for-RISC-V.patch
> new file mode 100644
> index 0000000..2e53943
> --- /dev/null
> +++ b/recipes-extended/xvisor/files/0001-TESTS-Don-t-specify-mabi-or-march-for-RISC-V.patch
> @@ -0,0 +1,34 @@
> +From 022c885d077dce6fad3eca5fd2f54b2070c375d2 Mon Sep 17 00:00:00 2001
> +From: Alistair Francis <alistair.francis@wdc.com>
> +Date: Fri, 17 May 2019 14:21:44 -0700
> +Subject: [PATCH] TESTS: Don't specify mabi or march for RISC-V
> +
> +To avoid
> + can't link double-float modules with soft-float modules
> +errors when building 32-bit baremetal guests don't specify mabi
> +or march.
> +
> +Upstream-Status: Inappropriate [Fixes a 32-bit Yocto flow bug]
> +Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> +---
> + tests/riscv/common/basic/Makefile.inc | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/tests/riscv/common/basic/Makefile.inc b/tests/riscv/common/basic/Makefile.inc
> +index 9fa5abed..f3ff1864 100644
> +--- a/tests/riscv/common/basic/Makefile.inc
> ++++ b/tests/riscv/common/basic/Makefile.inc
> +@@ -24,8 +24,8 @@
> + ARCH_CPPFLAGS=$(board_cppflags) -DFIRMWARE_BOOT
> + ARCH_CPPFLAGS+=-DTEXT_START=$(board_text_start)
> + ifeq ($(board_32bit),y)
> +-ARCH_CFLAGS=$(board_cflags) -fno-omit-frame-pointer -fno-optimize-sibling-calls -mno-save-restore -mstrict-align -mabi=ilp32 -march=rv32imafdc -mcmodel=medany
> +-ARCH_ASFLAGS=$(board_asflags) -fno-omit-frame-pointer -fno-optimize-sibling-calls -mno-save-restore -mstrict-align -mabi=ilp32 -march=rv32imafdc -mcmodel=medany
> ++ARCH_CFLAGS=$(board_cflags) -fno-omit-frame-pointer -fno-optimize-sibling-calls -mno-save-restore -mstrict-align -mcmodel=medany
> ++ARCH_ASFLAGS=$(board_asflags) -fno-omit-frame-pointer -fno-optimize-sibling-calls -mno-save-restore -mstrict-align -mcmodel=medany
> + else
> + ARCH_CFLAGS=$(board_cflags) -fno-omit-frame-pointer -fno-optimize-sibling-calls -mno-save-restore -mstrict-align -mabi=lp64 -march=rv64imafdc -mcmodel=medany
> + ARCH_ASFLAGS=$(board_asflags) -fno-omit-frame-pointer -fno-optimize-sibling-calls -mno-save-restore -mstrict-align -mabi=lp64 -march=rv64imafdc -mcmodel=medany
> +--
> +2.21.0
> +
> diff --git a/recipes-extended/xvisor/xvisor-configs.inc b/recipes-extended/xvisor/xvisor-configs.inc
> new file mode 100644
> index 0000000..099128d
> --- /dev/null
> +++ b/recipes-extended/xvisor/xvisor-configs.inc
> @@ -0,0 +1,25 @@
> +def get_oemake_config(d):
> + plat = d.getVar('XVISOR_PLAT')
> +
> + if plat is None:
> + return ""
> +
> + if 'riscv/virt32' in plat:
> + return "generic-32b-defconfig"
> + if 'riscv/virt64' in plat:
> + return "generic-64b-defconfig"
> +
> + return ""
> +
> +def map_xvisor_arch(a, d):
> + import re
> +
> + if re.match('(i.86|x86.64)$', a): return 'x86'
> + elif re.match('armeb$', a): return 'arm'
> + elif re.match('aarch64$', a): return 'arm'
> + elif re.match('aarch64_be$', a): return 'arm'
> + elif re.match('aarch64_ilp32$', a): return 'arm'
> + elif re.match('aarch64_be_ilp32$', a): return 'arm'
> + elif re.match('riscv(32|64|)(eb|)$', a): return 'riscv'
> + else:
> + bb.error("cannot map '%s' to a Xvisor architecture" % a)
This all looks fine to me (for the 1st revision), I did wonder if the
mappings are any different than the kernel mappings (but didn't check) ..
and if so, we could avoid the code to map the arch.
It would also be nice to eventually have a README or some other test
information captured in the layer, that way people can have an idea
about why they'd want to use this, some expected behaviour and how
they can boot it.
Bruce
> diff --git a/recipes-extended/xvisor/xvisor_0.3.0.bb b/recipes-extended/xvisor/xvisor_0.3.0.bb
> new file mode 100644
> index 0000000..66ad618
> --- /dev/null
> +++ b/recipes-extended/xvisor/xvisor_0.3.0.bb
> @@ -0,0 +1,44 @@
> +SUMMARY = "Xvisor is an open-source type-1 hypervisor, which aims at providing a monolithic, light-weight, portable, and flexible virtualization solution."
> +DESCRIPTION = "Xvisor primarily supports Full virtualization hence, supports a wide range of unmodified guest operating systems. Paravirtualization is optional for Xvisor and will be supported in an architecture independent manner (such as VirtIO PCI/MMIO devices) to ensure no-change in guest OS for using paravirtualization."
> +LICENSE = "GPLv2"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
> +DEPENDS += "dtc-native dosfstools-native mtools-native"
> +
> +require xvisor-configs.inc
> +
> +inherit autotools-brokensep
> +
> +SRCREV = "58592ef18c71526a0045935d1e8eed5e8553b7d6"
> +SRC_URI = "git://github.com/xvisor/xvisor.git \
> + file://0001-TESTS-Don-t-specify-mabi-or-march-for-RISC-V.patch \
> + "
> +
> +S = "${WORKDIR}/git"
> +
> +EXTRA_OEMAKE += "ARCH=\"${@map_xvisor_arch(d.getVar('TARGET_ARCH'), d)}\" I=${D}"
> +
> +CONFIG = "${@get_oemake_config(d)}"
> +
> +do_configure() {
> + oe_runmake ${CONFIG}
> +}
> +
> +do_install_append() {
> + install -d ${D}
> + install -m 755 ${B}/build/vmm.* ${D}/
> +
> + # We don't need this
> + rm ${D}/system.map
> +}
> +
> +do_deploy () {
> + install -d ${DEPLOY_DIR_IMAGE}
> + install -m 755 ${D}/vmm.* ${DEPLOY_DIR_IMAGE}/
> +}
> +
> +addtask deploy after do_install
> +
> +FILES_${PN} += "/vmm.*"
> +
> +COMPATIBLE_HOST = "(riscv64|riscv32).*"
> +INHIBIT_PACKAGE_STRIP = "1"
> --
> 2.25.0
>
next prev parent reply other threads:[~2020-02-11 21:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-03 21:50 [meta-virtualization][PATCH] xvisor: Initial commit of Xvisor Hypervisor Alistair Francis
2020-02-03 21:50 ` [PATCH] " Alistair Francis
2020-02-11 21:04 ` Bruce Ashfield [this message]
2020-03-03 17:47 ` Alistair Francis
2020-03-04 0:27 ` Bruce Ashfield
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200211210433.GA36395@gmail.com \
--to=bruce.ashfield@gmail.com \
--cc=alistair.francis@wdc.com \
--cc=alistair23@gmail.com \
--cc=meta-virtualization@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.