From 132db950a044521e6189db06dfbe4ab0d14478dd Mon Sep 17 00:00:00 2001 From: Diego Sueiro Date: Wed, 8 Apr 2020 10:36:13 +0100 Subject: [PATCH] arm-autonomy: Add Xen specifics from meta-arm-bsp Variables, settings and operations specific to Xen should be located at meta-arm-autonomy. Change-Id: Ida86119e9d196ce8a498b53890b16fefaa3d8d8b Issue-Id: SCM-769 Signed-off-by: Diego Sueiro Reviewed-by: Bertrand Marquis Signed-off-by: Jon Mason --- .../boot-wrapper-aarch64_%.bbappend | 32 ++++++++ .../files/juno/images-r0.txt | 78 +++++++++++++++++++ .../files/juno/images-r1.txt | 78 +++++++++++++++++++ .../files/juno/images-r2.txt | 78 +++++++++++++++++++ .../trusted-firmware-a/files/juno/uEnv.txt | 15 ++++ .../trusted-firmware-a_2.%.bbappend | 13 ++++ .../0001-trace-fix-build-with-gcc9.patch | 56 +++++++++++++ ...e-number-of-interrupt-lines-for-dom0.patch | 44 +++++++++++ .../recipes-extended/xen/files/fvp/defconfig | 73 +++++++++++++++++ .../recipes-extended/xen/files/juno/defconfig | 73 +++++++++++++++++ .../recipes-extended/xen/xen_4.%.bbappend | 33 ++++++++ .../recipes-extended/xen/xen_4.12.0.bbappend | 10 +++ .../arm-autonomy/disable-arm64-sve.cfg | 4 + .../arm-autonomy/disable-arm64-sve.scc | 3 + .../linux/linux-arm-autonomy.inc | 14 +++- 15 files changed, 603 insertions(+), 1 deletion(-) create mode 100644 meta-arm-autonomy/recipes-bsp/boot-wrapper-aaarch64/boot-wrapper-aarch64_%.bbappend create mode 100644 meta-arm-autonomy/recipes-bsp/trusted-firmware-a/files/juno/images-r0.txt create mode 100644 meta-arm-autonomy/recipes-bsp/trusted-firmware-a/files/juno/images-r1.txt create mode 100644 meta-arm-autonomy/recipes-bsp/trusted-firmware-a/files/juno/images-r2.txt create mode 100644 meta-arm-autonomy/recipes-bsp/trusted-firmware-a/files/juno/uEnv.txt create mode 100644 meta-arm-autonomy/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.%.bbappend create mode 100644 meta-arm-autonomy/recipes-extended/xen/files/4.12.0/0001-trace-fix-build-with-gcc9.patch create mode 100644 meta-arm-autonomy/recipes-extended/xen/files/4.12.0/0001-xen-arm-Cap-the-number-of-interrupt-lines-for-dom0.patch create mode 100644 meta-arm-autonomy/recipes-extended/xen/files/fvp/defconfig create mode 100644 meta-arm-autonomy/recipes-extended/xen/files/juno/defconfig create mode 100644 meta-arm-autonomy/recipes-extended/xen/xen_4.%.bbappend create mode 100644 meta-arm-autonomy/recipes-extended/xen/xen_4.12.0.bbappend create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/disable-arm64-sve.cfg create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/disable-arm64-sve.scc diff --git a/meta-arm-autonomy/recipes-bsp/boot-wrapper-aaarch64/boot-wrapper-aarch64_%.bbappend b/meta-arm-autonomy/recipes-bsp/boot-wrapper-aaarch64/boot-wrapper-aarch64_%.bbappend new file mode 100644 index 00000000..3b93b3b7 --- /dev/null +++ b/meta-arm-autonomy/recipes-bsp/boot-wrapper-aaarch64/boot-wrapper-aarch64_%.bbappend @@ -0,0 +1,32 @@ +# Use OVERRIDES to minimize the usage of +# ${@bb.utils.contains('DISTRO_FEATURES', 'xen', ... +OVERRIDES_append = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ':xen', '', d)}" + +# Xen image to put in the image +# This should point to a file in the deploy image directory +BOOT_WRAPPER_AARCH64_XEN ??= "xen-${MACHINE}" + +# Xen command line for the image +BOOT_WRAPPER_AARCH64_XEN_CMDLINE ??= "noreboot dom0_mem=256M" + +BOOT_WRAPPER_AARCH64_XEN_CMDLINE_gem5-arm64 = "noreboot dom0_mem=256M console=dtuart \ + dtuart=/uart@1c090000 bootscrub=0" + +# Fix command line in the axf file for gem5-arm64 when Xen is present +BOOT_WRAPPER_AARCH64_CMDLINE_xen_gem5-arm64 = "console=hvc0 root=/dev/vda rw" + +# Image generated by boot wrapper when Xen is present +BOOT_WRAPPER_AARCH64_IMAGE_xen ?= "xen-system.axf" + +EXTRA_OECONF_append_xen = " \ +--with-xen=${WORKDIR}/kernel/arch/arm64/boot/Image \ +--with-xen-cmdline="" \ +" + +EXTRA_OEMAKE_append_xen = " \ +XEN_IMAGE=${DEPLOY_DIR_IMAGE}/${BOOT_WRAPPER_AARCH64_XEN} \ +XEN_CMDLINE="${BOOT_WRAPPER_AARCH64_XEN_CMDLINE}" \ +" + +# We need xen if it is activated +do_deploy[depends] += "${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'xen:do_deploy', '', d)}" diff --git a/meta-arm-autonomy/recipes-bsp/trusted-firmware-a/files/juno/images-r0.txt b/meta-arm-autonomy/recipes-bsp/trusted-firmware-a/files/juno/images-r0.txt new file mode 100644 index 00000000..177cf090 --- /dev/null +++ b/meta-arm-autonomy/recipes-bsp/trusted-firmware-a/files/juno/images-r0.txt @@ -0,0 +1,78 @@ +TITLE: Versatile Express Images Configuration File + +[IMAGES] +TOTALIMAGES: 11 ;Number of Images (Max: 32) + +NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR0ADDRESS: 0x00000000 ;Image Flash Address +NOR0FILE: \SOFTWARE\fip.bin ;Image File Name +NOR0LOAD: 00000000 ;Image Load Address +NOR0ENTRY: 00000000 ;Image Entry Point + +NOR1UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR1ADDRESS: 0x03EC0000 ;Image Flash Address +NOR1FILE: \SOFTWARE\bl1.bin ;Image File Name +NOR1LOAD: 00000000 ;Image Load Address +NOR1ENTRY: 00000000 ;Image Entry Point + +NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR2ADDRESS: 0x00500000 ;Image Flash Address +NOR2FILE: \SOFTWARE\Image ;Image File Name +NOR2NAME: norkern ;Rename kernel to norkern +NOR2LOAD: 00000000 ;Image Load Address +NOR2ENTRY: 00000000 ;Image Entry Point + +NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR3ADDRESS: 0x02700000 ;Image Flash Address +NOR3FILE: \SOFTWARE\juno.dtb ;Image File Name +NOR3NAME: board.dtb ;Specify target filename to preserve file extension +NOR3LOAD: 00000000 ;Image Load Address +NOR3ENTRY: 00000000 ;Image Entry Point + +NOR4UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR4ADDRESS: 0x01D00000 ;Image Flash Address +NOR4FILE: \SOFTWARE\xen ;Image File Name +NOR4NAME: xen +NOR4LOAD: 00000000 ;Image Load Address +NOR4ENTRY: 00000000 ;Image Entry Point + +NOR5UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR5ADDRESS: 0x025C0000 ;Image Flash Address +NOR5FILE: \SOFTWARE\hdlcdclk.dat ;Image File Name +NOR5LOAD: 00000000 ;Image Load Address +NOR5ENTRY: 00000000 ;Image Entry Point + +NOR6UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR6ADDRESS: 0x03E40000 ;Image Flash Address +NOR6FILE: \SOFTWARE\scp_bl1.bin ;Image File Name +NOR6LOAD: 00000000 ;Image Load Address +NOR6ENTRY: 00000000 ;Image Entry Point + +NOR7UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR7ADDRESS: 0x0BF00000 ;Image Flash Address +NOR7FILE: \SOFTWARE\startup.nsh ;Image File Name +NOR7NAME: startup.nsh +NOR7LOAD: 00000000 ;Image Load Address +NOR7ENTRY: 00000000 ;Image Entry Point + +NOR8UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR8ADDRESS: 0x0BFC0000 ;Image Flash Address +NOR8FILE: \SOFTWARE\blank.img ;Image File Name +NOR8NAME: BOOTENV +NOR8LOAD: 00000000 ;Image Load Address +NOR8ENTRY: 00000000 ;Image Entry Point + +NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR9ADDRESS: 0x02600000 ;Image Flash Address +NOR9FILE: \SOFTWARE\selftest ;Image File Name +NOR9LOAD: 00000000 ;Image Load Address +NOR9ENTRY: 00000000 ;Image Entry Point + +NOR10UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR10ADDRESS: 0x02780000 ;Image Flash Address +NOR10NAME: uEnv.txt +NOR10FILE: \SOFTWARE\uEnv.txt ;Image File Name +NOR10LOAD: 00000000 ;Image Load Address +NOR10ENTRY: 00000000 ;Image Entry Point + + diff --git a/meta-arm-autonomy/recipes-bsp/trusted-firmware-a/files/juno/images-r1.txt b/meta-arm-autonomy/recipes-bsp/trusted-firmware-a/files/juno/images-r1.txt new file mode 100644 index 00000000..ac40bf07 --- /dev/null +++ b/meta-arm-autonomy/recipes-bsp/trusted-firmware-a/files/juno/images-r1.txt @@ -0,0 +1,78 @@ +TITLE: Versatile Express Images Configuration File + +[IMAGES] +TOTALIMAGES: 11 ;Number of Images (Max: 32) + +NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR0ADDRESS: 0x00000000 ;Image Flash Address +NOR0FILE: \SOFTWARE\fip.bin ;Image File Name +NOR0LOAD: 00000000 ;Image Load Address +NOR0ENTRY: 00000000 ;Image Entry Point + +NOR1UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR1ADDRESS: 0x03EC0000 ;Image Flash Address +NOR1FILE: \SOFTWARE\bl1.bin ;Image File Name +NOR1LOAD: 00000000 ;Image Load Address +NOR1ENTRY: 00000000 ;Image Entry Point + +NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR2ADDRESS: 0x00500000 ;Image Flash Address +NOR2FILE: \SOFTWARE\Image ;Image File Name +NOR2NAME: norkern ;Rename kernel to norkern +NOR2LOAD: 00000000 ;Image Load Address +NOR2ENTRY: 00000000 ;Image Entry Point + +NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR3ADDRESS: 0x02700000 ;Image Flash Address +NOR3FILE: \SOFTWARE\juno-r1.dtb ;Image File Name +NOR3NAME: board.dtb ;Specify target filename to preserve file extension +NOR3LOAD: 00000000 ;Image Load Address +NOR3ENTRY: 00000000 ;Image Entry Point + +NOR4UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR4ADDRESS: 0x01D00000 ;Image Flash Address +NOR4FILE: \SOFTWARE\xen ;Image File Name +NOR4NAME: xen +NOR4LOAD: 00000000 ;Image Load Address +NOR4ENTRY: 00000000 ;Image Entry Point + +NOR5UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR5ADDRESS: 0x025C0000 ;Image Flash Address +NOR5FILE: \SOFTWARE\hdlcdclk.dat ;Image File Name +NOR5LOAD: 00000000 ;Image Load Address +NOR5ENTRY: 00000000 ;Image Entry Point + +NOR6UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR6ADDRESS: 0x03E40000 ;Image Flash Address +NOR6FILE: \SOFTWARE\scp_bl1.bin ;Image File Name +NOR6LOAD: 00000000 ;Image Load Address +NOR6ENTRY: 00000000 ;Image Entry Point + +NOR7UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR7ADDRESS: 0x0BF00000 ;Image Flash Address +NOR7FILE: \SOFTWARE\startup.nsh ;Image File Name +NOR7NAME: startup.nsh +NOR7LOAD: 00000000 ;Image Load Address +NOR7ENTRY: 00000000 ;Image Entry Point + +NOR8UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR8ADDRESS: 0x0BFC0000 ;Image Flash Address +NOR8FILE: \SOFTWARE\blank.img ;Image File Name +NOR8NAME: BOOTENV +NOR8LOAD: 00000000 ;Image Load Address +NOR8ENTRY: 00000000 ;Image Entry Point + +NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR9ADDRESS: 0x02600000 ;Image Flash Address +NOR9FILE: \SOFTWARE\selftest ;Image File Name +NOR9LOAD: 00000000 ;Image Load Address +NOR9ENTRY: 00000000 ;Image Entry Point + +NOR10UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR10ADDRESS: 0x02780000 ;Image Flash Address +NOR10NAME: uEnv.txt +NOR10FILE: \SOFTWARE\uEnv.txt ;Image File Name +NOR10LOAD: 00000000 ;Image Load Address +NOR10ENTRY: 00000000 ;Image Entry Point + + diff --git a/meta-arm-autonomy/recipes-bsp/trusted-firmware-a/files/juno/images-r2.txt b/meta-arm-autonomy/recipes-bsp/trusted-firmware-a/files/juno/images-r2.txt new file mode 100644 index 00000000..423a574a --- /dev/null +++ b/meta-arm-autonomy/recipes-bsp/trusted-firmware-a/files/juno/images-r2.txt @@ -0,0 +1,78 @@ +TITLE: Versatile Express Images Configuration File + +[IMAGES] +TOTALIMAGES: 11 ;Number of Images (Max: 32) + +NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR0ADDRESS: 0x00000000 ;Image Flash Address +NOR0FILE: \SOFTWARE\fip.bin ;Image File Name +NOR0LOAD: 00000000 ;Image Load Address +NOR0ENTRY: 00000000 ;Image Entry Point + +NOR1UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR1ADDRESS: 0x03EC0000 ;Image Flash Address +NOR1FILE: \SOFTWARE\bl1.bin ;Image File Name +NOR1LOAD: 00000000 ;Image Load Address +NOR1ENTRY: 00000000 ;Image Entry Point + +NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR2ADDRESS: 0x00500000 ;Image Flash Address +NOR2FILE: \SOFTWARE\Image ;Image File Name +NOR2NAME: norkern ;Rename kernel to norkern +NOR2LOAD: 00000000 ;Image Load Address +NOR2ENTRY: 00000000 ;Image Entry Point + +NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR3ADDRESS: 0x02700000 ;Image Flash Address +NOR3FILE: \SOFTWARE\juno-r2.dtb ;Image File Name +NOR3NAME: board.dtb ;Specify target filename to preserve file extension +NOR3LOAD: 00000000 ;Image Load Address +NOR3ENTRY: 00000000 ;Image Entry Point + +NOR4UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR4ADDRESS: 0x01D00000 ;Image Flash Address +NOR4FILE: \SOFTWARE\xen ;Image File Name +NOR4NAME: xen +NOR4LOAD: 00000000 ;Image Load Address +NOR4ENTRY: 00000000 ;Image Entry Point + +NOR5UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR5ADDRESS: 0x025C0000 ;Image Flash Address +NOR5FILE: \SOFTWARE\hdlcdclk.dat ;Image File Name +NOR5LOAD: 00000000 ;Image Load Address +NOR5ENTRY: 00000000 ;Image Entry Point + +NOR6UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR6ADDRESS: 0x03E40000 ;Image Flash Address +NOR6FILE: \SOFTWARE\scp_bl1.bin ;Image File Name +NOR6LOAD: 00000000 ;Image Load Address +NOR6ENTRY: 00000000 ;Image Entry Point + +NOR7UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR7ADDRESS: 0x0BF00000 ;Image Flash Address +NOR7FILE: \SOFTWARE\startup.nsh ;Image File Name +NOR7NAME: startup.nsh +NOR7LOAD: 00000000 ;Image Load Address +NOR7ENTRY: 00000000 ;Image Entry Point + +NOR8UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR8ADDRESS: 0x0BFC0000 ;Image Flash Address +NOR8FILE: \SOFTWARE\blank.img ;Image File Name +NOR8NAME: BOOTENV +NOR8LOAD: 00000000 ;Image Load Address +NOR8ENTRY: 00000000 ;Image Entry Point + +NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR9ADDRESS: 0x02600000 ;Image Flash Address +NOR9FILE: \SOFTWARE\selftest ;Image File Name +NOR9LOAD: 00000000 ;Image Load Address +NOR9ENTRY: 00000000 ;Image Entry Point + +NOR10UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE +NOR10ADDRESS: 0x02780000 ;Image Flash Address +NOR10NAME: uEnv.txt +NOR10FILE: \SOFTWARE\uEnv.txt ;Image File Name +NOR10LOAD: 00000000 ;Image Load Address +NOR10ENTRY: 00000000 ;Image Entry Point + + diff --git a/meta-arm-autonomy/recipes-bsp/trusted-firmware-a/files/juno/uEnv.txt b/meta-arm-autonomy/recipes-bsp/trusted-firmware-a/files/juno/uEnv.txt new file mode 100644 index 00000000..4307b696 --- /dev/null +++ b/meta-arm-autonomy/recipes-bsp/trusted-firmware-a/files/juno/uEnv.txt @@ -0,0 +1,15 @@ +xen_name=xen +xen_addr=0x84000000 +uenvcmd=run mybootcmd +mybootcmd=echo Loading custom boot command; \ +echo Loading kernel; \ +afs load ${kernel_name} ${kernel_addr} ; \ +if test $? -eq 1; then echo Loading ${kernel_alt_name} instead of ${kernel_name}; afs load ${kernel_alt_name} ${kernel_addr}; fi; \ +echo Loading device tree; \ +afs load ${fdtfile} ${fdt_addr}; \ +if test $? -eq 1; then echo Loading ${fdt_alt_name} instead of ${fdtfile}; \ +afs load ${fdt_alt_name} ${fdt_addr}; fi; fdt addr ${fdt_addr}; fdt resize; \ +echo Loading Xen; \ +afs load ${xen_name} ${xen_addr}; \ +if test $? -eq 0; then echo Booting Xen; bootefi ${xen_addr} ${fdt_addr}; fi; + diff --git a/meta-arm-autonomy/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.%.bbappend b/meta-arm-autonomy/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.%.bbappend new file mode 100644 index 00000000..49a82288 --- /dev/null +++ b/meta-arm-autonomy/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.%.bbappend @@ -0,0 +1,13 @@ +FILESEXTRAPATHS_prepend_juno := "${@bb.utils.contains('DISTRO_FEATURES', 'xen', '${THISDIR}/files/juno:', '', d)}" + +JUNO_EXTRA_DEPS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' xen:do_deploy', '', d)}" + +do_deploy_append_juno() { + + if [ "${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'yes', 'no', d)}" = "yes" ]; then + cp -a \ + ${DEPLOY_DIR_IMAGE}/xen-${COMPATIBLE_MACHINE}.efi \ + ${WORKDIR}/juno-oe-uboot/SOFTWARE/xen + fi + +} diff --git a/meta-arm-autonomy/recipes-extended/xen/files/4.12.0/0001-trace-fix-build-with-gcc9.patch b/meta-arm-autonomy/recipes-extended/xen/files/4.12.0/0001-trace-fix-build-with-gcc9.patch new file mode 100644 index 00000000..8ecc904e --- /dev/null +++ b/meta-arm-autonomy/recipes-extended/xen/files/4.12.0/0001-trace-fix-build-with-gcc9.patch @@ -0,0 +1,56 @@ +From 0dcd945a675cd12d283121e9b7f1626104b60bcc Mon Sep 17 00:00:00 2001 +From: Jan Beulich +Date: Tue, 4 Jun 2019 15:32:55 +0200 +Subject: [PATCH] trace: fix build with gcc9 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +While I've not observed this myself, gcc 9 (imo validly) reportedly may +complain + +trace.c: In function '__trace_hypercall': +trace.c:826:19: error: taking address of packed member of 'struct ' may result in an unaligned pointer value [-Werror=address-of-packed-member] + 826 | uint32_t *a = d.args; + +and the fix is rather simple - remove the __packed attribute. Introduce +a BUILD_BUG_ON() as replacement, for the unlikely case that Xen might +get ported to an architecture where array alignment higher that that of +its elements. + +Reported-by: Martin Liška +Signed-off-by: Jan Beulich +Acked-by: George Dunlap +master commit: 3fd3b266d4198c06e8e421ca515d9ba09ccd5155 +master date: 2019-05-13 09:51:23 +0200 +--- + xen/common/trace.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/xen/common/trace.c b/xen/common/trace.c +index cc294fc384..d1ef81407b 100644 +--- a/xen/common/trace.c ++++ b/xen/common/trace.c +@@ -819,12 +819,18 @@ unlock: + void __trace_hypercall(uint32_t event, unsigned long op, + const xen_ulong_t *args) + { +- struct __packed { ++ struct { + uint32_t op; + uint32_t args[6]; + } d; + uint32_t *a = d.args; + ++ /* ++ * In lieu of using __packed above, which gcc9 legitimately doesn't ++ * like in combination with the address of d.args[] taken. ++ */ ++ BUILD_BUG_ON(offsetof(typeof(d), args) != sizeof(d.op)); ++ + #define APPEND_ARG32(i) \ + do { \ + unsigned i_ = (i); \ +-- +2.17.1 + diff --git a/meta-arm-autonomy/recipes-extended/xen/files/4.12.0/0001-xen-arm-Cap-the-number-of-interrupt-lines-for-dom0.patch b/meta-arm-autonomy/recipes-extended/xen/files/4.12.0/0001-xen-arm-Cap-the-number-of-interrupt-lines-for-dom0.patch new file mode 100644 index 00000000..792bc9ea --- /dev/null +++ b/meta-arm-autonomy/recipes-extended/xen/files/4.12.0/0001-xen-arm-Cap-the-number-of-interrupt-lines-for-dom0.patch @@ -0,0 +1,44 @@ +From a41feccdb6c03f12bddb4fb650a0465f0ed6eeca Mon Sep 17 00:00:00 2001 +From: Lukas Juenger +Date: Fri, 5 Apr 2019 15:54:04 +0200 +Subject: [PATCH] xen/arm: Cap the number of interrupt lines for dom0 + +Dom0 vGIC will use the same number of interrupt lines as the hardware GIC. +While the hardware GIC can support up to 1020 interrupt lines, +the vGIC is only supporting up to 992 interrupt lines. +This means that Xen will not be able to boot on platforms where the hardware +GIC supports more than 992 interrupt lines. +While it would make sense to increase the limits in the vGICs, this is not +trivial because of the design choices. +At the moment, only models seem to report the maximum of interrupt lines. +They also do not have any interrupt wired above the 992 limit. +So it should be fine to cap the number of interrupt lines for dom0 to 992 lines. + +Signed-off-by: Lukas Juenger +Acked-by: Julien Grall +--- + xen/arch/arm/setup.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c +index 444857a967..ccb0f181ea 100644 +--- a/xen/arch/arm/setup.c ++++ b/xen/arch/arm/setup.c +@@ -888,7 +888,13 @@ void __init start_xen(unsigned long boot_phys_offset, + /* Create initial domain 0. */ + /* The vGIC for DOM0 is exactly emulating the hardware GIC */ + dom0_cfg.arch.gic_version = XEN_DOMCTL_CONFIG_GIC_NATIVE; +- dom0_cfg.arch.nr_spis = gic_number_lines() - 32; ++ /* ++ * Xen vGIC supports a maximum of 992 interrupt lines. ++ * 32 are substracted to cover local IRQs. ++ */ ++ dom0_cfg.arch.nr_spis = min(gic_number_lines(), (unsigned int) 992) - 32; ++ if ( gic_number_lines() > 992 ) ++ printk(XENLOG_WARNING "Maximum number of vGIC IRQs exceeded.\n"); + dom0_cfg.max_vcpus = dom0_max_vcpus(); + + dom0 = domain_create(0, &dom0_cfg, true); +-- +2.17.1 + diff --git a/meta-arm-autonomy/recipes-extended/xen/files/fvp/defconfig b/meta-arm-autonomy/recipes-extended/xen/files/fvp/defconfig new file mode 100644 index 00000000..f13327c1 --- /dev/null +++ b/meta-arm-autonomy/recipes-extended/xen/files/fvp/defconfig @@ -0,0 +1,73 @@ +# +# Automatically generated file; DO NOT EDIT. +# Xen/arm 4.12.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_GICV3=y +CONFIG_HVM=y +# CONFIG_NEW_VGIC is not set +CONFIG_SBSA_VUART_CONSOLE=y +CONFIG_ARM_SSBD=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y + +# +# 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_HAS_ALTERNATIVE=y +CONFIG_HAS_DEVICE_TREE=y +CONFIG_MEM_ACCESS=y +CONFIG_HAS_PDX=y +# CONFIG_XSM is not set +CONFIG_SCHED_CREDIT=y +CONFIG_SCHED_CREDIT2=y +CONFIG_SCHED_RTDS=y +# CONFIG_SCHED_ARINC653 is not set +CONFIG_SCHED_NULL=y +CONFIG_SCHED_DEFAULT="credit2" +# CONFIG_LIVEPATCH is not set +CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS=y +CONFIG_CMDLINE="" +CONFIG_DOM0_MEM="" + +# +# Device Drivers +# +CONFIG_HAS_NS16550=y +CONFIG_HAS_CADENCE_UART=y +CONFIG_HAS_MVEBU=y +CONFIG_HAS_PL011=y +CONFIG_HAS_SCIF=y +CONFIG_HAS_PASSTHROUGH=y +CONFIG_ARM_SMMU=y +CONFIG_DEFCONFIG_LIST="arch/arm/configs/arm64_defconfig" + +# +# Debugging Options +# +# CONFIG_DEBUG is not set diff --git a/meta-arm-autonomy/recipes-extended/xen/files/juno/defconfig b/meta-arm-autonomy/recipes-extended/xen/files/juno/defconfig new file mode 100644 index 00000000..f13327c1 --- /dev/null +++ b/meta-arm-autonomy/recipes-extended/xen/files/juno/defconfig @@ -0,0 +1,73 @@ +# +# Automatically generated file; DO NOT EDIT. +# Xen/arm 4.12.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_GICV3=y +CONFIG_HVM=y +# CONFIG_NEW_VGIC is not set +CONFIG_SBSA_VUART_CONSOLE=y +CONFIG_ARM_SSBD=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y + +# +# 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_HAS_ALTERNATIVE=y +CONFIG_HAS_DEVICE_TREE=y +CONFIG_MEM_ACCESS=y +CONFIG_HAS_PDX=y +# CONFIG_XSM is not set +CONFIG_SCHED_CREDIT=y +CONFIG_SCHED_CREDIT2=y +CONFIG_SCHED_RTDS=y +# CONFIG_SCHED_ARINC653 is not set +CONFIG_SCHED_NULL=y +CONFIG_SCHED_DEFAULT="credit2" +# CONFIG_LIVEPATCH is not set +CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS=y +CONFIG_CMDLINE="" +CONFIG_DOM0_MEM="" + +# +# Device Drivers +# +CONFIG_HAS_NS16550=y +CONFIG_HAS_CADENCE_UART=y +CONFIG_HAS_MVEBU=y +CONFIG_HAS_PL011=y +CONFIG_HAS_SCIF=y +CONFIG_HAS_PASSTHROUGH=y +CONFIG_ARM_SMMU=y +CONFIG_DEFCONFIG_LIST="arch/arm/configs/arm64_defconfig" + +# +# Debugging Options +# +# CONFIG_DEBUG is not set diff --git a/meta-arm-autonomy/recipes-extended/xen/xen_4.%.bbappend b/meta-arm-autonomy/recipes-extended/xen/xen_4.%.bbappend new file mode 100644 index 00000000..e7ddce99 --- /dev/null +++ b/meta-arm-autonomy/recipes-extended/xen/xen_4.%.bbappend @@ -0,0 +1,33 @@ +# xen settings + +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +# +# Define early console based on board parameters +# + +XEN_CONFIG_EARLY_PRINTK ??= "disable" + +# Machine specific settings +XEN_CONFIG_EARLY_PRINTK_juno = "juno" +XEN_CONFIG_EARLY_PRINTK_gem5-arm64 = "vexpress" +XEN_CONFIG_EARLY_PRINTK_fvp-base = "fastmodel" +XEN_CONFIG_EARLY_PRINTK_foundation-armv8 = "fastmodel" + +EXTRA_OEMAKE += "${@bb.utils.contains('XEN_CONFIG_EARLY_PRINTK', 'disable', \ + '', ' CONFIG_DEBUG=y CONFIG_EARLY_PRINTK=${XEN_CONFIG_EARLY_PRINTK}',d)}" + +# Foundation-armv8 support +COMPATIBLE_MACHINE_foundation-armv8 = "foundation-armv8" + +SRC_URI_append_foundation-armv8 = " file://fvp/defconfig" + +# FVP Base support +COMPATIBLE_MACHINE_fvp-base = "fvp-base" + +SRC_URI_append_fvp-base = " file://fvp/defconfig" + +# Juno support +COMPATIBLE_MACHINE_juno = "juno" + +SRC_URI_append_juno = " file://juno/defconfig" diff --git a/meta-arm-autonomy/recipes-extended/xen/xen_4.12.0.bbappend b/meta-arm-autonomy/recipes-extended/xen/xen_4.12.0.bbappend new file mode 100644 index 00000000..87b1f63b --- /dev/null +++ b/meta-arm-autonomy/recipes-extended/xen/xen_4.12.0.bbappend @@ -0,0 +1,10 @@ +# xen version specific patch information + +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +# Solve trace.c compilation error on 4.12.0 +# This should only be applied for 4.12.0 (solved in greater versions) +SRC_URI += "file://4.12.0/0001-trace-fix-build-with-gcc9.patch" + +# Fix problem with number of interrupts on gem5 +SRC_URI_append_gem5-arm64 = " file://4.12.0/0001-xen-arm-Cap-the-number-of-interrupt-lines-for-dom0.patch" diff --git a/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/disable-arm64-sve.cfg b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/disable-arm64-sve.cfg new file mode 100644 index 00000000..7e87cab4 --- /dev/null +++ b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/disable-arm64-sve.cfg @@ -0,0 +1,4 @@ +# We need to turn off SVE support in the Linux kernel otherwise Xen is stopping +# Linux kernel with a coredump while trying to access ZEN bit of CPACR1 core +# register. +# CONFIG_ARM64_SVE is not set diff --git a/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/disable-arm64-sve.scc b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/disable-arm64-sve.scc new file mode 100644 index 00000000..6bc769cc --- /dev/null +++ b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/disable-arm64-sve.scc @@ -0,0 +1,3 @@ +define KFEATURE_DESCRIPTION "Disable SVE support" + +kconf non-hardware disable-arm64-sve.cfg diff --git a/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc b/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc index 8191079a..bb489502 100644 --- a/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc +++ b/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc @@ -1,12 +1,24 @@ # Add arm-autonomy specific features to the kernel -FILESEXTRAPATHS_prepend := "${THISDIR}:" +FILESEXTRAPATHS_prepend := "${THISDIR}:${THISDIR}/files:" # # arm-autonomy kmeta # SRC_URI_append = " file://arm-autonomy-kmeta;type=kmeta;name=arm-autonomy-kmeta;destsuffix=arm-autonomy-kmeta" +# We need to turn off SVE support in the Linux kernel otherwise Xen is stopping +# Linux kernel with a coredump while trying to access XEN bit of CPACR1 core +# register. +LINUX_ARM_AUTONOMY_DISABLE_ARM64_SVE = "${@bb.utils.contains_any('DISTRO_FEATURES', \ + 'arm-autonomy-host arm-autonomy-guest', \ + ' features/arm-autonomy/disable-arm64-sve.scc','',d)}" + +KERNEL_FEATURES_append_gem5-arm64 = "${LINUX_ARM_AUTONOMY_DISABLE_ARM64_SVE}" +KERNEL_FEATURES_append_fvp-base = "${LINUX_ARM_AUTONOMY_DISABLE_ARM64_SVE}" +KERNEL_FEATURES_append_foundation-armv8 = "${LINUX_ARM_AUTONOMY_DISABLE_ARM64_SVE}" + + # Add xen host drivers to kernel if arm-autonomy-host is activated KERNEL_FEATURES += "${@bb.utils.contains('DISTRO_FEATURES', \ 'arm-autonomy-host', 'features/arm-autonomy/xen-host.scc', '', d)}"