Skip to contentSkip to conversation

Xen on Raspberry Pi 4

PATCH Superseded Christopher Clark 3 participants 17 messages Jun 25, 2020 – Jun 27, 2020 Broadcom BCM2711/BCM2835 Arm architecture

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Xen on Raspberry Pi 4

This series introduces support for running Xen on the Raspberry Pi 4 board, with meta-virtualization and meta-raspberrypi, using the linux-raspberrypi kernel at version 5.4 which is the current linux-yocto kernel version supported in this layer.

It introduces use of dynamic layers to handle configuration that is both Xen and Raspberry Pi specific, and inclusion of Xen-specific configuration when the 'xen' DISTRO_FEATURE is enabled to simplify Xen image builds.

It applies a backported set of Xen-specific Linux kernel patches, developed by upstream Xen developers working with the Linux Foundation Eve Project, that are currently being iterated on for inclusion in the Linux kernel.

Xen is uprev'd to version 4.13; this is currently compile-and-boot-tested only on this RPi4 board.

Christopher

Christopher Clark (10):
xen: apply layer settings when xen DISTRO_FEATURE is enabled
xen-tools: add RRECOMENDS qemu on ARM and x86 when HVM is enabled
xen-tools: use non-busybox ifupdown tool if available xen, xen-tools: update revision to Xen 4.13 meta-virt-xen.inc: add Raspberry Pi settings
xen, raspberry pi: add dynamic-layer for Xen configuration for Rpi4 xen, raspberry pi 4: provide a default defconfig for raspberrypi4 xen, linux-raspberrypi: add Linux kernel 5.4 patches for Xen support xen, raspberry pi: add Xen-specific SD card class
linux-raspberrypi: prefer kernel version 5.4

 classes/meta-virt-xen-cfg.bbclass             |   6 +
 classes/sdcard_image-rpi-xen.bbclass          | 120 ++++
 conf/distro/include/meta-virt-xen.inc         |  19 +
 conf/layer.conf                               |  19 +-
 .../bootfiles/rpi-config_git.bbappend         |   6 +
 .../rpi-u-boot-scr/files/boot.cmd.xen.in      |  49 ++
 .../rpi-u-boot-scr/rpi-u-boot-scr.bbappend    |  17 +
 .../xen/files/defconfig_raspberrypi4-64       | 117 ++++
 .../recipes-extended/xen/xen_git.bbappend     |  11 +
 ...vmalloc_to_page-on-vmalloc-virt-addr.patch |  44 ++
 ...02-swiotlb-xen-remove-start_dma_addr.patch |  47 ++
 ...struct-device-parameter-to-xen_phys_.patch |  78 +++
 ...struct-device-parameter-to-xen_bus_t.patch |  66 +++
 ...struct-device-parameter-to-is_xen_sw.patch |  57 ++
 ...oduce-phys_to_dma-dma_to_phys-transl.patch |  88 +++
 ...translations-in-xen_dma_s_kernel_5.4.patch |  68 +++
 ..._to_phys-on-the-dma_addr_t-parameter.patch |  75 +++
 .../0011-adding-page-coherent-patch.patch     |  39 ++
 .../linux/linux-raspberrypi_%.bbappend        |   5 +
 .../linux/linux-raspberrypi_5.4.bbappend      |  19 +
 .../files/xen-tools-libxl-gentypes-py3.patch  | 140 -----
 ...tools-pygrub-change-tabs-into-spaces.patch |  40 --
 ...-python-scripts-work-with-2.6-and-up.patch | 529 ------------------
 .../xen/files/xen-tools-pygrub-py3.patch      | 233 --------
 ...ls-python-fix-Wsign-compare-warnings.patch | 136 -----
 ...n-tools-update-python-scripts-to-py3.patch | 140 -----
 recipes-extended/xen/xen-tools.inc            |  16 +
 recipes-extended/xen/xen-tools_git.bb         |  12 +-
 recipes-extended/xen/xen_git.bb               |   6 +-
 29 files changed, 971 insertions(+), 1231 deletions(-)
 create mode 100644 classes/meta-virt-xen-cfg.bbclass
 create mode 100644 classes/sdcard_image-rpi-xen.bbclass
 create mode 100644 conf/distro/include/meta-virt-xen.inc
 create mode 100644 dynamic-layers/raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend
 create mode 100644 dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in
 create mode 100644 dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend
 create mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/files/defconfig_raspberrypi4-64
 create mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/xen_git.bbappend
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0001-swiotlb-xen-use-vmalloc_to_page-on-vmalloc-virt-addr.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0002-swiotlb-xen-remove-start_dma_addr.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0003-swiotlb-xen-add-struct-device-parameter-to-xen_phys_.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0004-swiotlb-xen-add-struct-device-parameter-to-xen_bus_t.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0007-swiotlb-xen-add-struct-device-parameter-to-is_xen_sw.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0008-swiotlb-xen-introduce-phys_to_dma-dma_to_phys-transl.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0009-xen-arm-introduce-phys-dma-translations-in-xen_dma_s_kernel_5.4.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0010-xen-arm-call-dma_to_phys-on-the-dma_addr_t-parameter.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0011-adding-page-coherent-patch.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bbappend
 delete mode 100644 recipes-extended/xen/files/xen-tools-libxl-gentypes-py3.patch
 delete mode 100644 recipes-extended/xen/files/xen-tools-pygrub-change-tabs-into-spaces.patch
 delete mode 100644 recipes-extended/xen/files/xen-tools-pygrub-make-python-scripts-work-with-2.6-and-up.patch
 delete mode 100644 recipes-extended/xen/files/xen-tools-pygrub-py3.patch
 delete mode 100644 recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch
 delete mode 100644 recipes-extended/xen/files/xen-tools-update-python-scripts-to-py3.patch
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/10 xen: apply layer settings when xen DISTRO_FEATURE is enabled

These settings are necessary for Xen and enabling them here, using the same mechanism that is used by k8s in this layer, simplifies building images for Xen.

- Ensure that Xen mode is enabled in QEMU.
- On ARM platforms: enable Flattened Device Tree (FDT) support.

---
 classes/meta-virt-xen-cfg.bbclass     | 6 ++++++
 conf/distro/include/meta-virt-xen.inc | 6 ++++++
 conf/layer.conf                       | 4 +++-
 3 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 classes/meta-virt-xen-cfg.bbclass
 create mode 100644 conf/distro/include/meta-virt-xen.inc
classes/meta-virt-xen-cfg.bbclass new file +6 -0
new file mode 100644
index 0000000..61b32aa
@@ -0,0 +1,6 @@
+# We need to load the Xen meta-virt config components, only if "xen"
+# is in the distro features.  Since we don't know the distro flags during
+# layer.conf load time, we delay using a special bbclass that simply includes
+# the META_VIRT_XEN_CONFIG_PATH file.
+
+include ${@bb.utils.contains('DISTRO_FEATURES', 'xen', '${META_VIRT_XEN_CONFIG_PATH}', '', d)}
conf/distro/include/meta-virt-xen.inc new file +6 -0
new file mode 100644
index 0000000..a92b08b
@@ -0,0 +1,6 @@
+# Make sure Xen mode is enabled in qemu
+PACKAGECONFIG_append_pn-qemu = " xen"
+
+# For builds for ARM platforms, enable fdt
+PACKAGECONFIG_append_pn-qemu_arm = " fdt"
+PACKAGECONFIG_append_pn-qemu_aarch64 = " fdt"
conf/layer.conf +3 -1
index 697fb62..142621c 100644
@@ -43,8 +43,10 @@ INHERIT += "sanity-meta-virt"
 # We need to load the meta-virt config components, only if "virtualization"
 # is in the distro features.  Since we don't know the distro flags during
 # layer.conf load time, we delay using a special bbclass that simply includes
-# the META_VIRT_CONFIG_PATH file, and likewise for the k8s configs
+# the META_VIRT_CONFIG_PATH file, and likewise for the Xen and k8s configs
 META_VIRT_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/meta-virt-default-versions.inc"
+META_VIRT_XEN_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/meta-virt-xen.inc"
 K8S_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/k8s-versions.inc"
 USER_CLASSES_append = " meta-virt-cfg"
 USER_CLASSES_append = " meta-virt-k8s-cfg"
