* [PATCH 2/4] xvisor-image-minimal: Initial commit of a Xvisor image
2020-08-13 22:08 [PATCH 1/4] xvisor: Bump to a git release Alistair Francis
@ 2020-08-13 22:08 ` Alistair Francis
2020-08-13 22:08 ` [PATCH 3/4] xvisor: Add support for building AArch64 Alistair Francis
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Alistair Francis @ 2020-08-13 22:08 UTC (permalink / raw)
To: meta-virtualization
Cc: christopher.w.clark, bruce.ashfield, alistair23, Alistair Francis
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
.../images/xvisor-image-minimal.bb | 20 +++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 recipes-extended/images/xvisor-image-minimal.bb
diff --git a/recipes-extended/images/xvisor-image-minimal.bb b/recipes-extended/images/xvisor-image-minimal.bb
new file mode 100644
index 0000000..4c4a2fc
--- /dev/null
+++ b/recipes-extended/images/xvisor-image-minimal.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "A minimal Xvisor image"
+
+INITRD_IMAGE = "core-image-minimal-initramfs"
+
+IMAGE_INSTALL += " \
+ packagegroup-core-boot \
+ packagegroup-core-ssh-openssh \
+ "
+
+# The hypervisor may not be within the dom0 filesystem image but at least
+# ensure that it is deployable:
+do_build[depends] += "xvisor:do_deploy"
+
+LICENSE = "MIT"
+
+inherit core-image
+
+# Enable runqemu. eg: runqemu xvisor-image-minimal nographic slirp
+QB_DEFAULT_KERNEL = "vmm.bin"
+QB_OPT_APPEND_append_riscv64 = " -cpu rv64,x-h=true "
--
2.27.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 3/4] xvisor: Add support for building AArch64
2020-08-13 22:08 [PATCH 1/4] xvisor: Bump to a git release Alistair Francis
2020-08-13 22:08 ` [PATCH 2/4] xvisor-image-minimal: Initial commit of a Xvisor image Alistair Francis
@ 2020-08-13 22:08 ` Alistair Francis
2020-08-13 22:08 ` [PATCH 4/4] docs: Add initial Xvisor doc Alistair Francis
2020-08-17 1:19 ` [PATCH 1/4] xvisor: Bump to a git release Bruce Ashfield
3 siblings, 0 replies; 5+ messages in thread
From: Alistair Francis @ 2020-08-13 22:08 UTC (permalink / raw)
To: meta-virtualization
Cc: christopher.w.clark, bruce.ashfield, alistair23, Alistair Francis
Add support for building for AArch64, also remove the requirement to
specify a platform.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
recipes-extended/xvisor/xvisor-configs.inc | 22 +++++++++++-----------
recipes-extended/xvisor/xvisor_git.bb | 9 +++++++--
2 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/recipes-extended/xvisor/xvisor-configs.inc b/recipes-extended/xvisor/xvisor-configs.inc
index 099128d..f53bba2 100644
--- a/recipes-extended/xvisor/xvisor-configs.inc
+++ b/recipes-extended/xvisor/xvisor-configs.inc
@@ -1,15 +1,15 @@
-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"
+def get_oemake_config(a, d):
+ import re
- return ""
+ if re.match('armeb$', a): return 'generic-v7-defconfig'
+ elif re.match('aarch64$', a): return 'generic-v8-defconfig'
+ elif re.match('aarch64_be$', a): return 'generic-v8-defconfig'
+ elif re.match('aarch64_ilp32$', a): return 'generic-v8-defconfig'
+ elif re.match('aarch64_be_ilp32$', a): return 'generic-v8-defconfig'
+ elif re.match('riscv32(eb|)$', a): return 'generic-32b-defconfig'
+ elif re.match('riscv64(eb|)$', a): return 'generic-64b-defconfig'
+ else:
+ bb.error("cannot map '%s' to a Xvisor defconfig" % a)
def map_xvisor_arch(a, d):
import re
diff --git a/recipes-extended/xvisor/xvisor_git.bb b/recipes-extended/xvisor/xvisor_git.bb
index 45a7baf..64b0f22 100644
--- a/recipes-extended/xvisor/xvisor_git.bb
+++ b/recipes-extended/xvisor/xvisor_git.bb
@@ -18,7 +18,7 @@ S = "${WORKDIR}/git"
EXTRA_OEMAKE += "ARCH=\"${@map_xvisor_arch(d.getVar('TARGET_ARCH'), d)}\" I=${D}"
-CONFIG = "${@get_oemake_config(d)}"
+CONFIG = "${@get_oemake_config(d.getVar('TARGET_ARCH'), d)}"
do_configure() {
oe_runmake ${CONFIG}
@@ -35,11 +35,16 @@ do_install_append() {
do_deploy () {
install -d ${DEPLOY_DIR_IMAGE}
install -m 755 ${D}/vmm.* ${DEPLOY_DIR_IMAGE}/
+
+ if [[ -f "${D}/*.dtb" ]]; then
+ install -m 755 ${D}/*.dtb ${DEPLOY_DIR_IMAGE}/
+ fi
}
addtask deploy after do_install
FILES_${PN} += "/vmm.*"
+FILES_${PN} += "/*.dtb"
-COMPATIBLE_HOST = "(riscv64|riscv32).*"
+COMPATIBLE_HOST = "(aarch64|riscv64|riscv32).*"
INHIBIT_PACKAGE_STRIP = "1"
--
2.27.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 4/4] docs: Add initial Xvisor doc
2020-08-13 22:08 [PATCH 1/4] xvisor: Bump to a git release Alistair Francis
2020-08-13 22:08 ` [PATCH 2/4] xvisor-image-minimal: Initial commit of a Xvisor image Alistair Francis
2020-08-13 22:08 ` [PATCH 3/4] xvisor: Add support for building AArch64 Alistair Francis
@ 2020-08-13 22:08 ` Alistair Francis
2020-08-17 1:19 ` [PATCH 1/4] xvisor: Bump to a git release Bruce Ashfield
3 siblings, 0 replies; 5+ messages in thread
From: Alistair Francis @ 2020-08-13 22:08 UTC (permalink / raw)
To: meta-virtualization
Cc: christopher.w.clark, bruce.ashfield, alistair23, Alistair Francis
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
docs/00-INDEX | 3 +++
docs/xvisor.txt | 16 ++++++++++++++++
2 files changed, 19 insertions(+)
create mode 100644 docs/xvisor.txt
diff --git a/docs/00-INDEX b/docs/00-INDEX
index a2ffd99..5aa1b3c 100644
--- a/docs/00-INDEX
+++ b/docs/00-INDEX
@@ -10,3 +10,6 @@ alphabetical order as well.
openvswitch.txt
- example on how to setup openvswitch with qemu/kvm.
+
+xvisor.txt
+ - example on how to setup Xvisor for RISC-V QEMU.
diff --git a/docs/xvisor.txt b/docs/xvisor.txt
new file mode 100644
index 0000000..6f31f22
--- /dev/null
+++ b/docs/xvisor.txt
@@ -0,0 +1,16 @@
+Simple setup for starting Xvisor on RISC-V QEMU
+===============================================
+
+This is a simple starting point for running Xvisor on RISC-V QEMU.
+
+Currently meta-virtualisation supports running Xvisor on QEMU using the v0.5.0 RISC-V Hypervisor extensions.
+
+Support is still experimental.
+
+Build the images
+================
+$ MACHINE=qemuriscv64 bitbake xvisor-image-minimal
+
+Run the images
+==============
+$ MACHINE=qemuriscv64 runqemu xvisor-image-minimal slirp nographic
--
2.27.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/4] xvisor: Bump to a git release
2020-08-13 22:08 [PATCH 1/4] xvisor: Bump to a git release Alistair Francis
` (2 preceding siblings ...)
2020-08-13 22:08 ` [PATCH 4/4] docs: Add initial Xvisor doc Alistair Francis
@ 2020-08-17 1:19 ` Bruce Ashfield
3 siblings, 0 replies; 5+ messages in thread
From: Bruce Ashfield @ 2020-08-17 1:19 UTC (permalink / raw)
To: Alistair Francis; +Cc: meta-virtualization, christopher.w.clark, alistair23
Thanks Alistair,
Looks good to me, in particular the starting of the doc with the
instructions.
This is now merged.
Bruce
In message: [PATCH 1/4] xvisor: Bump to a git release
on 13/08/2020 Alistair Francis wrote:
> Bump the Xvisor SHA to a git release with RISC-V 0.5.0 Hypversior
> extension support.
>
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
> recipes-extended/xvisor/{xvisor_0.3.0.bb => xvisor_git.bb} | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
> rename recipes-extended/xvisor/{xvisor_0.3.0.bb => xvisor_git.bb} (88%)
>
> diff --git a/recipes-extended/xvisor/xvisor_0.3.0.bb b/recipes-extended/xvisor/xvisor_git.bb
> similarity index 88%
> rename from recipes-extended/xvisor/xvisor_0.3.0.bb
> rename to recipes-extended/xvisor/xvisor_git.bb
> index 66ad618..45a7baf 100644
> --- a/recipes-extended/xvisor/xvisor_0.3.0.bb
> +++ b/recipes-extended/xvisor/xvisor_git.bb
> @@ -8,8 +8,9 @@ require xvisor-configs.inc
>
> inherit autotools-brokensep
>
> -SRCREV = "58592ef18c71526a0045935d1e8eed5e8553b7d6"
> -SRC_URI = "git://github.com/xvisor/xvisor.git \
> +# This version support the RISC-V v0.5.0 Hypervisor extensions
> +SRCREV = "b3dac5b1f61f23f21dc59b3880897cff78f3b618"
> +SRC_URI = "git://github.com/avpatel/xvisor-next.git \
> file://0001-TESTS-Don-t-specify-mabi-or-march-for-RISC-V.patch \
> "
>
> --
> 2.27.0
>
In message: [meta-virtualization] [PATCH 4/4] docs: Add initial Xvisor doc
on 13/08/2020 Alistair Francis wrote:
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
> docs/00-INDEX | 3 +++
> docs/xvisor.txt | 16 ++++++++++++++++
> 2 files changed, 19 insertions(+)
> create mode 100644 docs/xvisor.txt
>
> diff --git a/docs/00-INDEX b/docs/00-INDEX
> index a2ffd99..5aa1b3c 100644
> --- a/docs/00-INDEX
> +++ b/docs/00-INDEX
> @@ -10,3 +10,6 @@ alphabetical order as well.
>
> openvswitch.txt
> - example on how to setup openvswitch with qemu/kvm.
> +
> +xvisor.txt
> + - example on how to setup Xvisor for RISC-V QEMU.
> diff --git a/docs/xvisor.txt b/docs/xvisor.txt
> new file mode 100644
> index 0000000..6f31f22
> --- /dev/null
> +++ b/docs/xvisor.txt
> @@ -0,0 +1,16 @@
> +Simple setup for starting Xvisor on RISC-V QEMU
> +===============================================
> +
> +This is a simple starting point for running Xvisor on RISC-V QEMU.
> +
> +Currently meta-virtualisation supports running Xvisor on QEMU using the v0.5.0 RISC-V Hypervisor extensions.
> +
> +Support is still experimental.
> +
> +Build the images
> +================
> +$ MACHINE=qemuriscv64 bitbake xvisor-image-minimal
> +
> +Run the images
> +==============
> +$ MACHINE=qemuriscv64 runqemu xvisor-image-minimal slirp nographic
> --
> 2.27.0
>
>
In message: [PATCH 3/4] xvisor: Add support for building AArch64
on 13/08/2020 Alistair Francis wrote:
> Add support for building for AArch64, also remove the requirement to
> specify a platform.
>
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
> recipes-extended/xvisor/xvisor-configs.inc | 22 +++++++++++-----------
> recipes-extended/xvisor/xvisor_git.bb | 9 +++++++--
> 2 files changed, 18 insertions(+), 13 deletions(-)
>
> diff --git a/recipes-extended/xvisor/xvisor-configs.inc b/recipes-extended/xvisor/xvisor-configs.inc
> index 099128d..f53bba2 100644
> --- a/recipes-extended/xvisor/xvisor-configs.inc
> +++ b/recipes-extended/xvisor/xvisor-configs.inc
> @@ -1,15 +1,15 @@
> -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"
> +def get_oemake_config(a, d):
> + import re
>
> - return ""
> + if re.match('armeb$', a): return 'generic-v7-defconfig'
> + elif re.match('aarch64$', a): return 'generic-v8-defconfig'
> + elif re.match('aarch64_be$', a): return 'generic-v8-defconfig'
> + elif re.match('aarch64_ilp32$', a): return 'generic-v8-defconfig'
> + elif re.match('aarch64_be_ilp32$', a): return 'generic-v8-defconfig'
> + elif re.match('riscv32(eb|)$', a): return 'generic-32b-defconfig'
> + elif re.match('riscv64(eb|)$', a): return 'generic-64b-defconfig'
> + else:
> + bb.error("cannot map '%s' to a Xvisor defconfig" % a)
>
> def map_xvisor_arch(a, d):
> import re
> diff --git a/recipes-extended/xvisor/xvisor_git.bb b/recipes-extended/xvisor/xvisor_git.bb
> index 45a7baf..64b0f22 100644
> --- a/recipes-extended/xvisor/xvisor_git.bb
> +++ b/recipes-extended/xvisor/xvisor_git.bb
> @@ -18,7 +18,7 @@ S = "${WORKDIR}/git"
>
> EXTRA_OEMAKE += "ARCH=\"${@map_xvisor_arch(d.getVar('TARGET_ARCH'), d)}\" I=${D}"
>
> -CONFIG = "${@get_oemake_config(d)}"
> +CONFIG = "${@get_oemake_config(d.getVar('TARGET_ARCH'), d)}"
>
> do_configure() {
> oe_runmake ${CONFIG}
> @@ -35,11 +35,16 @@ do_install_append() {
> do_deploy () {
> install -d ${DEPLOY_DIR_IMAGE}
> install -m 755 ${D}/vmm.* ${DEPLOY_DIR_IMAGE}/
> +
> + if [[ -f "${D}/*.dtb" ]]; then
> + install -m 755 ${D}/*.dtb ${DEPLOY_DIR_IMAGE}/
> + fi
> }
>
> addtask deploy after do_install
>
> FILES_${PN} += "/vmm.*"
> +FILES_${PN} += "/*.dtb"
>
> -COMPATIBLE_HOST = "(riscv64|riscv32).*"
> +COMPATIBLE_HOST = "(aarch64|riscv64|riscv32).*"
> INHIBIT_PACKAGE_STRIP = "1"
> --
> 2.27.0
>
In message: [PATCH 2/4] xvisor-image-minimal: Initial commit of a Xvisor image
on 13/08/2020 Alistair Francis wrote:
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
> .../images/xvisor-image-minimal.bb | 20 +++++++++++++++++++
> 1 file changed, 20 insertions(+)
> create mode 100644 recipes-extended/images/xvisor-image-minimal.bb
>
> diff --git a/recipes-extended/images/xvisor-image-minimal.bb b/recipes-extended/images/xvisor-image-minimal.bb
> new file mode 100644
> index 0000000..4c4a2fc
> --- /dev/null
> +++ b/recipes-extended/images/xvisor-image-minimal.bb
> @@ -0,0 +1,20 @@
> +DESCRIPTION = "A minimal Xvisor image"
> +
> +INITRD_IMAGE = "core-image-minimal-initramfs"
> +
> +IMAGE_INSTALL += " \
> + packagegroup-core-boot \
> + packagegroup-core-ssh-openssh \
> + "
> +
> +# The hypervisor may not be within the dom0 filesystem image but at least
> +# ensure that it is deployable:
> +do_build[depends] += "xvisor:do_deploy"
> +
> +LICENSE = "MIT"
> +
> +inherit core-image
> +
> +# Enable runqemu. eg: runqemu xvisor-image-minimal nographic slirp
> +QB_DEFAULT_KERNEL = "vmm.bin"
> +QB_OPT_APPEND_append_riscv64 = " -cpu rv64,x-h=true "
> --
> 2.27.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread