mirror of
git://git.yoctoproject.org/meta-virtualization.git
synced 2025-07-19 12:50:22 +02:00
xvisor: Initial commit of Xvisor Hypervisor
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> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
parent
3a7d446fa9
commit
eb80f0c0ba
|
@ -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
|
||||
|
25
recipes-extended/xvisor/xvisor-configs.inc
Normal file
25
recipes-extended/xvisor/xvisor-configs.inc
Normal file
|
@ -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)
|
44
recipes-extended/xvisor/xvisor_0.3.0.bb
Normal file
44
recipes-extended/xvisor/xvisor_0.3.0.bb
Normal file
|
@ -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"
|
Loading…
Reference in New Issue
Block a user