+USER_CLASSES_append = " meta-virt-xen-cfg"
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/10 xen-tools: add RRECOMENDS qemu on ARM and x86 when HVM is enabled

In reply to Christopher Clark
---
 recipes-extended/xen/xen-tools.inc | 6 ++++++
 1 file changed, 6 insertions(+)
recipes-extended/xen/xen-tools.inc +6 -0
index 8b86f7b..c0e54b1 100644
@@ -53,7 +53,13 @@ RDEPENDS_${PN} = "\
 
 RDEPENDS_${PN}-dev = ""
 
+# Qemu is necessary on ARM platforms, and to support HVM guests on x86
+QEMU = "${@bb.utils.contains('PACKAGECONFIG', 'hvm', 'qemu', '', d)}"
+QEMU_arm = "qemu"
+QEMU_aarch64 = "qemu"
+
 RRECOMMENDS_${PN} = " \
+    ${QEMU} \
     ${@bb.utils.contains('PACKAGECONFIG', 'hvm', 'seabios', '', d)} \
     ${@bb.utils.contains('PACKAGECONFIG', 'externalblktap', '', '${BLKTAP_RRECOMMENDS}', d)} \
     ${PN}-flask \
Signature · 1 line
2.17.1
#3 lore raw

PATCH 3/10 xen-tools: use non-busybox ifupdown tool if available

In reply to Christopher Clark

Adds: RSUGGESTS_${PN}-scripts-network = "ifupdown"

---
 recipes-extended/xen/xen-tools.inc | 4 ++++
 1 file changed, 4 insertions(+)
recipes-extended/xen/xen-tools.inc +4 -0
index c0e54b1..154e224 100644
@@ -113,6 +113,10 @@ RDEPENDS_${PN}-scripts-network = "\
     ${PN}-volatiles \
     "
 
+RSUGGESTS_${PN}-scripts-network = "\
+    ifupdown \
+    "
+
 RSUGGESTS_${PN}-xencov = "${PN}-xencov-split"
 
 RDEPENDS_${PN}-xencommons = "\
Signature · 1 line
2.17.1
#4 lore raw

PATCH 4/10 xen, xen-tools: update revision to Xen 4.13

In reply to Christopher Clark
---
 .../files/xen-tools-libxl-gentypes-py3.patch  | 140 -----
 ...tools-pygrub-change-tabs-into-spaces.patch |  40 --
 ...-python-scripts-work-with-2.6-and-up.patch | 529 ------------------
 .../xen/files/xen-tools-pygrub-py3.patch      | 233 --------
 ...ls-python-fix-Wsign-compare-warnings.patch | 136 -----
 ...n-tools-update-python-scripts-to-py3.patch | 140 -----
 recipes-extended/xen/xen-tools.inc            |   6 +
 recipes-extended/xen/xen-tools_git.bb         |  12 +-
 recipes-extended/xen/xen_git.bb               |   6 +-
 9 files changed, 12 insertions(+), 1230 deletions(-)
 delete mode 100644 recipes-extended/xen/files/xen-tools-libxl-gentypes-py3.patch
 delete mode 100644 recipes-extended/xen/files/xen-tools-pygrub-change-tabs-into-spaces.patch
 delete mode 100644 recipes-extended/xen/files/xen-tools-pygrub-make-python-scripts-work-with-2.6-and-up.patch
 delete mode 100644 recipes-extended/xen/files/xen-tools-pygrub-py3.patch
 delete mode 100644 recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch
 delete mode 100644 recipes-extended/xen/files/xen-tools-update-python-scripts-to-py3.patch
recipes-extended/xen/files/xen-tools-libxl-gentypes-py3.patch deleted +0 -140
deleted file mode 100644
index 2399786..0000000
@@ -1,140 +0,0 @@
-From 660d2dd863802ef464c90b32f187cb65861f8185 Mon Sep 17 00:00:00 2001
-From: Wei Liu <[email protected]>
-Date: Thu, 7 Mar 2019 12:33:38 +0000
-Subject: [PATCH] libxl: make python scripts work with python 2.6 and up
-
-Go through transformations suggested by 2to3 and pick the necessary
-ones.
-
-Signed-off-by: Wei Liu <[email protected]>
-Reviewed-by: Andrew Cooper <[email protected]>
----
- tools/libxl/gentest.py  |  4 +++-
- tools/libxl/gentypes.py | 12 +++++++-----
- tools/libxl/idl.py      | 15 ++++++++-------
- 3 files changed, 18 insertions(+), 13 deletions(-)
-
-diff --git a/tools/libxl/gentest.py b/tools/libxl/gentest.py
-index 989959fc68..1cc7eebc82 100644
---- a/tools/libxl/gentest.py
-+++ b/tools/libxl/gentest.py
-@@ -1,5 +1,7 @@
- #!/usr/bin/python
- 
-+from __future__ import print_function
-+
- import os
- import sys
- import re
-@@ -86,7 +88,7 @@ def gen_rand_init(ty, v, indent = "    ", parent = None):
- 
- if __name__ == '__main__':
-     if len(sys.argv) < 3:
--        print >>sys.stderr, "Usage: gentest.py <idl> <implementation>"
-+        print("Usage: gentest.py <idl> <implementation>", file=sys.stderr)
-         sys.exit(1)
- 
-     random.seed(os.getenv('LIBXL_TESTIDL_SEED'))
-diff --git a/tools/libxl/gentypes.py b/tools/libxl/gentypes.py
-index 88e5c5f30e..6417c9dd8c 100644
---- a/tools/libxl/gentypes.py
-+++ b/tools/libxl/gentypes.py
-@@ -1,5 +1,7 @@
- #!/usr/bin/python
- 
-+from __future__ import print_function
-+
- import sys
- import re
- 
-@@ -576,14 +578,14 @@ def libxl_C_enum_from_string(ty, str, e, indent = "    "):
- 
- if __name__ == '__main__':
-     if len(sys.argv) != 6:
--        print >>sys.stderr, "Usage: gentypes.py <idl> <header> <header-private> <header-json> <implementation>"
-+        print("Usage: gentypes.py <idl> <header> <header-private> <header-json> <implementation>", file=sys.stderr)
-         sys.exit(1)
- 
-     (_, idlname, header, header_private, header_json, impl) = sys.argv
- 
-     (builtins,types) = idl.parse(idlname)
- 
--    print "outputting libxl type definitions to %s" % header
-+    print("outputting libxl type definitions to %s" % header)
- 
-     f = open(header, "w")
- 
-@@ -633,7 +635,7 @@ if __name__ == '__main__':
-     f.write("""#endif /* %s */\n""" % (header_define))
-     f.close()
- 
--    print "outputting libxl JSON definitions to %s" % header_json
-+    print("outputting libxl JSON definitions to %s" % header_json)
- 
-     f = open(header_json, "w")
- 
-@@ -657,7 +659,7 @@ if __name__ == '__main__':
-     f.write("""#endif /* %s */\n""" % header_json_define)
-     f.close()
- 
--    print "outputting libxl type internal definitions to %s" % header_private
-+    print("outputting libxl type internal definitions to %s" % header_private)
- 
-     f = open(header_private, "w")
- 
-@@ -683,7 +685,7 @@ if __name__ == '__main__':
-     f.write("""#endif /* %s */\n""" % header_json_define)
-     f.close()
- 
--    print "outputting libxl type implementations to %s" % impl
-+    print("outputting libxl type implementations to %s" % impl)
- 
-     f = open(impl, "w")
-     f.write("""
-diff --git a/tools/libxl/idl.py b/tools/libxl/idl.py
-index 2a7f3c44fe..d7367503b4 100644
---- a/tools/libxl/idl.py
-+++ b/tools/libxl/idl.py
-@@ -1,3 +1,5 @@
-+from __future__ import print_function
-+
- import sys
- 
- PASS_BY_VALUE = 1
-@@ -11,7 +13,7 @@ DIR_BOTH = 3
- _default_namespace = ""
- def namespace(s):
-     if type(s) != str:
--        raise TypeError, "Require a string for the default namespace."
-+        raise TypeError("Require a string for the default namespace.")
-     global _default_namespace
-     _default_namespace = s
- 
-@@ -346,7 +348,7 @@ class OrderedDict(dict):
-         return [(x,self[x]) for x in self.__ordered]
- 
- def parse(f):
--    print >>sys.stderr, "Parsing %s" % f
-+    print("Parsing %s" % f, file=sys.stderr)
- 
-     globs = {}
-     locs = OrderedDict()
-@@ -362,11 +364,10 @@ def parse(f):
-             globs[n] = t
- 
-     try:
--        execfile(f, globs, locs)
--    except SyntaxError,e:
--        raise SyntaxError, \
--              "Errors were found at line %d while processing %s:\n\t%s"\
--              %(e.lineno,f,e.text)
-+        exec(compile(open(f).read(), f, 'exec'), globs, locs)
-+    except SyntaxError as e:
-+        raise SyntaxError("Errors were found at line %d while processing %s:\n\t%s"
-+                          % (e.lineno, f, e.text))
- 
-     types = [t for t in locs.ordered_values() if isinstance(t,Type)]
- 
--- 
-2.17.1
-
recipes-extended/xen/files/xen-tools-pygrub-change-tabs-into-spaces.patch deleted +0 -40
deleted file mode 100644
index d913be2..0000000
@@ -1,40 +0,0 @@
-From b9e1368af14ded6aee3bdf64e8329628b16291ff Mon Sep 17 00:00:00 2001
-From: Wei Liu <[email protected]>
-Date: Mon, 11 Mar 2019 12:55:29 +0000
-Subject: [PATCH] pygrub: change tabs into spaces
-
-Not sure why Python 2 never complained, but Python 3 does.
-
-Change tabs to spaces.
-
-Signed-off-by: Wei Liu <[email protected]>
-Reviewed-by: Andrew Cooper <[email protected]>
----
- tools/pygrub/src/pygrub | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
-index 52a8965ad9..1189b1ca48 100755
---- a/tools/pygrub/src/pygrub
-+++ b/tools/pygrub/src/pygrub
-@@ -858,7 +858,7 @@ if __name__ == "__main__":
-             output_directory = a
- 
-     if debug:
--	logging.basicConfig(level=logging.DEBUG)
-+        logging.basicConfig(level=logging.DEBUG)
- 
- 
-     try:
-@@ -917,7 +917,7 @@ if __name__ == "__main__":
-             # IOErrors raised by fsimage.open
-             # RuntimeErrors raised by run_grub if no menu.lst present
-             if debug:
--		traceback.print_exc()
-+                traceback.print_exc()
-             fs = None
-             continue
- 
--- 
-2.17.1
-
recipes-extended/xen/files/xen-tools-pygrub-make-python-scripts-work-with-2.6-and-up.patch deleted +0 -529

529 lines not on this page · raw message

recipes-extended/xen/files/xen-tools-pygrub-py3.patch deleted +0 -233

233 lines not on this page · raw message

recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch deleted +0 -136

136 lines not on this page · raw message

recipes-extended/xen/files/xen-tools-update-python-scripts-to-py3.patch deleted +0 -140

140 lines not on this page · raw message

recipes-extended/xen/xen-tools.inc +6 -0
index 154e224..2feed00 100644
@@ -65,6 +65,7 @@ RRECOMMENDS_${PN} = " \
     ${PN}-flask \
     ${PN}-hvmloader \
     ${PN}-shim \
+    ${PN}-ucode \
     ${PN}-xenpaging \
     "
 
@@ -202,6 +203,7 @@ PACKAGES = " \
     ${PN}-scripts-network \
     ${PN}-shim \
     ${PN}-staticdev \
+    ${PN}-ucode \
     ${PN}-volatiles \
     ${PN}-xcutils \
     ${PN}-xencommons \
@@ -529,6 +531,10 @@ FILES_${PN}-shim = " \
     ${libdir}/xen/boot/xen-shim \
     "
 
+FILES_${PN}-ucode = "\
+    ${sbindir}/xen-ucode \
+    "
+
 FILES_${PN}-volatiles = "\
     ${sysconfdir}/default/volatiles/99_xen \
     ${sysconfdir}/tmpfiles.d/xen.conf \
recipes-extended/xen/xen-tools_git.bb +3 -9
index 00060df..d8c7dc1 100644
@@ -1,20 +1,14 @@
-SRCREV ?= "a5fcafbfbee55261853fba07149c1c795f2baf58"
+SRCREV ?= "b66ce5058ec9ce84418cedd39b2bf07b7c5a1f65"
 
-XEN_REL ?= "4.12"
+XEN_REL ?= "4.13"
 XEN_BRANCH ?= "stable-${XEN_REL}"
 
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
     file://0001-python-pygrub-pass-DISTUTILS-xen.4.12.patch \
-    file://xen-tools-update-python-scripts-to-py3.patch \
-    file://xen-tools-libxl-gentypes-py3.patch \
-    file://xen-tools-python-fix-Wsign-compare-warnings.patch \
-    file://xen-tools-pygrub-change-tabs-into-spaces.patch \
-    file://xen-tools-pygrub-make-python-scripts-work-with-2.6-and-up.patch \
-    file://xen-tools-pygrub-py3.patch \
     "
 
-LIC_FILES_CHKSUM ?= "file://COPYING;md5=bbb4b1bdc2c3b6743da3c39d03249095"
+LIC_FILES_CHKSUM ?= "file://COPYING;md5=4295d895d4b5ce9d070263d52f030e49"
 
 PV = "${XEN_REL}+git${SRCPV}"
 
recipes-extended/xen/xen_git.bb +3 -3
index a7475ac..9c82f5f 100644
@@ -1,11 +1,11 @@
-SRCREV ?= "a5fcafbfbee55261853fba07149c1c795f2baf58"
+SRCREV ?= "b66ce5058ec9ce84418cedd39b2bf07b7c5a1f65"
 
-XEN_REL ?= "4.12"
+XEN_REL ?= "4.13"
 XEN_BRANCH ?= "stable-${XEN_REL}"
 
 SRC_URI = "git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH}"
 
-LIC_FILES_CHKSUM ?= "file://COPYING;md5=bbb4b1bdc2c3b6743da3c39d03249095"
+LIC_FILES_CHKSUM ?= "file://COPYING;md5=4295d895d4b5ce9d070263d52f030e49"
 
 PV = "${XEN_REL}+git${SRCPV}"
 
Signature · 1 line
2.17.1
#5 lore raw

PATCH 5/10 meta-virt-xen.inc: add Raspberry Pi settings

In reply to Christopher Clark
---
 conf/distro/include/meta-virt-xen.inc | 8 ++++++++
 1 file changed, 8 insertions(+)
conf/distro/include/meta-virt-xen.inc +8 -0
index a92b08b..2ada83a 100644
@@ -4,3 +4,11 @@ PACKAGECONFIG_append_pn-qemu = " xen"
 # For builds for ARM platforms, enable fdt
 PACKAGECONFIG_append_pn-qemu_arm = " fdt"
 PACKAGECONFIG_append_pn-qemu_aarch64 = " fdt"
+
+# Raspberry Pi settings
+#  - Xen guest console
+KERNEL_CONSOLE = "hvc0"
+SERIAL_CONSOLES = "115200;hvc0"
+#  - Xen uses u-boot for configuration and uses the uart
+RPI_USE_U_BOOT = "1"
+ENABLE_UART = "1"
Signature · 1 line
2.17.1
#6 lore raw

PATCH 6/10 xen, raspberry pi: add dynamic-layer for Xen configuration for Rpi4

In reply to Christopher Clark

A Xen-specific u-boot script is needed for launching Xen, and the GIC (interrupt controller) needs to be enabled.

Since this is both Xen-specific and Raspberry Pi-specific, use a dynamic layer to conditionally enable the recipes when both meta-virtualization and meta-raspberrypi are in use together.

---
 conf/layer.conf                               | 15 ++++++
 .../bootfiles/rpi-config_git.bbappend         |  6 +++
 .../rpi-u-boot-scr/files/boot.cmd.xen.in      | 49 +++++++++++++++++++
 .../rpi-u-boot-scr/rpi-u-boot-scr.bbappend    | 17 +++++++
 4 files changed, 87 insertions(+)
 create mode 100644 dynamic-layers/raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend
 create mode 100644 dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in
 create mode 100644 dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend
conf/layer.conf +15 -0
index 142621c..1ec7a15 100644
@@ -11,6 +11,21 @@ BBFILE_PRIORITY_virtualization-layer = "8"
 # Custom licenses used by some packages in this layer
 LICENSE_PATH += "${LAYERDIR}/files/custom-licenses"
 
+# The dynamic-layers directory hosts extensions and layer-specific
+# modifications.
+#
+# The .bbappend and .bb files are included if the respective layer
+# collection is available.
+BBFILES += "${@' '.join('${LAYERDIR}/dynamic-layers/%s/recipes*/*/*.bbappend' % layer \
+               for layer in BBFILE_COLLECTIONS.split())}"
+BBFILES += "${@' '.join('${LAYERDIR}/dynamic-layers/%s/recipes*/*/*.bb' % layer \
+               for layer in BBFILE_COLLECTIONS.split())}"
+
+BBFILES_DYNAMIC += " \
+    raspberrypi:${LAYERDIR}/dynamic-layers/raspberrypi/*/*/*.bb \
+    raspberrypi:${LAYERDIR}/dynamic-layers/rasbperrypi/*/*/*.bbappend \
+"
+
 # This should only be incremented on significant changes that will
 # cause compatibility issues with other layers
 LAYERVERSION_virtualization-layer = "1"
dynamic-layers/raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend new file +6 -0
new file mode 100644
index 0000000..2b9c4fb
@@ -0,0 +1,6 @@
+do_deploy_append() {
+    # We need the GIC enabled for Xen to work.
+    if [ "${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'yes', 'no', d)}" = "yes" ]; then
+        echo "enable_gic=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+    fi
+}
dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in new file +49 -0

49 lines not on this page · raw message

dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend new file +17 -0
new file mode 100644
index 0000000..2a51116
@@ -0,0 +1,17 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+RPI_DOM0_MEM ??= "256M"
+RPI_DEBUG_XEN_ARGS ??= "sync_console bootscrub=0"
+
+SRC_URI += "file://boot.cmd.xen.in"
+
+# If the distro is Xen enabled, override the default boot.cmd.in with the
+# alternative boot.cmd.xen.in from this layer, with variables subsitution here
+do_compile_append() {
+    if [ "${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'yes', 'no', d)}" = "yes" ]; then
+        sed -e 's/@@RPI_DOM0_MEM@@/${RPI_DOM0_MEM}/' \
+            -e 's/@@RPI_DEBUG_XEN_ARGS@@/${RPI_DEBUG_XEN_ARGS}/' \
+                "${WORKDIR}/boot.cmd.xen.in" > "${WORKDIR}/boot.cmd"
+        mkimage -A arm -T script -C none -n "Boot script" -d "${WORKDIR}/boot.cmd" boot.scr
+    fi
+}
Signature · 1 line
2.17.1
#7 lore raw

PATCH 7/10 xen, raspberry pi 4: provide a default defconfig for raspberrypi4

In reply to Christopher Clark
---
 .../xen/files/defconfig_raspberrypi4-64       | 117 ++++++++++++++++++
 .../recipes-extended/xen/xen_git.bbappend     |  11 ++
 2 files changed, 128 insertions(+)
 create mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/files/defconfig_raspberrypi4-64
 create mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/xen_git.bbappend
dynamic-layers/raspberrypi/recipes-extended/xen/files/defconfig_raspberrypi4-64 new file +117 -0
new file mode 100644
index 0000000..f3343d3
@@ -0,0 +1,117 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Xen/arm 4.13.0 Configuration
+#
+CONFIG_64BIT=y
+CONFIG_ARM_64=y
+CONFIG_ARM=y
+CONFIG_ARCH_DEFCONFIG="arch/arm/configs/arm64_defconfig"
+
+#
+# Architecture Features
+#
+CONFIG_NR_CPUS=128
+# CONFIG_ACPI is not set
+CONFIG_GICV3=y
+# CONFIG_HAS_ITS is not set
+CONFIG_HVM=y
+# CONFIG_NEW_VGIC is not set
+CONFIG_SBSA_VUART_CONSOLE=y
+CONFIG_ARM_SSBD=y
+CONFIG_HARDEN_BRANCH_PREDICTOR=y
+# CONFIG_TEE is not set
+
+#
+# ARM errata workaround via the alternative framework
+#
+CONFIG_ARM64_ERRATUM_827319=y
+CONFIG_ARM64_ERRATUM_824069=y
+CONFIG_ARM64_ERRATUM_819472=y
+CONFIG_ARM64_ERRATUM_832075=y
+CONFIG_ARM64_ERRATUM_834220=y
+CONFIG_ARM64_HARDEN_BRANCH_PREDICTOR=y
+CONFIG_ALL_PLAT=y
+# CONFIG_QEMU is not set
+# CONFIG_RCAR3 is not set
+# CONFIG_MPSOC is not set
+# CONFIG_NO_PLAT is not set
+CONFIG_ALL64_PLAT=y
+# CONFIG_ALL32_PLAT is not set
+CONFIG_MPSOC_PLATFORM=y
+
+#
+# Common Features
+#
+CONFIG_GRANT_TABLE=y
+CONFIG_HAS_ALTERNATIVE=y
+CONFIG_HAS_DEVICE_TREE=y
+CONFIG_HAS_FAST_MULTIPLY=y
+# CONFIG_MEM_ACCESS is not set
+CONFIG_HAS_PDX=y
+
+#
+# Speculative hardening
+#
+CONFIG_SPECULATIVE_HARDEN_ARRAY=y
+# CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP is not set
+CONFIG_XSM=y
+CONFIG_XSM_FLASK=y
+CONFIG_XSM_FLASK_AVC_STATS=y
+# CONFIG_XSM_FLASK_POLICY is not set
+CONFIG_XSM_SILO=y
+# CONFIG_XSM_DUMMY_DEFAULT is not set
+# CONFIG_XSM_FLASK_DEFAULT is not set
+CONFIG_XSM_SILO_DEFAULT=y
+# CONFIG_ARGO is not set
+
+#
+# Schedulers
+#
+CONFIG_SCHED_CREDIT=y
+CONFIG_SCHED_CREDIT2=y
+CONFIG_SCHED_RTDS=y
+CONFIG_SCHED_ARINC653=y
+CONFIG_SCHED_NULL=y
+# CONFIG_SCHED_CREDIT_DEFAULT is not set
+CONFIG_SCHED_CREDIT2_DEFAULT=y
+# CONFIG_SCHED_RTDS_DEFAULT is not set
+# CONFIG_SCHED_ARINC653_DEFAULT is not set
+# CONFIG_SCHED_NULL_DEFAULT is not set
+CONFIG_SCHED_DEFAULT="credit2"
+# CONFIG_LIVEPATCH is not set
+# CONFIG_ENFORCE_UNIQUE_SYMBOLS is not set
+# CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS is not set
+CONFIG_CMDLINE=""
+CONFIG_DOM0_MEM=""
+CONFIG_TRACEBUFFER=y
+
+#
+# Device Drivers
+#
+CONFIG_HAS_NS16550=y
+CONFIG_HAS_CADENCE_UART=y
+CONFIG_HAS_MVEBU=y
+CONFIG_HAS_MESON=y
+CONFIG_HAS_PL011=y
+CONFIG_HAS_SCIF=y
+CONFIG_HAS_PASSTHROUGH=y
+CONFIG_ARM_SMMU=y
+# CONFIG_IPMMU_VMSA is not set
+CONFIG_IOMMU_FORCE_PT_SHARE=y
+CONFIG_DEFCONFIG_LIST="arch/arm/configs/arm64_defconfig"
+
+#
+# Debugging Options
+#
+CONFIG_DEBUG=y
+CONFIG_DEBUG_INFO=y
+CONFIG_FRAME_POINTER=y
+# CONFIG_COVERAGE is not set
+# CONFIG_DEBUG_LOCK_PROFILE is not set
+CONFIG_DEBUG_LOCKS=y
+# CONFIG_PERF_COUNTERS is not set
+CONFIG_VERBOSE_DEBUG=y
+# CONFIG_DEVICE_TREE_DEBUG is not set
+CONFIG_SCRUB_DEBUG=y
+# CONFIG_DEBUG_TRACE is not set
+CONFIG_XMEM_POOL_POISON=y
dynamic-layers/raspberrypi/recipes-extended/xen/xen_git.bbappend new file +11 -0
new file mode 100644
index 0000000..995dfd3
@@ -0,0 +1,11 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI_append_raspberrypi4-64 = " \
+    file://defconfig_raspberrypi4-64 \
+    "
+
+do_post_patch_append_raspberrypi4-64() {
+    if [ ! -e "${WORKDIR}/defconfig" ] ; then
+        cp "${WORKDIR}/defconfig_raspberrypi4-64" "${WORKDIR}/defconfig"
+    fi
+}
Signature · 1 line
2.17.1
#8 lore raw

PATCH 8/10 xen, linux-raspberrypi: add Linux kernel 5.4 patches for Xen support

In reply to Christopher Clark

Kernel patches are in process of Linux review and submission, and are backported from the Linux Foundation's Eve Project kernel from 5.6 to 5.4 (some patches not needed for 5.4, hence gaps in the patch sequence number)
https://github.com/lf-edge/eve/tree/master/pkg/new-kernel/patches-5.6.x

A bbappend applies Xen overrides to the boot command line.

Since linux-raspberrypi depends on linux-yocto, and linux-yocto_virtualization introduces a requirement for cfg/virtio.scc obtain it from the yocto kernel cache.

---
 ...vmalloc_to_page-on-vmalloc-virt-addr.patch | 44 ++++++++++
 ...02-swiotlb-xen-remove-start_dma_addr.patch | 47 ++++++++++
 ...struct-device-parameter-to-xen_phys_.patch | 78 ++++++++++++++++
 ...struct-device-parameter-to-xen_bus_t.patch | 66 ++++++++++++++
 ...struct-device-parameter-to-is_xen_sw.patch | 57 ++++++++++++
 ...oduce-phys_to_dma-dma_to_phys-transl.patch | 88 +++++++++++++++++++
 ...translations-in-xen_dma_s_kernel_5.4.patch | 68 ++++++++++++++
 ..._to_phys-on-the-dma_addr_t-parameter.patch | 75 ++++++++++++++++
 .../0011-adding-page-coherent-patch.patch     | 39 ++++++++
 .../linux/linux-raspberrypi_%.bbappend        |  5 ++
 .../linux/linux-raspberrypi_5.4.bbappend      | 19 ++++
 11 files changed, 586 insertions(+)
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0001-swiotlb-xen-use-vmalloc_to_page-on-vmalloc-virt-addr.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0002-swiotlb-xen-remove-start_dma_addr.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0003-swiotlb-xen-add-struct-device-parameter-to-xen_phys_.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0004-swiotlb-xen-add-struct-device-parameter-to-xen_bus_t.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0007-swiotlb-xen-add-struct-device-parameter-to-is_xen_sw.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0008-swiotlb-xen-introduce-phys_to_dma-dma_to_phys-transl.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0009-xen-arm-introduce-phys-dma-translations-in-xen_dma_s_kernel_5.4.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0010-xen-arm-call-dma_to_phys-on-the-dma_addr_t-parameter.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0011-adding-page-coherent-patch.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bbappend
dynamic-layers/raspberrypi/recipes-kernel/linux/files/0001-swiotlb-xen-use-vmalloc_to_page-on-vmalloc-virt-addr.patch new file +44 -0
new file mode 100644
index 0000000..09144ce
@@ -0,0 +1,44 @@
+From f5f4de59377afdd9a80e0f47df109eacf427c203 Mon Sep 17 00:00:00 2001
+From: Boris Ostrovsky <[email protected]>
+Date: Wed, 20 May 2020 16:42:06 -0700
+Subject: [PATCH 01/10] swiotlb-xen: use vmalloc_to_page on vmalloc virt
+ addresses
+
+Don't just assume that virt_to_page works on all virtual addresses.
+Instead add a is_vmalloc_addr check and use vmalloc_to_page on vmalloc
+virt addresses.
+
+Signed-off-by: Boris Ostrovsky <[email protected]>
+Signed-off-by: Stefano Stabellini <[email protected]>
+---
+ drivers/xen/swiotlb-xen.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
+index b6d27762c6f8..a42129cba36e 100644
+--- a/drivers/xen/swiotlb-xen.c
++++ b/drivers/xen/swiotlb-xen.c
+@@ -335,6 +335,7 @@ xen_swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr,
+ 	int order = get_order(size);
+ 	phys_addr_t phys;
+ 	u64 dma_mask = DMA_BIT_MASK(32);
++	struct page *pg;
+ 
+ 	if (hwdev && hwdev->coherent_dma_mask)
+ 		dma_mask = hwdev->coherent_dma_mask;
+@@ -346,9 +347,11 @@ xen_swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr,
+ 	/* Convert the size to actually allocated. */
+ 	size = 1UL << (order + XEN_PAGE_SHIFT);
+ 
++	pg = is_vmalloc_addr(vaddr) ? vmalloc_to_page(vaddr) :
++				      virt_to_page(vaddr);
+ 	if (!WARN_ON((dev_addr + size - 1 > dma_mask) ||
+ 		     range_straddles_page_boundary(phys, size)) &&
+-	    TestClearPageXenRemapped(virt_to_page(vaddr)))
++	    TestClearPageXenRemapped(pg))
+ 		xen_destroy_contiguous_region(phys, order);
+ 
+ 	xen_free_coherent_pages(hwdev, size, vaddr, (dma_addr_t)phys, attrs);
+-- 
+2.15.4
+
dynamic-layers/raspberrypi/recipes-kernel/linux/files/0002-swiotlb-xen-remove-start_dma_addr.patch new file +47 -0

47 lines not on this page · raw message

dynamic-layers/raspberrypi/recipes-kernel/linux/files/0003-swiotlb-xen-add-struct-device-parameter-to-xen_phys_.patch new file +78 -0

78 lines not on this page · raw message

dynamic-layers/raspberrypi/recipes-kernel/linux/files/0004-swiotlb-xen-add-struct-device-parameter-to-xen_bus_t.patch new file +66 -0

66 lines not on this page · raw message

dynamic-layers/raspberrypi/recipes-kernel/linux/files/0007-swiotlb-xen-add-struct-device-parameter-to-is_xen_sw.patch new file +57 -0

57 lines not on this page · raw message

dynamic-layers/raspberrypi/recipes-kernel/linux/files/0008-swiotlb-xen-introduce-phys_to_dma-dma_to_phys-transl.patch new file +88 -0

88 lines not on this page · raw message

dynamic-layers/raspberrypi/recipes-kernel/linux/files/0009-xen-arm-introduce-phys-dma-translations-in-xen_dma_s_kernel_5.4.patch new file +68 -0

68 lines not on this page · raw message

dynamic-layers/raspberrypi/recipes-kernel/linux/files/0010-xen-arm-call-dma_to_phys-on-the-dma_addr_t-parameter.patch new file +75 -0

75 lines not on this page · raw message

dynamic-layers/raspberrypi/recipes-kernel/linux/files/0011-adding-page-coherent-patch.patch new file +39 -0
new file mode 100644
index 0000000..a84ae74
@@ -0,0 +1,39 @@
+From 1f1182bf84ec7a6d1ec74c56fccd66ff013077af Mon Sep 17 00:00:00 2001
+From: Stefano Stabellini <[email protected]>
+Date: Wed, 20 May 2020 16:43:08 -0700
+Subject: [PATCH 11/11] xen/arm: call dma_to_phys on the dma_addr_t parameter
+ of dma_cache_maint
+
+Add a struct device* parameter to dma_cache_maint.
+
+Translate the dma_addr_t parameter of dma_cache_maint by calling
+dma_to_phys. Do it for the first page and all the following pages, in
+case of multipage handling.
+
+Signed-off-by: Stefano Stabellini <[email protected]>
+---
+ include/xen/arm/page-coherent.h | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c
+index 7639251bcc79..6ddf3b3c1ab5 100644
+--- a/include/xen/arm/page-coherent.h	2020-05-20 06:22:38.000000000 +0000
++++ b/include/xen/arm/page-coherent.h	2020-05-29 00:37:15.604981421 +0000
+@@ -8,12 +8,17 @@
+ static inline void *xen_alloc_coherent_pages(struct device *hwdev, size_t size,
+ 		dma_addr_t *dma_handle, gfp_t flags, unsigned long attrs)
+ {
++	void *cpu_addr;
++        if (dma_alloc_from_dev_coherent(hwdev, size, dma_handle, &cpu_addr))
++            return cpu_addr;
+ 	return dma_direct_alloc(hwdev, size, dma_handle, flags, attrs);
+ }
+ 
+ static inline void xen_free_coherent_pages(struct device *hwdev, size_t size,
+ 		void *cpu_addr, dma_addr_t dma_handle, unsigned long attrs)
+ {
++	if (dma_release_from_dev_coherent(hwdev, get_order(size), cpu_addr))
++            return;
+ 	dma_direct_free(hwdev, size, cpu_addr, dma_handle, attrs);
+ }
+ 
dynamic-layers/raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend new file +5 -0
new file mode 100644
index 0000000..25979e2
@@ -0,0 +1,5 @@
+# For a Xen-enabled distro, override the contents of cmdline.txt
+
+DEFAULT_CMDLINE := "${CMDLINE}"
+XEN_LINUX_CMDLINE ?= "console=hvc0 clk_ignore_unused earlyprintk=xen debug root=/dev/mmcblk0p2 rootwait"
+CMDLINE = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', '${XEN_LINUX_CMDLINE}', '${DEFAULT_CMDLINE}', d)}"
dynamic-layers/raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bbappend new file +19 -0
new file mode 100644
index 0000000..ec8d677
@@ -0,0 +1,19 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI += " \
+    file://0001-swiotlb-xen-use-vmalloc_to_page-on-vmalloc-virt-addr.patch \
+    file://0002-swiotlb-xen-remove-start_dma_addr.patch \
+    file://0003-swiotlb-xen-add-struct-device-parameter-to-xen_phys_.patch \
+    file://0004-swiotlb-xen-add-struct-device-parameter-to-xen_bus_t.patch \
+    file://0007-swiotlb-xen-add-struct-device-parameter-to-is_xen_sw.patch \
+    file://0008-swiotlb-xen-introduce-phys_to_dma-dma_to_phys-transl.patch \
+    file://0009-xen-arm-introduce-phys-dma-translations-in-xen_dma_s_kernel_5.4.patch \
+    file://0010-xen-arm-call-dma_to_phys-on-the-dma_addr_t-parameter.patch \
+    file://0011-adding-page-coherent-patch.patch \
+    "
+
+# Add support for virtio.scc which linux-yocto_virtualization adds
+SRCREV_meta = "aafb8f095e97013d6e55b09ed150369cbe0c6476"
+SRC_URI_append += " \
+    git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=kernel-meta \
+    "
Signature · 1 line
2.17.1
#9 lore raw

PATCH 9/10 xen, raspberry pi: add Xen-specific SD card class

In reply to Christopher Clark

At the moment the regular meta-raspberrypi SD card class does not allow for optional inclusion of extra files in the SD card boot partition without requiring those same files be present in the root filesystem. This affects hypervisor binaries, such as Xen, which do not necessarily belong within the guest filesystem.

As a workaround, inherit the sdcard_image-rpi.bbclass and clone the main IMAGE_CMD function, adding the Xen-specific deploy that is needed. This can be retired when the parent class has extensibility added.

---
 classes/sdcard_image-rpi-xen.bbclass  | 120 ++++++++++++++++++++++++++
 conf/distro/include/meta-virt-xen.inc |   3 +
 2 files changed, 123 insertions(+)
 create mode 100644 classes/sdcard_image-rpi-xen.bbclass
classes/sdcard_image-rpi-xen.bbclass new file +120 -0
new file mode 100644
index 0000000..c03520c
@@ -0,0 +1,120 @@
+inherit sdcard_image-rpi
+
+# This image class should be retired and folded into sdcard_image-rpi.bbclass
+# when it has support for adding binaries to the boot partition that are not
+# present in the root partition filesystem: ie. the hypervisor (xen) image.
+
+do_image_rpi_xen_sdimg[depends] = " \
+    parted-native:do_populate_sysroot \
+    mtools-native:do_populate_sysroot \
+    dosfstools-native:do_populate_sysroot \
+    virtual/kernel:do_deploy \
+    ${IMAGE_BOOTLOADER}:do_deploy \
+    rpi-config:do_deploy \
+    ${@bb.utils.contains('MACHINE_FEATURES', 'armstub', 'armstubs:do_deploy', '' ,d)} \
+    ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \
+    ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot-default-script:do_deploy', '',d)} \
+    xen:do_deploy \
+    "
+
+do_image_rpi_xen_sdimg[recrdeps] = "do_build"
+
+IMAGE_TYPEDEP_rpi-xen-sdimg = "${SDIMG_ROOTFS_TYPE}"
+
+SDIMG = "${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.rpi-xen-sdimg"
+
+# Take from: IMAGE_CMD_rpi-sdimg from meta-raspberrypi, current as of: 44d7dd0e
+# with modification to include the Xen hypervisor binary in the boot partition.
+IMAGE_CMD_rpi-xen-sdimg () {
+
+    # Align partitions
+    BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE} + ${IMAGE_ROOTFS_ALIGNMENT} - 1)
+    BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE_ALIGNED} - ${BOOT_SPACE_ALIGNED} % ${IMAGE_ROOTFS_ALIGNMENT})
+    SDIMG_SIZE=$(expr ${IMAGE_ROOTFS_ALIGNMENT} + ${BOOT_SPACE_ALIGNED} + $ROOTFS_SIZE)
+
+    echo "Creating filesystem with Boot partition ${BOOT_SPACE_ALIGNED} KiB and RootFS $ROOTFS_SIZE KiB"
+
+    # Check if we are building with device tree support
+    DTS="${KERNEL_DEVICETREE}"
+
+    # Initialize sdcard image file
+    dd if=/dev/zero of=${SDIMG} bs=1024 count=0 seek=${SDIMG_SIZE}
+
+    # Create partition table
+    parted -s ${SDIMG} mklabel msdos
+    # Create boot partition and mark it as bootable
+    parted -s ${SDIMG} unit KiB mkpart primary fat32 ${IMAGE_ROOTFS_ALIGNMENT} $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT})
+    parted -s ${SDIMG} set 1 boot on
+    # Create rootfs partition to the end of disk
+    parted -s ${SDIMG} -- unit KiB mkpart primary ext2 $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT}) -1s
+    parted ${SDIMG} print
+
+    # Create a vfat image with boot files
+    BOOT_BLOCKS=$(LC_ALL=C parted -s ${SDIMG} unit b print | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }')
+    rm -f ${WORKDIR}/boot.img
+    mkfs.vfat -F32 -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS
+    mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/* ::/ || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/* into boot.img"
+    if [ "${@bb.utils.contains("MACHINE_FEATURES", "armstub", "1", "0", d)}" = "1" ]; then
+        mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/armstubs/${ARMSTUB} ::/ || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/armstubs/${ARMSTUB} into boot.img"
+    fi
+    if test -n "${DTS}"; then
+        # Copy board device trees to root folder
+        for dtbf in ${@split_overlays(d, True)}; do
+            dtb=`basename $dtbf`
+            mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/$dtb ::$dtb || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/$dtb into boot.img"
+        done
+
+        # Copy device tree overlays to dedicated folder
+        mmd -i ${WORKDIR}/boot.img overlays
+        for dtbf in ${@split_overlays(d, False)}; do
+            dtb=`basename $dtbf`
+            mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/$dtb ::overlays/$dtb || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/$dtb into boot.img"
+        done
+    fi
+    if [ "${RPI_USE_U_BOOT}" = "1" ]; then
+        mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/u-boot.bin ::${SDIMG_KERNELIMAGE} || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/u-boot.bin into boot.img"
+        mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/boot.scr ::boot.scr || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/boot.scr into boot.img"
+        if [ ! -z "${INITRAMFS_IMAGE}" -a "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then
+            mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${INITRAMFS_LINK_NAME}.bin ::${KERNEL_IMAGETYPE} || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${INITRAMFS_LINK_NAME}.bin into boot.img"
+        else
+            mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} ::${KERNEL_IMAGETYPE} || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} into boot.img"
+        fi
+    else
+        if [ ! -z "${INITRAMFS_IMAGE}" -a "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then
+            mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${INITRAMFS_LINK_NAME}.bin ::${SDIMG_KERNELIMAGE} || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${INITRAMFS_LINK_NAME}.bin into boot.img"
+        else
+            mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} ::${SDIMG_KERNELIMAGE} || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} into boot.img"
+        fi
+    fi
+    # -- Begin Xen deploy modification
+    mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/xen-${MACHINE} ::xen || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/xen-${MACHINE} into boot.img"
+    # -- End Xen deploy modification
+
+    if [ -n "${FATPAYLOAD}" ] ; then
+        echo "Copying payload into VFAT"
+        for entry in ${FATPAYLOAD} ; do
+            # use bbwarn instead of bbfatal to stop aborting on vfat issues like not supporting .~lock files
+            mcopy -v -i ${WORKDIR}/boot.img -s ${IMAGE_ROOTFS}$entry :: || bbwarn "mcopy cannot copy ${IMAGE_ROOTFS}$entry into boot.img"
+        done
+    fi
+
+    # Add stamp file
+    echo "${IMAGE_NAME}" > ${WORKDIR}/image-version-info
+    mcopy -v -i ${WORKDIR}/boot.img ${WORKDIR}/image-version-info :: || bbfatal "mcopy cannot copy ${WORKDIR}/image-version-info into boot.img"
+
+    # Deploy vfat partition
+    if [ "${SDIMG_VFAT_DEPLOY}" = "1" ]; then
+        cp ${WORKDIR}/boot.img ${IMGDEPLOYDIR}/${SDIMG_VFAT}
+        ln -sf ${SDIMG_VFAT} ${SDIMG_LINK_VFAT}
+    fi
+
+    # Burn Partitions
+    dd if=${WORKDIR}/boot.img of=${SDIMG} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024)
+    # If SDIMG_ROOTFS_TYPE is a .xz file use xzcat
+    if echo "${SDIMG_ROOTFS_TYPE}" | egrep -q "*\.xz"
+    then
+        xzcat ${SDIMG_ROOTFS} | dd of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024)
+    else
+        dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024)
+    fi
+}
conf/distro/include/meta-virt-xen.inc +3 -0
index 2ada83a..b4a20fe 100644
@@ -12,3 +12,6 @@ SERIAL_CONSOLES = "115200;hvc0"
 #  - Xen uses u-boot for configuration and uses the uart
 RPI_USE_U_BOOT = "1"
 ENABLE_UART = "1"
+# Build the bootable SD card image
+IMAGE_CLASSES_append_raspberrypi4-64 = " sdcard_image-rpi-xen"
+IMAGE_FSTYPES_append_raspberrypi4-64 = " rpi-xen-sdimg"
Signature · 1 line
2.17.1
#10 lore raw

PATCH 10/10 linux-raspberrypi: prefer kernel version 5.4

In reply to Christopher Clark

Aligns with Yocto's current kernel version.

---
 conf/distro/include/meta-virt-xen.inc | 2 ++
 1 file changed, 2 insertions(+)
conf/distro/include/meta-virt-xen.inc +2 -0
index b4a20fe..2c8ef0b 100644
@@ -15,3 +15,5 @@ ENABLE_UART = "1"
 # Build the bootable SD card image
 IMAGE_CLASSES_append_raspberrypi4-64 = " sdcard_image-rpi-xen"
 IMAGE_FSTYPES_append_raspberrypi4-64 = " rpi-xen-sdimg"
+# Align kernel version with current meta-virtualization kernel version
+PREFERRED_VERSION_linux-raspberrypi ?= "5.4.%"
Signature · 1 line
2.17.1
#11 lore raw
In reply to Christopher Clark
Quoted 11 lines · Christopher Clark

This series introduces support for running Xen on the Raspberry Pi 4 board, with meta-virtualization and meta-raspberrypi, using the linux-raspberrypi kernel at version 5.4 which is the current linux-yocto kernel version supported in this layer.

It introduces use of dynamic layers to handle configuration that is both Xen and Raspberry Pi specific, and inclusion of Xen-specific configuration when the 'xen' DISTRO_FEATURE is enabled to simplify Xen image builds.

Quoted 7 lines

It applies a backported set of Xen-specific Linux kernel patches, developed by upstream Xen developers working with the Linux Foundation Eve Project, that are currently being iterated on for inclusion in the Linux kernel.

Xen is uprev'd to version 4.13; this is currently compile-and-boot-tested only on this RPi4 board.

On my first pass through the series, I didn't see any issues. Everything is well organized and makes sense to me.

I'll do a really quick smoke test here, but I don't expect any issues.

Thanks for keeping this consolidated, the mechanisms you've added will be useful for a few things that I'm working on as well.

Cheers,

Bruce

Quoted 74 lines

Christopher

Christopher Clark (10):
xen: apply layer settings when xen DISTRO_FEATURE is enabled
xen-tools: add RRECOMENDS qemu on ARM and x86 when HVM is enabled
xen-tools: use non-busybox ifupdown tool if available xen, xen-tools: update revision to Xen 4.13 meta-virt-xen.inc: add Raspberry Pi settings
xen, raspberry pi: add dynamic-layer for Xen configuration for Rpi4 xen, raspberry pi 4: provide a default defconfig for raspberrypi4 xen, linux-raspberrypi: add Linux kernel 5.4 patches for Xen support xen, raspberry pi: add Xen-specific SD card class
linux-raspberrypi: prefer kernel version 5.4

 classes/meta-virt-xen-cfg.bbclass             |   6 +
 classes/sdcard_image-rpi-xen.bbclass          | 120 ++++
 conf/distro/include/meta-virt-xen.inc         |  19 +
 conf/layer.conf                               |  19 +-
 .../bootfiles/rpi-config_git.bbappend         |   6 +
 .../rpi-u-boot-scr/files/boot.cmd.xen.in      |  49 ++
 .../rpi-u-boot-scr/rpi-u-boot-scr.bbappend    |  17 +
 .../xen/files/defconfig_raspberrypi4-64       | 117 ++++
 .../recipes-extended/xen/xen_git.bbappend     |  11 +
 ...vmalloc_to_page-on-vmalloc-virt-addr.patch |  44 ++
 ...02-swiotlb-xen-remove-start_dma_addr.patch |  47 ++
 ...struct-device-parameter-to-xen_phys_.patch |  78 +++
 ...struct-device-parameter-to-xen_bus_t.patch |  66 +++
 ...struct-device-parameter-to-is_xen_sw.patch |  57 ++
 ...oduce-phys_to_dma-dma_to_phys-transl.patch |  88 +++
 ...translations-in-xen_dma_s_kernel_5.4.patch |  68 +++
 ..._to_phys-on-the-dma_addr_t-parameter.patch |  75 +++
 .../0011-adding-page-coherent-patch.patch     |  39 ++
 .../linux/linux-raspberrypi_%.bbappend        |   5 +
 .../linux/linux-raspberrypi_5.4.bbappend      |  19 +
 .../files/xen-tools-libxl-gentypes-py3.patch  | 140 -----
 ...tools-pygrub-change-tabs-into-spaces.patch |  40 --
 ...-python-scripts-work-with-2.6-and-up.patch | 529 ------------------
 .../xen/files/xen-tools-pygrub-py3.patch      | 233 --------
 ...ls-python-fix-Wsign-compare-warnings.patch | 136 -----
 ...n-tools-update-python-scripts-to-py3.patch | 140 -----
 recipes-extended/xen/xen-tools.inc            |  16 +
 recipes-extended/xen/xen-tools_git.bb         |  12 +-
 recipes-extended/xen/xen_git.bb               |   6 +-
 29 files changed, 971 insertions(+), 1231 deletions(-)
 create mode 100644 classes/meta-virt-xen-cfg.bbclass
 create mode 100644 classes/sdcard_image-rpi-xen.bbclass
 create mode 100644 conf/distro/include/meta-virt-xen.inc
 create mode 100644 dynamic-layers/raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend
 create mode 100644 dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in
 create mode 100644 dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend
 create mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/files/defconfig_raspberrypi4-64
 create mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/xen_git.bbappend
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0001-swiotlb-xen-use-vmalloc_to_page-on-vmalloc-virt-addr.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0002-swiotlb-xen-remove-start_dma_addr.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0003-swiotlb-xen-add-struct-device-parameter-to-xen_phys_.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0004-swiotlb-xen-add-struct-device-parameter-to-xen_bus_t.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0007-swiotlb-xen-add-struct-device-parameter-to-is_xen_sw.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0008-swiotlb-xen-introduce-phys_to_dma-dma_to_phys-transl.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0009-xen-arm-introduce-phys-dma-translations-in-xen_dma_s_kernel_5.4.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0010-xen-arm-call-dma_to_phys-on-the-dma_addr_t-parameter.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/files/0011-adding-page-coherent-patch.patch
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bbappend
 delete mode 100644 recipes-extended/xen/files/xen-tools-libxl-gentypes-py3.patch
 delete mode 100644 recipes-extended/xen/files/xen-tools-pygrub-change-tabs-into-spaces.patch
 delete mode 100644 recipes-extended/xen/files/xen-tools-pygrub-make-python-scripts-work-with-2.6-and-up.patch
 delete mode 100644 recipes-extended/xen/files/xen-tools-pygrub-py3.patch
 delete mode 100644 recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch
 delete mode 100644 recipes-extended/xen/files/xen-tools-update-python-scripts-to-py3.patch

--
2.17.1

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#12 lore raw

Hi Christopher / Bruce ,

I have rpi-4 setup & would like to do an smoke test.
I am starting with meta-virtualization & if you help me with below query :-
1) Should i try with (dunfell) branch for repo of poky , meta-openembedded , meta-virtualization , meta-raspberrypi
2) w.r.t series of 11 patches ( 00/10 to 10/10 ) shared by Christopher ,
is there any git from where i can clone the patches ( or is there any other way to clone the patches)

Apologies if i am missing any aspect here .

Thanks ,
Ashish

#13 lore raw
Quoted 6 lines · On Thu, Jun 25, 2020 at 9:25 PM Ashishx88 <[email protected]> wrote:

Hi Christopher / Bruce ,

I have rpi-4 setup & would like to do an smoke test.
I am starting with meta-virtualization & if you help me with below query :-
1) Should i try with (dunfell) branch for repo of poky , meta-openembedded , meta-virtualization , meta-raspberrypi

I've been working with local checkouts from the main development branch of each repo, ie. a copy of master, not from a release branch such as dunfell. I suggest testing with these revisions:

poky: 18b6b2ae819cbf0ef3858944b4cd02ab74df6607
meta-openembedded: 463f9a3ef0935d772a0be0437a8c09df64ed2f07
meta-raspberrypi: 5576a22061864bc451ec4fcacb7d830bf76b7ebd
meta-virtualization: d75bc448866d2b36779251efb1310d0234ece30b, plus this patch series applied on top, or clone the raspberry-pi4-xen-series branch from my repository (link below).

Unfortunately, I've just noticed that the versions of poky and meta-openembedded I've been working with above could do with being brought more up to date. I've just run a build with the tip of master of each, and that build is failing in both xen and xen-tools due to some interactions with the newer compiler (gcc 10.1.0-r0). I'll need to work out what's going on there.
Bruce: Sorry for missing that before posting this series.

Quoted 2 lines

2) w.r.t series of 11 patches ( 00/10 to 10/10 ) shared by Christopher ,
is there any git from where i can clone the patches ( or is there any other way to clone the patches)

Yes - I've just pushed a copy to my repository at github here:
https://github.com/dozylynx/meta-virtualization/tree/raspberry-pi4-xen-series

Quoted 1 line

Apologies if i am missing any aspect here .

Not at all - good questions.
thanks,

Christopher

Quoted 5 lines

Thanks ,
Ashish

#14 lore raw
Quoted 20 lines · Christopher Clark
Quoted 6 lines · On Thu, Jun 25, 2020 at 9:25 PM Ashishx88 <[email protected]> wrote:

Hi Christopher / Bruce ,

I have rpi-4 setup & would like to do an smoke test.
I am starting with meta-virtualization & if you help me with below query :-
1) Should i try with (dunfell) branch for repo of poky , meta-openembedded , meta-virtualization , meta-raspberrypi

I've been working with local checkouts from the main development branch of each repo, ie. a copy of master, not from a release branch such as dunfell. I suggest testing with these revisions:

poky: 18b6b2ae819cbf0ef3858944b4cd02ab74df6607
meta-openembedded: 463f9a3ef0935d772a0be0437a8c09df64ed2f07
meta-raspberrypi: 5576a22061864bc451ec4fcacb7d830bf76b7ebd
meta-virtualization: d75bc448866d2b36779251efb1310d0234ece30b, plus this patch series applied on top, or clone the raspberry-pi4-xen-series branch from my repository (link below).

Quoted 7 lines

Unfortunately, I've just noticed that the versions of poky and meta-openembedded I've been working with above could do with being brought more up to date. I've just run a build with the tip of master of each, and that build is failing in both xen and xen-tools due to some interactions with the newer compiler (gcc 10.1.0-r0). I'll need to work out what's going on there.
Bruce: Sorry for missing that before posting this series.

No worries.

I think you'll see a temp/WIP patch that I pushed for xen-tools to mask the warning / errors, but I hadn't completed the rest of my build/boot testing yet so may more be lurking (I'm trying to get a runtime test of runX on qemuarm64).

My patch of course isn't a solution, so feel free to revert and drop it in v2 of the series :D

Bruce

Quoted 19 lines
Quoted 3 lines

2) w.r.t series of 11 patches ( 00/10 to 10/10 ) shared by Christopher ,
is there any git from where i can clone the patches ( or is there any other way to clone the patches)

Yes - I've just pushed a copy to my repository at github here:
https://github.com/dozylynx/meta-virtualization/tree/raspberry-pi4-xen-series

Quoted 1 line

Apologies if i am missing any aspect here .

Not at all - good questions.
thanks,

Christopher

Quoted 5 lines

Thanks ,
Ashish

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#15 lore raw

Hi Christopher ,

I am able to compile  core-image-minimal &  xen-image-minimal images .

Would be trying to boot the board with these images for which :
- Are there any specific test that can help to confirm that xen aspect is proper ( like ifconfig & ping for ethernet )

-  Basically try to know by list of  check by which we can confirm XEN functionality on image.

Thanks ,
Ashish

#16 lore raw
Quoted 4 lines · On Fri, Jun 26, 2020 at 10:15 PM Ashishx88 <[email protected]>…

Hi Christopher ,

I am able to compile core-image-minimal & xen-image-minimal images .

Excellent. I've been using xen-image-minimal for
build-and-boot-testing this work so far.

Quoted 3 lines

Would be trying to boot the board with these images for which :
- Are there any specific test that can help to confirm that xen aspect is proper ( like ifconfig & ping for ethernet )

The Xen Project runs "Test Days" prior to releasing major Xen releases, where volunteers perform basic tests of Xen on their available hardware and report the results to the community and the release manager. The wiki page for this is here:
https://wiki.xen.org/wiki/Xen_Project_Test_Days

and there are several pages related to that, including:
- Xen ARM Manual Smoke Test: https://wiki.xen.org/wiki/Xen_ARM_Manual_Smoke_Test
- Testing Xen: https://wiki.xen.org/wiki/Testing_Xen

Xen 4.14 is approaching release, so there is testing activity at the moment.

The instructions on the pages above are not explicit test cases though, so some familiarity with Xen is assumed. I'll add a few notes below.

Quoted 1 line

- Basically try to know by list of check by which we can confirm XEN functionality on image.

* Booting:
You should be able to observe the boot console messages if you have a serial port connected. By default at the moment, you won't see much different to a non-Xen boot on the HDMI display. If boot is successful, on the display you will see four raspberries in the top left hand corner and be offered a login prompt.

* Simple commands to verify basic Xen functionality at the console:

xl list
This should show that Domain-0 is running.

xl info
This should display detailed version information about your hypervisor.

ls -l /dev/xen
This should list a series of xen-related devices, including privcmd.

xenstore-ls
This should show the contents of the xenstore tree.

dmesg | grep Xen
This should show the Linux kernel recognizing that it is running on Xen.

xl dmesg
This should show the Xen boot messages.

I'll be talking about running Xen with a Raspberry Pi 4 at the Yocto Project Dev Day virtual event on Thursday (2nd of July).
https://www.yoctoproject.org/yocto-project-dev-day-virtual-north-america-2020/
I would encourage you to attend if you're interested. (please note:
the specific time slot for this may vary on the day.)

thanks,

Christopher

Quoted 9 lines

Thanks ,
Ashish