All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes
@ 2022-05-21 19:04 Christopher Clark
  2022-05-21 19:04 ` [meta-virtualization][gatesgarth][PATCH 1/3] linux-yocto-dev, raspberrypi: apply fixed revision to kernel Christopher Clark
                   ` (12 more replies)
  0 siblings, 13 replies; 20+ messages in thread
From: Christopher Clark @ 2022-05-21 19:04 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe, Bertrand.Marquis

A series of fixes applied to master and across stable branches where
needed to fix running Xen on the Raspberry Pi 4 board.

This updates Linux kernel configuration for Xen to remove tracking from
the linux-yocto-dev kernel, either by applying a fixed revision and
specification of a stable branch or replacing it with the linux-yocto
kernel. The Xen build configuration is updated to remove the hypervisor
defconfig for the Raspberry Pi and drop the arm64 prelink patch as a
license correction and since the build no longer needs it with the newer
gcc toolchain.

Tested on hardware.

Christopher Clark

gatesgarth:
  01: linux-yocto-dev, raspberrypi: apply fixed revision to kernel
  02: xen: drop patch to workaround prelink on aarch64
  03: xen: fix boot on the Raspberry Pi 4

hardknott:
  04: linux-yocto-dev, raspberrypi: apply fixed revision to kernel
  05: xen: drop patch to workaround prelink on aarch64
  06: xen: fix boot on the Raspberry Pi 4

honister:
  07: linux-yocto-dev, xen, raspberrypi: remove tracking bbappend
  08: xen: drop patch to workaround prelink on aarch64
  09: xen: fix boot on the Raspberry Pi 4 with Xen 4.14

kirkstone:
  10: xen, raspberry pi: replace linux-yocto-dev with linux-yocto 5.15

master:
  11: xen, raspberry pi: replace linux-yocto-dev with linux-yocto 5.15


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [meta-virtualization][gatesgarth][PATCH 1/3] linux-yocto-dev, raspberrypi: apply fixed revision to kernel
  2022-05-21 19:04 [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Christopher Clark
@ 2022-05-21 19:04 ` Christopher Clark
  2022-05-21 19:04 ` [meta-virtualization][gatesgarth][PATCH 2/3] xen: drop patch to workaround prelink on aarch64 Christopher Clark
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Christopher Clark @ 2022-05-21 19:04 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe, Bertrand.Marquis

The default preferred Linux kernel for Xen on the Raspberry Pi 4
board in this branch is linux-yocto-dev, which unfortunately results
in a branch tracking configuration rather than a fixed revision.

Apply a specified revision from the 5.10/standard/bcm-2xxx-rpi
branch, per the kernel version for this release, and disable tracking.
Revision is the current tip of v5.10/standard/bcm-2xxx-rpi branch,
tested and verified working on the board.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
---
 .../recipes-kernel/linux/linux-yocto-dev.bbappend         | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
index 85d6feb..9f5677f 100644
--- a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
+++ b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -5,6 +5,12 @@ DEFAULT_CMDLINE := "${CMDLINE}"
 XEN_LINUX_CMDLINE ?= "console=hvc0 clk_ignore_unused earlycon=xenboot debug root=/dev/mmcblk0p2 rootwait"
 CMDLINE = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', '${XEN_LINUX_CMDLINE}', '${DEFAULT_CMDLINE}', d)}"
 
-KBRANCH_raspberrypi4-64 = "standard/bcm-2xxx-rpi"
+KBRANCH_raspberrypi4-64 = "v5.10/standard/bcm-2xxx-rpi"
 KMACHINE_raspberrypi4-64 = "bcm-2xxx-rpi4"
 COMPATIBLE_MACHINE_raspberrypi4-64 = "(raspberrypi4-64)"
+
+# Tip of v5.10/standard/bcm-2xxx-rpi
+SRCREV_machine_raspberrypi4-64 = "d172dd50154d2849e87d8acdedd073cf36ebde0b"
+
+# Tip of master:
+SRCREV_meta_raspberrypi4-64 = "942a3a2cc192a8b2e38a7fef4a40249c79f5c9f5"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [meta-virtualization][gatesgarth][PATCH 2/3] xen: drop patch to workaround prelink on aarch64
  2022-05-21 19:04 [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Christopher Clark
  2022-05-21 19:04 ` [meta-virtualization][gatesgarth][PATCH 1/3] linux-yocto-dev, raspberrypi: apply fixed revision to kernel Christopher Clark
@ 2022-05-21 19:04 ` Christopher Clark
  2022-05-21 19:04 ` [meta-virtualization][gatesgarth][PATCH 3/3] xen: fix boot on the Raspberry Pi 4 Christopher Clark
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Christopher Clark @ 2022-05-21 19:04 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe, Bertrand.Marquis

Patch is not needed for image prelinking since the gcc toolchain
in this branch successfully links Xen without it.

Remove the patch from the stable branch since the BSD license of the
modified header file differs vs the GPLv2 source code referenced.
Removal preferred to replacement with a new patch that moves the function
into GPLv2 .c source files since the build now succeeds without it.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
---
 ...xen-arm64-implement-atomic-fetch-add.patch | 50 -------------------
 recipes-extended/xen/xen_4.14.bb              |  1 -
 recipes-extended/xen/xen_git.bb               |  1 -
 3 files changed, 52 deletions(-)
 delete mode 100644 recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch

diff --git a/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch b/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch
deleted file mode 100644
index 6e957a5..0000000
--- a/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Christopher Clark <christopher.w.clark@gmail.com>
-Date: Fri, 26 June 2020 16:34:00 -0800
-Subject: [PATCH] xen: implement atomic op to fix arm64 compilation
-
-Xen's ARM implementation of arch_fetch_and_add since f9cc3cd9
-uses a builtin, despite the build being performed with -fno-builtin.
-With gcc 10.1.0, this now breaks prelinking spinlock.c, so
-implement the one atomic operation that is required with logic
-derived from Linux's atomic_ll_sc.h: ATOMIC_FETCH_OP and comparison with
-the binary produced with and without the patch with gcc 9.2.0.
-
-Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
-diff --git a/xen/include/asm-arm/system.h b/xen/include/asm-arm/system.h
-index e5d062667d..c46dd3ac71 100644
---- a/xen/include/asm-arm/system.h
-+++ b/xen/include/asm-arm/system.h
-@@ -55,7 +55,32 @@ static inline int local_abort_is_enabled(void)
-     return !(flags & PSR_ABT_MASK);
- }
- 
-+#ifdef CONFIG_ARM_64
-+
-+/* see atomic_ll_sc.h:  ATOMIC_FETCH_OP(name, mb, acq, rel, cl, op, asm_op, constraint) */
-+static inline int arch_fetch_and_add(unsigned int *ptr, unsigned long i)
-+{
-+    int register lptr asm("x0");
-+    int register result asm("w1");
-+    int register newval asm("w2");
-+    int register status asm("w3");
-+
-+    asm volatile(
-+    "   mov       %[lptr], %[ptr]\n"
-+    "1: ldxr      %w[result], [%[lptr]]\n"
-+    "   add       %w[newval], %w[result], %w[i]\n"
-+    "   stlxr     %w[status], %w[newval], [%[lptr]]\n"
-+    "   cbnz      %w[status], 1b\n"
-+    "   dmb       ish\n"
-+    : [result] "=&r" (result), [lptr] "=&r" (lptr), [newval] "=&r" (newval), [status] "=&r" (status), [i] "+r" (i), "+Q" (*ptr)
-+    : [ptr] "r" (ptr), "r" (i)
-+    : "memory");
-+
-+    return result;
-+}
-+#else
- #define arch_fetch_and_add(x, v) __sync_fetch_and_add(x, v)
-+#endif
- 
- extern struct vcpu *__context_switch(struct vcpu *prev, struct vcpu *next);
- 
diff --git a/recipes-extended/xen/xen_4.14.bb b/recipes-extended/xen/xen_4.14.bb
index 653e3b6..6ac3236 100644
--- a/recipes-extended/xen/xen_4.14.bb
+++ b/recipes-extended/xen/xen_4.14.bb
@@ -5,7 +5,6 @@ XEN_BRANCH ?= "stable-${XEN_REL}"
 
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
-    file://xen-arm64-implement-atomic-fetch-add.patch \
     file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
     "
 
diff --git a/recipes-extended/xen/xen_git.bb b/recipes-extended/xen/xen_git.bb
index 2b62c5c..fba12e5 100644
--- a/recipes-extended/xen/xen_git.bb
+++ b/recipes-extended/xen/xen_git.bb
@@ -5,7 +5,6 @@ XEN_BRANCH ?= "master"
 
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
-    file://xen-arm64-implement-atomic-fetch-add.patch \
     file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
     "
 
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [meta-virtualization][gatesgarth][PATCH 3/3] xen: fix boot on the Raspberry Pi 4
  2022-05-21 19:04 [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Christopher Clark
  2022-05-21 19:04 ` [meta-virtualization][gatesgarth][PATCH 1/3] linux-yocto-dev, raspberrypi: apply fixed revision to kernel Christopher Clark
  2022-05-21 19:04 ` [meta-virtualization][gatesgarth][PATCH 2/3] xen: drop patch to workaround prelink on aarch64 Christopher Clark
@ 2022-05-21 19:04 ` Christopher Clark
  2022-05-21 19:04 ` [meta-virtualization][hardknott][PATCH 1/3] linux-yocto-dev, raspberrypi: apply fixed revision to kernel Christopher Clark
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Christopher Clark @ 2022-05-21 19:04 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe, Bertrand.Marquis

Apply the patch from Xen to fix device tree parsing in newer kernels
and remove the Xen configuration file since the default works.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
---
 .../xen/files/defconfig_raspberrypi4-64       | 117 ------------------
 .../recipes-extended/xen/xen_git.bbappend     |  11 --
 ...issing-device_type-property-in-pci-p.patch |  91 ++++++++++++++
 recipes-extended/xen/xen_4.14.bb              |   1 +
 recipes-extended/xen/xen_git.bb               |   1 +
 5 files changed, 93 insertions(+), 128 deletions(-)
 delete mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/files/defconfig_raspberrypi4-64
 delete mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/xen_git.bbappend
 create mode 100644 recipes-extended/xen/files/0001-xen-workaround-missing-device_type-property-in-pci-p.patch

diff --git a/dynamic-layers/raspberrypi/recipes-extended/xen/files/defconfig_raspberrypi4-64 b/dynamic-layers/raspberrypi/recipes-extended/xen/files/defconfig_raspberrypi4-64
deleted file mode 100644
index f3343d3..0000000
--- a/dynamic-layers/raspberrypi/recipes-extended/xen/files/defconfig_raspberrypi4-64
+++ /dev/null
@@ -1,117 +0,0 @@
-#
-# 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
diff --git a/dynamic-layers/raspberrypi/recipes-extended/xen/xen_git.bbappend b/dynamic-layers/raspberrypi/recipes-extended/xen/xen_git.bbappend
deleted file mode 100644
index 995dfd3..0000000
--- a/dynamic-layers/raspberrypi/recipes-extended/xen/xen_git.bbappend
+++ /dev/null
@@ -1,11 +0,0 @@
-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
-}
diff --git a/recipes-extended/xen/files/0001-xen-workaround-missing-device_type-property-in-pci-p.patch b/recipes-extended/xen/files/0001-xen-workaround-missing-device_type-property-in-pci-p.patch
new file mode 100644
index 0000000..09a461b
--- /dev/null
+++ b/recipes-extended/xen/files/0001-xen-workaround-missing-device_type-property-in-pci-p.patch
@@ -0,0 +1,91 @@
+From 5a4087004d1adbbb223925f3306db0e5824a2bdc Mon Sep 17 00:00:00 2001
+From: Stefano Stabellini <sstabellini@kernel.org>
+Date: Tue, 9 Feb 2021 11:53:34 -0800
+Subject: [PATCH] xen: workaround missing device_type property in pci/pcie
+ nodes
+
+PCI buses differ from default buses in a few important ways, so it is
+important to detect them properly. Normally, PCI buses are expected to
+have the following property:
+
+    device_type = "pci"
+
+In reality, it is not always the case. To handle PCI bus nodes that
+don't have the device_type property, also consider the node name: if the
+node name is "pcie" or "pci" then consider the bus as a PCI bus.
+
+This commit is based on the Linux kernel commit
+d1ac0002dd29 "of: address: Work around missing device_type property in
+pcie nodes".
+
+This fixes Xen boot on RPi4. Some RPi4 kernels have the following node
+on their device trees:
+
+&pcie0 {
+	pci@1,0 {
+		#address-cells = <3>;
+		#size-cells = <2>;
+		ranges;
+
+		reg = <0 0 0 0 0>;
+
+		usb@1,0 {
+			reg = <0x10000 0 0 0 0>;
+			resets = <&reset RASPBERRYPI_FIRMWARE_RESET_ID_USB>;
+		};
+	};
+};
+
+The pci@1,0 node is a PCI bus. If we parse the node and its children as
+a default bus, the reg property under usb@1,0 would have to be
+interpreted as an address range mappable by the CPU, which is not the
+case and would break.
+
+Link: https://lore.kernel.org/xen-devel/YBmQQ3Tzu++AadKx@mattapan.m5p.com/
+[fix style on commit]
+Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
+Tested-by: Elliott Mitchell <ehem+xen@m5p.com>
+Tested-by: Jukka Kaartinen <jukka.kaartinen@unikie.com>
+Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
+Acked-by: Julien Grall <jgrall@amazon.com>
+---
+ xen/common/device_tree.c | 16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
+index 18825e333e..03d25a81ce 100644
+--- a/xen/common/device_tree.c
++++ b/xen/common/device_tree.c
+@@ -563,14 +563,28 @@ static unsigned int dt_bus_default_get_flags(const __be32 *addr)
+  * PCI bus specific translator
+  */
+ 
++static bool dt_node_is_pci(const struct dt_device_node *np)
++{
++    bool is_pci = !strcmp(np->name, "pcie") || !strcmp(np->name, "pci");
++
++    if ( is_pci )
++        printk(XENLOG_WARNING "%s: Missing device_type\n", np->full_name);
++
++    return is_pci;
++}
++
+ static bool_t dt_bus_pci_match(const struct dt_device_node *np)
+ {
+     /*
+      * "pciex" is PCI Express "vci" is for the /chaos bridge on 1st-gen PCI
+      * powermacs "ht" is hypertransport
++     *
++     * If none of the device_type match, and that the node name is
++     * "pcie" or "pci", accept the device as PCI (with a warning).
+      */
+     return !strcmp(np->type, "pci") || !strcmp(np->type, "pciex") ||
+-        !strcmp(np->type, "vci") || !strcmp(np->type, "ht");
++        !strcmp(np->type, "vci") || !strcmp(np->type, "ht") ||
++        dt_node_is_pci(np);
+ }
+ 
+ static void dt_bus_pci_count_cells(const struct dt_device_node *np,
+-- 
+2.25.1
+
diff --git a/recipes-extended/xen/xen_4.14.bb b/recipes-extended/xen/xen_4.14.bb
index 6ac3236..14dd54a 100644
--- a/recipes-extended/xen/xen_4.14.bb
+++ b/recipes-extended/xen/xen_4.14.bb
@@ -6,6 +6,7 @@ XEN_BRANCH ?= "stable-${XEN_REL}"
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
     file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
+    file://0001-xen-workaround-missing-device_type-property-in-pci-p.patch \
     "
 
 LIC_FILES_CHKSUM ?= "file://COPYING;md5=419739e325a50f3d7b4501338e44a4e5"
diff --git a/recipes-extended/xen/xen_git.bb b/recipes-extended/xen/xen_git.bb
index fba12e5..5b16d58 100644
--- a/recipes-extended/xen/xen_git.bb
+++ b/recipes-extended/xen/xen_git.bb
@@ -6,6 +6,7 @@ XEN_BRANCH ?= "master"
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
     file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
+    file://0001-xen-workaround-missing-device_type-property-in-pci-p.patch \
     "
 
 LIC_FILES_CHKSUM ?= "file://COPYING;md5=419739e325a50f3d7b4501338e44a4e5"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [meta-virtualization][hardknott][PATCH 1/3] linux-yocto-dev, raspberrypi: apply fixed revision to kernel
  2022-05-21 19:04 [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Christopher Clark
                   ` (2 preceding siblings ...)
  2022-05-21 19:04 ` [meta-virtualization][gatesgarth][PATCH 3/3] xen: fix boot on the Raspberry Pi 4 Christopher Clark
@ 2022-05-21 19:04 ` Christopher Clark
  2022-05-21 19:04 ` [meta-virtualization][hardknott][PATCH 2/3] xen: drop patch to workaround prelink on aarch64 Christopher Clark
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Christopher Clark @ 2022-05-21 19:04 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe, Bertrand.Marquis

The default preferred Linux kernel for Xen on the Raspberry Pi 4
board in this branch is linux-yocto-dev, which unfortunately results
in a branch tracking configuration rather than a fixed revision.

Apply a specified revision from the 5.12/standard/bcm-2xxx-rpi
branch, per the kernel version for this release, and disable tracking.
Revision is the current tip of v5.12/standard/bcm-2xxx-rpi branch,
tested and verified working on the board.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
---
 .../recipes-kernel/linux/linux-yocto-dev.bbappend         | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
index 2a0416f..91558b3 100644
--- a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
+++ b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -5,6 +5,12 @@ DEFAULT_CMDLINE := "${CMDLINE}"
 XEN_LINUX_CMDLINE ?= "console=hvc0 clk_ignore_unused earlycon=xenboot debug root=/dev/mmcblk0p2 rootwait"
 CMDLINE = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', '${XEN_LINUX_CMDLINE}', '${DEFAULT_CMDLINE}', d)}"
 
-KBRANCH_raspberrypi4-64 ?= "standard/bcm-2xxx-rpi"
+KBRANCH_raspberrypi4-64 ?= "v5.12/standard/bcm-2xxx-rpi"
 KMACHINE_raspberrypi4-64 ?= "bcm-2xxx-rpi4"
 COMPATIBLE_MACHINE_raspberrypi4-64 = "(raspberrypi4-64)"
+
+# Tip of v5.12/standard/bcm-2xxx-rpi
+SRCREV_machine_raspberrypi4-64 = "f48ad8b95fdcc48a3defe5d085cfd8c5390826b8"
+
+# Tip of master:
+SRCREV_meta_raspberrypi4-64 = "942a3a2cc192a8b2e38a7fef4a40249c79f5c9f5"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [meta-virtualization][hardknott][PATCH 2/3] xen: drop patch to workaround prelink on aarch64
  2022-05-21 19:04 [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Christopher Clark
                   ` (3 preceding siblings ...)
  2022-05-21 19:04 ` [meta-virtualization][hardknott][PATCH 1/3] linux-yocto-dev, raspberrypi: apply fixed revision to kernel Christopher Clark
@ 2022-05-21 19:04 ` Christopher Clark
  2022-05-21 19:04 ` [meta-virtualization][hardknott][PATCH 3/3] xen: fix boot on the Raspberry Pi 4 with Xen 4.14 Christopher Clark
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Christopher Clark @ 2022-05-21 19:04 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe, Bertrand.Marquis

Patch is not needed for image prelinking since the gcc toolchain
in this branch successfully links Xen without it.

Remove the patch from the stable branch since the BSD license of the
modified header file differs vs the GPLv2 source code referenced.
Removal preferred to replacement with a new patch that moves the function
into GPLv2 .c source files since the build now succeeds without it.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
---
 ...xen-arm64-implement-atomic-fetch-add.patch | 50 -------------------
 recipes-extended/xen/xen_4.14.bb              |  1 -
 recipes-extended/xen/xen_4.15.bb              |  1 -
 recipes-extended/xen/xen_git.bb               |  1 -
 4 files changed, 53 deletions(-)
 delete mode 100644 recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch

diff --git a/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch b/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch
deleted file mode 100644
index 6e957a5..0000000
--- a/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Christopher Clark <christopher.w.clark@gmail.com>
-Date: Fri, 26 June 2020 16:34:00 -0800
-Subject: [PATCH] xen: implement atomic op to fix arm64 compilation
-
-Xen's ARM implementation of arch_fetch_and_add since f9cc3cd9
-uses a builtin, despite the build being performed with -fno-builtin.
-With gcc 10.1.0, this now breaks prelinking spinlock.c, so
-implement the one atomic operation that is required with logic
-derived from Linux's atomic_ll_sc.h: ATOMIC_FETCH_OP and comparison with
-the binary produced with and without the patch with gcc 9.2.0.
-
-Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
-diff --git a/xen/include/asm-arm/system.h b/xen/include/asm-arm/system.h
-index e5d062667d..c46dd3ac71 100644
---- a/xen/include/asm-arm/system.h
-+++ b/xen/include/asm-arm/system.h
-@@ -55,7 +55,32 @@ static inline int local_abort_is_enabled(void)
-     return !(flags & PSR_ABT_MASK);
- }
- 
-+#ifdef CONFIG_ARM_64
-+
-+/* see atomic_ll_sc.h:  ATOMIC_FETCH_OP(name, mb, acq, rel, cl, op, asm_op, constraint) */
-+static inline int arch_fetch_and_add(unsigned int *ptr, unsigned long i)
-+{
-+    int register lptr asm("x0");
-+    int register result asm("w1");
-+    int register newval asm("w2");
-+    int register status asm("w3");
-+
-+    asm volatile(
-+    "   mov       %[lptr], %[ptr]\n"
-+    "1: ldxr      %w[result], [%[lptr]]\n"
-+    "   add       %w[newval], %w[result], %w[i]\n"
-+    "   stlxr     %w[status], %w[newval], [%[lptr]]\n"
-+    "   cbnz      %w[status], 1b\n"
-+    "   dmb       ish\n"
-+    : [result] "=&r" (result), [lptr] "=&r" (lptr), [newval] "=&r" (newval), [status] "=&r" (status), [i] "+r" (i), "+Q" (*ptr)
-+    : [ptr] "r" (ptr), "r" (i)
-+    : "memory");
-+
-+    return result;
-+}
-+#else
- #define arch_fetch_and_add(x, v) __sync_fetch_and_add(x, v)
-+#endif
- 
- extern struct vcpu *__context_switch(struct vcpu *prev, struct vcpu *next);
- 
diff --git a/recipes-extended/xen/xen_4.14.bb b/recipes-extended/xen/xen_4.14.bb
index 653e3b6..6ac3236 100644
--- a/recipes-extended/xen/xen_4.14.bb
+++ b/recipes-extended/xen/xen_4.14.bb
@@ -5,7 +5,6 @@ XEN_BRANCH ?= "stable-${XEN_REL}"
 
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
-    file://xen-arm64-implement-atomic-fetch-add.patch \
     file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
     "
 
diff --git a/recipes-extended/xen/xen_4.15.bb b/recipes-extended/xen/xen_4.15.bb
index 2842c0a..138773d 100644
--- a/recipes-extended/xen/xen_4.15.bb
+++ b/recipes-extended/xen/xen_4.15.bb
@@ -5,7 +5,6 @@ XEN_BRANCH ?= "stable-${XEN_REL}"
 
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
-    file://xen-arm64-implement-atomic-fetch-add.patch \
     file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
     "
 
diff --git a/recipes-extended/xen/xen_git.bb b/recipes-extended/xen/xen_git.bb
index eaf3956..04874d4 100644
--- a/recipes-extended/xen/xen_git.bb
+++ b/recipes-extended/xen/xen_git.bb
@@ -5,7 +5,6 @@ XEN_BRANCH ?= "master"
 
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
-    file://xen-arm64-implement-atomic-fetch-add.patch \
     file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
     "
 
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [meta-virtualization][hardknott][PATCH 3/3] xen: fix boot on the Raspberry Pi 4 with Xen 4.14
  2022-05-21 19:04 [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Christopher Clark
                   ` (4 preceding siblings ...)
  2022-05-21 19:04 ` [meta-virtualization][hardknott][PATCH 2/3] xen: drop patch to workaround prelink on aarch64 Christopher Clark
@ 2022-05-21 19:04 ` Christopher Clark
  2022-05-21 19:04 ` [meta-virtualization][honister][PATCH 1/3] linux-yocto-dev, xen, raspberrypi: remove tracking bbappend Christopher Clark
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Christopher Clark @ 2022-05-21 19:04 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe, Bertrand.Marquis

Apply the patch from Xen to fix device tree parsing in newer kernels
and remove the Xen configuration file since the default works.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
---
 .../xen/files/defconfig_raspberrypi4-64       | 117 ------------------
 .../recipes-extended/xen/xen_git.bbappend     |  11 --
 ...issing-device_type-property-in-pci-p.patch |  91 ++++++++++++++
 recipes-extended/xen/xen_4.14.bb              |   1 +
 4 files changed, 92 insertions(+), 128 deletions(-)
 delete mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/files/defconfig_raspberrypi4-64
 delete mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/xen_git.bbappend
 create mode 100644 recipes-extended/xen/files/0001-xen-workaround-missing-device_type-property-in-pci-p.patch

diff --git a/dynamic-layers/raspberrypi/recipes-extended/xen/files/defconfig_raspberrypi4-64 b/dynamic-layers/raspberrypi/recipes-extended/xen/files/defconfig_raspberrypi4-64
deleted file mode 100644
index f3343d3..0000000
--- a/dynamic-layers/raspberrypi/recipes-extended/xen/files/defconfig_raspberrypi4-64
+++ /dev/null
@@ -1,117 +0,0 @@
-#
-# 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
diff --git a/dynamic-layers/raspberrypi/recipes-extended/xen/xen_git.bbappend b/dynamic-layers/raspberrypi/recipes-extended/xen/xen_git.bbappend
deleted file mode 100644
index 995dfd3..0000000
--- a/dynamic-layers/raspberrypi/recipes-extended/xen/xen_git.bbappend
+++ /dev/null
@@ -1,11 +0,0 @@
-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
-}
diff --git a/recipes-extended/xen/files/0001-xen-workaround-missing-device_type-property-in-pci-p.patch b/recipes-extended/xen/files/0001-xen-workaround-missing-device_type-property-in-pci-p.patch
new file mode 100644
index 0000000..09a461b
--- /dev/null
+++ b/recipes-extended/xen/files/0001-xen-workaround-missing-device_type-property-in-pci-p.patch
@@ -0,0 +1,91 @@
+From 5a4087004d1adbbb223925f3306db0e5824a2bdc Mon Sep 17 00:00:00 2001
+From: Stefano Stabellini <sstabellini@kernel.org>
+Date: Tue, 9 Feb 2021 11:53:34 -0800
+Subject: [PATCH] xen: workaround missing device_type property in pci/pcie
+ nodes
+
+PCI buses differ from default buses in a few important ways, so it is
+important to detect them properly. Normally, PCI buses are expected to
+have the following property:
+
+    device_type = "pci"
+
+In reality, it is not always the case. To handle PCI bus nodes that
+don't have the device_type property, also consider the node name: if the
+node name is "pcie" or "pci" then consider the bus as a PCI bus.
+
+This commit is based on the Linux kernel commit
+d1ac0002dd29 "of: address: Work around missing device_type property in
+pcie nodes".
+
+This fixes Xen boot on RPi4. Some RPi4 kernels have the following node
+on their device trees:
+
+&pcie0 {
+	pci@1,0 {
+		#address-cells = <3>;
+		#size-cells = <2>;
+		ranges;
+
+		reg = <0 0 0 0 0>;
+
+		usb@1,0 {
+			reg = <0x10000 0 0 0 0>;
+			resets = <&reset RASPBERRYPI_FIRMWARE_RESET_ID_USB>;
+		};
+	};
+};
+
+The pci@1,0 node is a PCI bus. If we parse the node and its children as
+a default bus, the reg property under usb@1,0 would have to be
+interpreted as an address range mappable by the CPU, which is not the
+case and would break.
+
+Link: https://lore.kernel.org/xen-devel/YBmQQ3Tzu++AadKx@mattapan.m5p.com/
+[fix style on commit]
+Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
+Tested-by: Elliott Mitchell <ehem+xen@m5p.com>
+Tested-by: Jukka Kaartinen <jukka.kaartinen@unikie.com>
+Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
+Acked-by: Julien Grall <jgrall@amazon.com>
+---
+ xen/common/device_tree.c | 16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
+index 18825e333e..03d25a81ce 100644
+--- a/xen/common/device_tree.c
++++ b/xen/common/device_tree.c
+@@ -563,14 +563,28 @@ static unsigned int dt_bus_default_get_flags(const __be32 *addr)
+  * PCI bus specific translator
+  */
+ 
++static bool dt_node_is_pci(const struct dt_device_node *np)
++{
++    bool is_pci = !strcmp(np->name, "pcie") || !strcmp(np->name, "pci");
++
++    if ( is_pci )
++        printk(XENLOG_WARNING "%s: Missing device_type\n", np->full_name);
++
++    return is_pci;
++}
++
+ static bool_t dt_bus_pci_match(const struct dt_device_node *np)
+ {
+     /*
+      * "pciex" is PCI Express "vci" is for the /chaos bridge on 1st-gen PCI
+      * powermacs "ht" is hypertransport
++     *
++     * If none of the device_type match, and that the node name is
++     * "pcie" or "pci", accept the device as PCI (with a warning).
+      */
+     return !strcmp(np->type, "pci") || !strcmp(np->type, "pciex") ||
+-        !strcmp(np->type, "vci") || !strcmp(np->type, "ht");
++        !strcmp(np->type, "vci") || !strcmp(np->type, "ht") ||
++        dt_node_is_pci(np);
+ }
+ 
+ static void dt_bus_pci_count_cells(const struct dt_device_node *np,
+-- 
+2.25.1
+
diff --git a/recipes-extended/xen/xen_4.14.bb b/recipes-extended/xen/xen_4.14.bb
index 6ac3236..14dd54a 100644
--- a/recipes-extended/xen/xen_4.14.bb
+++ b/recipes-extended/xen/xen_4.14.bb
@@ -6,6 +6,7 @@ XEN_BRANCH ?= "stable-${XEN_REL}"
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
     file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
+    file://0001-xen-workaround-missing-device_type-property-in-pci-p.patch \
     "
 
 LIC_FILES_CHKSUM ?= "file://COPYING;md5=419739e325a50f3d7b4501338e44a4e5"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [meta-virtualization][honister][PATCH 1/3] linux-yocto-dev, xen, raspberrypi: remove tracking bbappend
  2022-05-21 19:04 [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Christopher Clark
                   ` (5 preceding siblings ...)
  2022-05-21 19:04 ` [meta-virtualization][hardknott][PATCH 3/3] xen: fix boot on the Raspberry Pi 4 with Xen 4.14 Christopher Clark
@ 2022-05-21 19:04 ` Christopher Clark
  2022-05-23  9:50   ` Bertrand Marquis
  2022-05-21 19:04 ` [meta-virtualization][honister][PATCH 2/3] xen: drop patch to workaround prelink on aarch64 Christopher Clark
                   ` (5 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Christopher Clark @ 2022-05-21 19:04 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe, Bertrand.Marquis

The default preferred Linux kernel for Xen on the Raspberry Pi 4 in this
branch is linux-yocto. The alternative provided option is
linux-yocto-dev, but this is unintentionally a branch tracking configuration
rather than a fixed revision so not appropriate for a stable branch.

Remove the linux-yocto-dev in favour of the linux-yocto kernel, which
has been tested and verified working on the board.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
---
 .../recipes-kernel/linux/linux-yocto-dev.bbappend         | 8 --------
 1 file changed, 8 deletions(-)
 delete mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend

diff --git a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
deleted file mode 100644
index 5f43052..0000000
--- a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
+++ /dev/null
@@ -1,8 +0,0 @@
-# For a Xen-enabled distro on the Raspberry Pi, override the contents of cmdline.txt
-# with Xen-on-ARM-specific command line options
-
-KBRANCH:raspberrypi4-64 ?= "standard/bcm-2xxx-rpi"
-KMACHINE:raspberrypi4-64 ?= "bcm-2xxx-rpi4"
-COMPATIBLE_MACHINE:raspberrypi4-64 = "(raspberrypi4-64)"
-
-require linux-yocto_xen-rpi.inc
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [meta-virtualization][honister][PATCH 2/3] xen: drop patch to workaround prelink on aarch64
  2022-05-21 19:04 [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Christopher Clark
                   ` (6 preceding siblings ...)
  2022-05-21 19:04 ` [meta-virtualization][honister][PATCH 1/3] linux-yocto-dev, xen, raspberrypi: remove tracking bbappend Christopher Clark
@ 2022-05-21 19:04 ` Christopher Clark
  2022-05-23  9:55   ` Bertrand Marquis
  2022-05-21 19:04 ` [meta-virtualization][honister][PATCH 3/3] xen: fix boot on the Raspberry Pi 4 with Xen 4.14 Christopher Clark
                   ` (4 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Christopher Clark @ 2022-05-21 19:04 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe, Bertrand.Marquis

Patch is not needed for image prelinking since the gcc toolchain
in this branch successfully links Xen without it.

Remove the patch from the stable branch since the BSD license of the
modified header file differs vs the GPLv2 source code referenced.
Removal preferred to replacement with a new patch that moves the function
into GPLv2 .c source files since the build now succeeds without it.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
---
 ...xen-arm64-implement-atomic-fetch-add.patch | 50 -------------------
 recipes-extended/xen/xen_4.14.bb              |  1 -
 recipes-extended/xen/xen_4.15.bb              |  1 -
 recipes-extended/xen/xen_git.bb               |  1 -
 4 files changed, 53 deletions(-)
 delete mode 100644 recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch

diff --git a/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch b/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch
deleted file mode 100644
index 6e957a5..0000000
--- a/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Christopher Clark <christopher.w.clark@gmail.com>
-Date: Fri, 26 June 2020 16:34:00 -0800
-Subject: [PATCH] xen: implement atomic op to fix arm64 compilation
-
-Xen's ARM implementation of arch_fetch_and_add since f9cc3cd9
-uses a builtin, despite the build being performed with -fno-builtin.
-With gcc 10.1.0, this now breaks prelinking spinlock.c, so
-implement the one atomic operation that is required with logic
-derived from Linux's atomic_ll_sc.h: ATOMIC_FETCH_OP and comparison with
-the binary produced with and without the patch with gcc 9.2.0.
-
-Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
-diff --git a/xen/include/asm-arm/system.h b/xen/include/asm-arm/system.h
-index e5d062667d..c46dd3ac71 100644
---- a/xen/include/asm-arm/system.h
-+++ b/xen/include/asm-arm/system.h
-@@ -55,7 +55,32 @@ static inline int local_abort_is_enabled(void)
-     return !(flags & PSR_ABT_MASK);
- }
- 
-+#ifdef CONFIG_ARM_64
-+
-+/* see atomic_ll_sc.h:  ATOMIC_FETCH_OP(name, mb, acq, rel, cl, op, asm_op, constraint) */
-+static inline int arch_fetch_and_add(unsigned int *ptr, unsigned long i)
-+{
-+    int register lptr asm("x0");
-+    int register result asm("w1");
-+    int register newval asm("w2");
-+    int register status asm("w3");
-+
-+    asm volatile(
-+    "   mov       %[lptr], %[ptr]\n"
-+    "1: ldxr      %w[result], [%[lptr]]\n"
-+    "   add       %w[newval], %w[result], %w[i]\n"
-+    "   stlxr     %w[status], %w[newval], [%[lptr]]\n"
-+    "   cbnz      %w[status], 1b\n"
-+    "   dmb       ish\n"
-+    : [result] "=&r" (result), [lptr] "=&r" (lptr), [newval] "=&r" (newval), [status] "=&r" (status), [i] "+r" (i), "+Q" (*ptr)
-+    : [ptr] "r" (ptr), "r" (i)
-+    : "memory");
-+
-+    return result;
-+}
-+#else
- #define arch_fetch_and_add(x, v) __sync_fetch_and_add(x, v)
-+#endif
- 
- extern struct vcpu *__context_switch(struct vcpu *prev, struct vcpu *next);
- 
diff --git a/recipes-extended/xen/xen_4.14.bb b/recipes-extended/xen/xen_4.14.bb
index 0d7d20b..267db16 100644
--- a/recipes-extended/xen/xen_4.14.bb
+++ b/recipes-extended/xen/xen_4.14.bb
@@ -6,7 +6,6 @@ XEN_BRANCH ?= "stable-${XEN_REL}"
 
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
-    file://xen-arm64-implement-atomic-fetch-add.patch \
     file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
     "
 
diff --git a/recipes-extended/xen/xen_4.15.bb b/recipes-extended/xen/xen_4.15.bb
index 0cfaf0c..1b87ae8 100644
--- a/recipes-extended/xen/xen_4.15.bb
+++ b/recipes-extended/xen/xen_4.15.bb
@@ -6,7 +6,6 @@ XEN_BRANCH ?= "stable-${XEN_REL}"
 
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
-    file://xen-arm64-implement-atomic-fetch-add.patch \
     file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
     "
 
diff --git a/recipes-extended/xen/xen_git.bb b/recipes-extended/xen/xen_git.bb
index 3957de1..2fbfb54 100644
--- a/recipes-extended/xen/xen_git.bb
+++ b/recipes-extended/xen/xen_git.bb
@@ -6,7 +6,6 @@ XEN_BRANCH ?= "master"
 
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
-    file://xen-arm64-implement-atomic-fetch-add.patch \
     file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
     "
 
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [meta-virtualization][honister][PATCH 3/3] xen: fix boot on the Raspberry Pi 4 with Xen 4.14
  2022-05-21 19:04 [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Christopher Clark
                   ` (7 preceding siblings ...)
  2022-05-21 19:04 ` [meta-virtualization][honister][PATCH 2/3] xen: drop patch to workaround prelink on aarch64 Christopher Clark
@ 2022-05-21 19:04 ` Christopher Clark
  2022-05-23  9:50   ` Bertrand Marquis
  2022-05-21 19:04 ` [meta-virtualization][kirkstone][PATCH] xen, raspberry pi: replace linux-yocto-dev with linux-yocto 5.15 Christopher Clark
                   ` (3 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Christopher Clark @ 2022-05-21 19:04 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe, Bertrand.Marquis

Apply the patch from Xen to fix device tree parsing in newer kernels.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
---
 ...issing-device_type-property-in-pci-p.patch | 91 +++++++++++++++++++
 recipes-extended/xen/xen_4.14.bb              |  1 +
 2 files changed, 92 insertions(+)
 create mode 100644 recipes-extended/xen/files/0001-xen-workaround-missing-device_type-property-in-pci-p.patch

diff --git a/recipes-extended/xen/files/0001-xen-workaround-missing-device_type-property-in-pci-p.patch b/recipes-extended/xen/files/0001-xen-workaround-missing-device_type-property-in-pci-p.patch
new file mode 100644
index 0000000..09a461b
--- /dev/null
+++ b/recipes-extended/xen/files/0001-xen-workaround-missing-device_type-property-in-pci-p.patch
@@ -0,0 +1,91 @@
+From 5a4087004d1adbbb223925f3306db0e5824a2bdc Mon Sep 17 00:00:00 2001
+From: Stefano Stabellini <sstabellini@kernel.org>
+Date: Tue, 9 Feb 2021 11:53:34 -0800
+Subject: [PATCH] xen: workaround missing device_type property in pci/pcie
+ nodes
+
+PCI buses differ from default buses in a few important ways, so it is
+important to detect them properly. Normally, PCI buses are expected to
+have the following property:
+
+    device_type = "pci"
+
+In reality, it is not always the case. To handle PCI bus nodes that
+don't have the device_type property, also consider the node name: if the
+node name is "pcie" or "pci" then consider the bus as a PCI bus.
+
+This commit is based on the Linux kernel commit
+d1ac0002dd29 "of: address: Work around missing device_type property in
+pcie nodes".
+
+This fixes Xen boot on RPi4. Some RPi4 kernels have the following node
+on their device trees:
+
+&pcie0 {
+	pci@1,0 {
+		#address-cells = <3>;
+		#size-cells = <2>;
+		ranges;
+
+		reg = <0 0 0 0 0>;
+
+		usb@1,0 {
+			reg = <0x10000 0 0 0 0>;
+			resets = <&reset RASPBERRYPI_FIRMWARE_RESET_ID_USB>;
+		};
+	};
+};
+
+The pci@1,0 node is a PCI bus. If we parse the node and its children as
+a default bus, the reg property under usb@1,0 would have to be
+interpreted as an address range mappable by the CPU, which is not the
+case and would break.
+
+Link: https://lore.kernel.org/xen-devel/YBmQQ3Tzu++AadKx@mattapan.m5p.com/
+[fix style on commit]
+Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
+Tested-by: Elliott Mitchell <ehem+xen@m5p.com>
+Tested-by: Jukka Kaartinen <jukka.kaartinen@unikie.com>
+Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
+Acked-by: Julien Grall <jgrall@amazon.com>
+---
+ xen/common/device_tree.c | 16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
+index 18825e333e..03d25a81ce 100644
+--- a/xen/common/device_tree.c
++++ b/xen/common/device_tree.c
+@@ -563,14 +563,28 @@ static unsigned int dt_bus_default_get_flags(const __be32 *addr)
+  * PCI bus specific translator
+  */
+ 
++static bool dt_node_is_pci(const struct dt_device_node *np)
++{
++    bool is_pci = !strcmp(np->name, "pcie") || !strcmp(np->name, "pci");
++
++    if ( is_pci )
++        printk(XENLOG_WARNING "%s: Missing device_type\n", np->full_name);
++
++    return is_pci;
++}
++
+ static bool_t dt_bus_pci_match(const struct dt_device_node *np)
+ {
+     /*
+      * "pciex" is PCI Express "vci" is for the /chaos bridge on 1st-gen PCI
+      * powermacs "ht" is hypertransport
++     *
++     * If none of the device_type match, and that the node name is
++     * "pcie" or "pci", accept the device as PCI (with a warning).
+      */
+     return !strcmp(np->type, "pci") || !strcmp(np->type, "pciex") ||
+-        !strcmp(np->type, "vci") || !strcmp(np->type, "ht");
++        !strcmp(np->type, "vci") || !strcmp(np->type, "ht") ||
++        dt_node_is_pci(np);
+ }
+ 
+ static void dt_bus_pci_count_cells(const struct dt_device_node *np,
+-- 
+2.25.1
+
diff --git a/recipes-extended/xen/xen_4.14.bb b/recipes-extended/xen/xen_4.14.bb
index 267db16..c0fa938 100644
--- a/recipes-extended/xen/xen_4.14.bb
+++ b/recipes-extended/xen/xen_4.14.bb
@@ -7,6 +7,7 @@ XEN_BRANCH ?= "stable-${XEN_REL}"
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
     file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
+    file://0001-xen-workaround-missing-device_type-property-in-pci-p.patch \
     "
 
 LIC_FILES_CHKSUM ?= "file://COPYING;md5=419739e325a50f3d7b4501338e44a4e5"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [meta-virtualization][kirkstone][PATCH] xen, raspberry pi: replace linux-yocto-dev with linux-yocto 5.15
  2022-05-21 19:04 [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Christopher Clark
                   ` (8 preceding siblings ...)
  2022-05-21 19:04 ` [meta-virtualization][honister][PATCH 3/3] xen: fix boot on the Raspberry Pi 4 with Xen 4.14 Christopher Clark
@ 2022-05-21 19:04 ` Christopher Clark
  2022-05-23  9:53   ` Bertrand Marquis
  2022-05-21 19:04 ` [meta-virtualization][PATCH] " Christopher Clark
                   ` (2 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Christopher Clark @ 2022-05-21 19:04 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe, Bertrand.Marquis

The default preferred Linux kernel for Xen on the Raspberry Pi 4 in this
branch is linux-yocto. The alternative provided option is
linux-yocto-dev, but this is unintentionally a branch tracking configuration
rather than a fixed revision so not appropriate for a stable branch.

Remove the linux-yocto-dev in favour of the linux-yocto kernel version
5.15 which has been tested and verified working on the board.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
---
 .../recipes-kernel/linux/linux-yocto-dev.bbappend         | 8 --------
 .../recipes-kernel/linux/linux-yocto_5.15.bbappend        | 6 ++++++
 2 files changed, 6 insertions(+), 8 deletions(-)
 delete mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.15.bbappend

diff --git a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
deleted file mode 100644
index 5f43052..0000000
--- a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
+++ /dev/null
@@ -1,8 +0,0 @@
-# For a Xen-enabled distro on the Raspberry Pi, override the contents of cmdline.txt
-# with Xen-on-ARM-specific command line options
-
-KBRANCH:raspberrypi4-64 ?= "standard/bcm-2xxx-rpi"
-KMACHINE:raspberrypi4-64 ?= "bcm-2xxx-rpi4"
-COMPATIBLE_MACHINE:raspberrypi4-64 = "(raspberrypi4-64)"
-
-require linux-yocto_xen-rpi.inc
diff --git a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.15.bbappend b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.15.bbappend
new file mode 100644
index 0000000..572f7ec
--- /dev/null
+++ b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.15.bbappend
@@ -0,0 +1,6 @@
+# Enable use of the linux-yocto 5.15 kernel for the Raspberry Pi 4
+KBRANCH:raspberrypi4-64 ?= "v5.15/standard/bcm-2xxx-rpi"
+KMACHINE:raspberrypi4-64 ?= "bcm-2xxx-rpi4"
+COMPATIBLE_MACHINE:raspberrypi4-64 = "(raspberrypi4-64)"
+
+require linux-yocto_xen-rpi.inc
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [meta-virtualization][PATCH] xen, raspberry pi: replace linux-yocto-dev with linux-yocto 5.15
  2022-05-21 19:04 [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Christopher Clark
                   ` (9 preceding siblings ...)
  2022-05-21 19:04 ` [meta-virtualization][kirkstone][PATCH] xen, raspberry pi: replace linux-yocto-dev with linux-yocto 5.15 Christopher Clark
@ 2022-05-21 19:04 ` Christopher Clark
  2022-05-23  9:53   ` Bertrand Marquis
  2022-05-23  9:47 ` [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Bertrand Marquis
  2022-05-25 15:36 ` Bruce Ashfield
  12 siblings, 1 reply; 20+ messages in thread
From: Christopher Clark @ 2022-05-21 19:04 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe, Bertrand.Marquis

The default preferred Linux kernel for Xen on the Raspberry Pi 4 is
linux-yocto. The alternative provided option is linux-yocto-dev, but
this is unintentionally a branch tracking configuration rather than a
fixed revision.

Remove the linux-yocto-dev in favour of the linux-yocto kernel version
5.15 which has been tested and verified working on the board.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
---
 .../recipes-kernel/linux/linux-yocto-dev.bbappend         | 8 --------
 .../recipes-kernel/linux/linux-yocto_5.15.bbappend        | 6 ++++++
 2 files changed, 6 insertions(+), 8 deletions(-)
 delete mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
 create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.15.bbappend

diff --git a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
deleted file mode 100644
index 5f43052..0000000
--- a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
+++ /dev/null
@@ -1,8 +0,0 @@
-# For a Xen-enabled distro on the Raspberry Pi, override the contents of cmdline.txt
-# with Xen-on-ARM-specific command line options
-
-KBRANCH:raspberrypi4-64 ?= "standard/bcm-2xxx-rpi"
-KMACHINE:raspberrypi4-64 ?= "bcm-2xxx-rpi4"
-COMPATIBLE_MACHINE:raspberrypi4-64 = "(raspberrypi4-64)"
-
-require linux-yocto_xen-rpi.inc
diff --git a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.15.bbappend b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.15.bbappend
new file mode 100644
index 0000000..572f7ec
--- /dev/null
+++ b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.15.bbappend
@@ -0,0 +1,6 @@
+# Enable use of the linux-yocto 5.15 kernel for the Raspberry Pi 4
+KBRANCH:raspberrypi4-64 ?= "v5.15/standard/bcm-2xxx-rpi"
+KMACHINE:raspberrypi4-64 ?= "bcm-2xxx-rpi4"
+COMPATIBLE_MACHINE:raspberrypi4-64 = "(raspberrypi4-64)"
+
+require linux-yocto_xen-rpi.inc
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes
  2022-05-21 19:04 [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Christopher Clark
                   ` (10 preceding siblings ...)
  2022-05-21 19:04 ` [meta-virtualization][PATCH] " Christopher Clark
@ 2022-05-23  9:47 ` Bertrand Marquis
  2022-05-25 15:36 ` Bruce Ashfield
  12 siblings, 0 replies; 20+ messages in thread
From: Bertrand Marquis @ 2022-05-23  9:47 UTC (permalink / raw)
  To: Christopher Clark; +Cc: meta-virtualization, bruce.ashfield, cardoe

Hi Christopher,

> On 21 May 2022, at 20:04, Christopher Clark <christopher.w.clark@gmail.com> wrote:
>
> A series of fixes applied to master and across stable branches where
> needed to fix running Xen on the Raspberry Pi 4 board.
>
> This updates Linux kernel configuration for Xen to remove tracking from
> the linux-yocto-dev kernel, either by applying a fixed revision and
> specification of a stable branch or replacing it with the linux-yocto
> kernel. The Xen build configuration is updated to remove the hypervisor
> defconfig for the Raspberry Pi and drop the arm64 prelink patch as a
> license correction and since the build no longer needs it with the newer
> gcc toolchain.
>
> Tested on hardware.
>
> Christopher Clark
>
> gatesgarth:
>  01: linux-yocto-dev, raspberrypi: apply fixed revision to kernel
>  02: xen: drop patch to workaround prelink on aarch64
>  03: xen: fix boot on the Raspberry Pi 4
>
> hardknott:
>  04: linux-yocto-dev, raspberrypi: apply fixed revision to kernel
>  05: xen: drop patch to workaround prelink on aarch64
>  06: xen: fix boot on the Raspberry Pi 4

Hardknott and gatesgarth are EOL so I do not think those patches are needed.

>
> honister:
>  07: linux-yocto-dev, xen, raspberrypi: remove tracking bbappend
>  08: xen: drop patch to workaround prelink on aarch64
>  09: xen: fix boot on the Raspberry Pi 4 with Xen 4.14
>
> kirkstone:
>  10: xen, raspberry pi: replace linux-yocto-dev with linux-yocto 5.15
>
> master:
>  11: xen, raspberry pi: replace linux-yocto-dev with linux-yocto 5.15

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [meta-virtualization][honister][PATCH 3/3] xen: fix boot on the Raspberry Pi 4 with Xen 4.14
  2022-05-21 19:04 ` [meta-virtualization][honister][PATCH 3/3] xen: fix boot on the Raspberry Pi 4 with Xen 4.14 Christopher Clark
@ 2022-05-23  9:50   ` Bertrand Marquis
  0 siblings, 0 replies; 20+ messages in thread
From: Bertrand Marquis @ 2022-05-23  9:50 UTC (permalink / raw)
  To: Christopher Clark; +Cc: meta-virtualization, Bruce Ashfield

Hi Christopher,

> On 21 May 2022, at 20:04, Christopher Clark <christopher.w.clark@gmail.com> wrote:
>
> Apply the patch from Xen to fix device tree parsing in newer kernels.
>
> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> ...issing-device_type-property-in-pci-p.patch | 91 +++++++++++++++++++
> recipes-extended/xen/xen_4.14.bb              |  1 +
> 2 files changed, 92 insertions(+)
> create mode 100644 recipes-extended/xen/files/0001-xen-workaround-missing-device_type-property-in-pci-p.patch
>
> diff --git a/recipes-extended/xen/files/0001-xen-workaround-missing-device_type-property-in-pci-p.patch b/recipes-extended/xen/files/0001-xen-workaround-missing-device_type-property-in-pci-p.patch
> new file mode 100644
> index 0000000..09a461b
> --- /dev/null
> +++ b/recipes-extended/xen/files/0001-xen-workaround-missing-device_type-property-in-pci-p.patch
> @@ -0,0 +1,91 @@
> +From 5a4087004d1adbbb223925f3306db0e5824a2bdc Mon Sep 17 00:00:00 2001
> +From: Stefano Stabellini <sstabellini@kernel.org>
> +Date: Tue, 9 Feb 2021 11:53:34 -0800
> +Subject: [PATCH] xen: workaround missing device_type property in pci/pcie
> + nodes
> +
> +PCI buses differ from default buses in a few important ways, so it is
> +important to detect them properly. Normally, PCI buses are expected to
> +have the following property:
> +
> +    device_type = "pci"
> +
> +In reality, it is not always the case. To handle PCI bus nodes that
> +don't have the device_type property, also consider the node name: if the
> +node name is "pcie" or "pci" then consider the bus as a PCI bus.
> +
> +This commit is based on the Linux kernel commit
> +d1ac0002dd29 "of: address: Work around missing device_type property in
> +pcie nodes".
> +
> +This fixes Xen boot on RPi4. Some RPi4 kernels have the following node
> +on their device trees:
> +
> +&pcie0 {
> +     pci@1,0 {
> +             #address-cells = <3>;
> +             #size-cells = <2>;
> +             ranges;
> +
> +             reg = <0 0 0 0 0>;
> +
> +             usb@1,0 {
> +                     reg = <0x10000 0 0 0 0>;
> +                     resets = <&reset RASPBERRYPI_FIRMWARE_RESET_ID_USB>;
> +             };
> +     };
> +};
> +
> +The pci@1,0 node is a PCI bus. If we parse the node and its children as
> +a default bus, the reg property under usb@1,0 would have to be
> +interpreted as an address range mappable by the CPU, which is not the
> +case and would break.
> +
> +Link: https://lore.kernel.org/xen-devel/YBmQQ3Tzu++AadKx@mattapan.m5p.com/
> +[fix style on commit]
> +Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
> +Tested-by: Elliott Mitchell <ehem+xen@m5p.com>
> +Tested-by: Jukka Kaartinen <jukka.kaartinen@unikie.com>
> +Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
> +Acked-by: Julien Grall <jgrall@amazon.com>
> +---
> + xen/common/device_tree.c | 16 +++++++++++++++-
> + 1 file changed, 15 insertions(+), 1 deletion(-)
> +
> +diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> +index 18825e333e..03d25a81ce 100644
> +--- a/xen/common/device_tree.c
> ++++ b/xen/common/device_tree.c
> +@@ -563,14 +563,28 @@ static unsigned int dt_bus_default_get_flags(const __be32 *addr)
> +  * PCI bus specific translator
> +  */
> +
> ++static bool dt_node_is_pci(const struct dt_device_node *np)
> ++{
> ++    bool is_pci = !strcmp(np->name, "pcie") || !strcmp(np->name, "pci");
> ++
> ++    if ( is_pci )
> ++        printk(XENLOG_WARNING "%s: Missing device_type\n", np->full_name);
> ++
> ++    return is_pci;
> ++}
> ++
> + static bool_t dt_bus_pci_match(const struct dt_device_node *np)
> + {
> +     /*
> +      * "pciex" is PCI Express "vci" is for the /chaos bridge on 1st-gen PCI
> +      * powermacs "ht" is hypertransport
> ++     *
> ++     * If none of the device_type match, and that the node name is
> ++     * "pcie" or "pci", accept the device as PCI (with a warning).
> +      */
> +     return !strcmp(np->type, "pci") || !strcmp(np->type, "pciex") ||
> +-        !strcmp(np->type, "vci") || !strcmp(np->type, "ht");
> ++        !strcmp(np->type, "vci") || !strcmp(np->type, "ht") ||
> ++        dt_node_is_pci(np);
> + }
> +
> + static void dt_bus_pci_count_cells(const struct dt_device_node *np,
> +--
> +2.25.1
> +
> diff --git a/recipes-extended/xen/xen_4.14.bb b/recipes-extended/xen/xen_4.14.bb
> index 267db16..c0fa938 100644
> --- a/recipes-extended/xen/xen_4.14.bb
> +++ b/recipes-extended/xen/xen_4.14.bb
> @@ -7,6 +7,7 @@ XEN_BRANCH ?= "stable-${XEN_REL}"
> SRC_URI = " \
>    git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
>    file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
> +    file://0001-xen-workaround-missing-device_type-property-in-pci-p.patch \
>    "
>
> LIC_FILES_CHKSUM ?= "file://COPYING;md5=419739e325a50f3d7b4501338e44a4e5"
> --
> 2.25.1
>

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [meta-virtualization][honister][PATCH 1/3] linux-yocto-dev, xen, raspberrypi: remove tracking bbappend
  2022-05-21 19:04 ` [meta-virtualization][honister][PATCH 1/3] linux-yocto-dev, xen, raspberrypi: remove tracking bbappend Christopher Clark
@ 2022-05-23  9:50   ` Bertrand Marquis
  0 siblings, 0 replies; 20+ messages in thread
From: Bertrand Marquis @ 2022-05-23  9:50 UTC (permalink / raw)
  To: Christopher Clark; +Cc: meta-virtualization, Bruce Ashfield

Hi,

> On 21 May 2022, at 20:04, Christopher Clark <christopher.w.clark@gmail.com> wrote:
>
> The default preferred Linux kernel for Xen on the Raspberry Pi 4 in this
> branch is linux-yocto. The alternative provided option is
> linux-yocto-dev, but this is unintentionally a branch tracking configuration
> rather than a fixed revision so not appropriate for a stable branch.
>
> Remove the linux-yocto-dev in favour of the linux-yocto kernel, which
> has been tested and verified working on the board.
>
> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> .../recipes-kernel/linux/linux-yocto-dev.bbappend         | 8 --------
> 1 file changed, 8 deletions(-)
> delete mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
>
> diff --git a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
> deleted file mode 100644
> index 5f43052..0000000
> --- a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -# For a Xen-enabled distro on the Raspberry Pi, override the contents of cmdline.txt
> -# with Xen-on-ARM-specific command line options
> -
> -KBRANCH:raspberrypi4-64 ?= "standard/bcm-2xxx-rpi"
> -KMACHINE:raspberrypi4-64 ?= "bcm-2xxx-rpi4"
> -COMPATIBLE_MACHINE:raspberrypi4-64 = "(raspberrypi4-64)"
> -
> -require linux-yocto_xen-rpi.inc
> --
> 2.25.1
>

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [meta-virtualization][kirkstone][PATCH] xen, raspberry pi: replace linux-yocto-dev with linux-yocto 5.15
  2022-05-21 19:04 ` [meta-virtualization][kirkstone][PATCH] xen, raspberry pi: replace linux-yocto-dev with linux-yocto 5.15 Christopher Clark
@ 2022-05-23  9:53   ` Bertrand Marquis
  0 siblings, 0 replies; 20+ messages in thread
From: Bertrand Marquis @ 2022-05-23  9:53 UTC (permalink / raw)
  To: Christopher Clark; +Cc: meta-virtualization, Bruce Ashfield

Hi,

> On 21 May 2022, at 20:04, Christopher Clark <christopher.w.clark@gmail.com> wrote:
>
> The default preferred Linux kernel for Xen on the Raspberry Pi 4 in this
> branch is linux-yocto. The alternative provided option is
> linux-yocto-dev, but this is unintentionally a branch tracking configuration
> rather than a fixed revision so not appropriate for a stable branch.
>
> Remove the linux-yocto-dev in favour of the linux-yocto kernel version
> 5.15 which has been tested and verified working on the board.
>
> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> .../recipes-kernel/linux/linux-yocto-dev.bbappend         | 8 --------
> .../recipes-kernel/linux/linux-yocto_5.15.bbappend        | 6 ++++++
> 2 files changed, 6 insertions(+), 8 deletions(-)
> delete mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
> create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.15.bbappend
>
> diff --git a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
> deleted file mode 100644
> index 5f43052..0000000
> --- a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -# For a Xen-enabled distro on the Raspberry Pi, override the contents of cmdline.txt
> -# with Xen-on-ARM-specific command line options
> -
> -KBRANCH:raspberrypi4-64 ?= "standard/bcm-2xxx-rpi"
> -KMACHINE:raspberrypi4-64 ?= "bcm-2xxx-rpi4"
> -COMPATIBLE_MACHINE:raspberrypi4-64 = "(raspberrypi4-64)"
> -
> -require linux-yocto_xen-rpi.inc
> diff --git a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.15.bbappend b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.15.bbappend
> new file mode 100644
> index 0000000..572f7ec
> --- /dev/null
> +++ b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.15.bbappend
> @@ -0,0 +1,6 @@
> +# Enable use of the linux-yocto 5.15 kernel for the Raspberry Pi 4
> +KBRANCH:raspberrypi4-64 ?= "v5.15/standard/bcm-2xxx-rpi"
> +KMACHINE:raspberrypi4-64 ?= "bcm-2xxx-rpi4"
> +COMPATIBLE_MACHINE:raspberrypi4-64 = "(raspberrypi4-64)"
> +
> +require linux-yocto_xen-rpi.inc
> --
> 2.25.1
>

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [meta-virtualization][PATCH] xen, raspberry pi: replace linux-yocto-dev with linux-yocto 5.15
  2022-05-21 19:04 ` [meta-virtualization][PATCH] " Christopher Clark
@ 2022-05-23  9:53   ` Bertrand Marquis
  0 siblings, 0 replies; 20+ messages in thread
From: Bertrand Marquis @ 2022-05-23  9:53 UTC (permalink / raw)
  To: Christopher Clark; +Cc: meta-virtualization, bruce.ashfield, cardoe

Hi,

> On 21 May 2022, at 20:04, Christopher Clark <christopher.w.clark@gmail.com> wrote:
>
> The default preferred Linux kernel for Xen on the Raspberry Pi 4 is
> linux-yocto. The alternative provided option is linux-yocto-dev, but
> this is unintentionally a branch tracking configuration rather than a
> fixed revision.
>
> Remove the linux-yocto-dev in favour of the linux-yocto kernel version
> 5.15 which has been tested and verified working on the board.
>
> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> .../recipes-kernel/linux/linux-yocto-dev.bbappend         | 8 --------
> .../recipes-kernel/linux/linux-yocto_5.15.bbappend        | 6 ++++++
> 2 files changed, 6 insertions(+), 8 deletions(-)
> delete mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
> create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.15.bbappend
>
> diff --git a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
> deleted file mode 100644
> index 5f43052..0000000
> --- a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -# For a Xen-enabled distro on the Raspberry Pi, override the contents of cmdline.txt
> -# with Xen-on-ARM-specific command line options
> -
> -KBRANCH:raspberrypi4-64 ?= "standard/bcm-2xxx-rpi"
> -KMACHINE:raspberrypi4-64 ?= "bcm-2xxx-rpi4"
> -COMPATIBLE_MACHINE:raspberrypi4-64 = "(raspberrypi4-64)"
> -
> -require linux-yocto_xen-rpi.inc
> diff --git a/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.15.bbappend b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.15.bbappend
> new file mode 100644
> index 0000000..572f7ec
> --- /dev/null
> +++ b/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.15.bbappend
> @@ -0,0 +1,6 @@
> +# Enable use of the linux-yocto 5.15 kernel for the Raspberry Pi 4
> +KBRANCH:raspberrypi4-64 ?= "v5.15/standard/bcm-2xxx-rpi"
> +KMACHINE:raspberrypi4-64 ?= "bcm-2xxx-rpi4"
> +COMPATIBLE_MACHINE:raspberrypi4-64 = "(raspberrypi4-64)"
> +
> +require linux-yocto_xen-rpi.inc
> --
> 2.25.1
>

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [meta-virtualization][honister][PATCH 2/3] xen: drop patch to workaround prelink on aarch64
  2022-05-21 19:04 ` [meta-virtualization][honister][PATCH 2/3] xen: drop patch to workaround prelink on aarch64 Christopher Clark
@ 2022-05-23  9:55   ` Bertrand Marquis
  0 siblings, 0 replies; 20+ messages in thread
From: Bertrand Marquis @ 2022-05-23  9:55 UTC (permalink / raw)
  To: Christopher Clark; +Cc: meta-virtualization, Bruce Ashfield

Hi,

> On 21 May 2022, at 20:04, Christopher Clark <christopher.w.clark@gmail.com> wrote:
>
> Patch is not needed for image prelinking since the gcc toolchain
> in this branch successfully links Xen without it.
>
> Remove the patch from the stable branch since the BSD license of the
> modified header file differs vs the GPLv2 source code referenced.
> Removal preferred to replacement with a new patch that moves the function
> into GPLv2 .c source files since the build now succeeds without it.
>
> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> ...xen-arm64-implement-atomic-fetch-add.patch | 50 -------------------
> recipes-extended/xen/xen_4.14.bb              |  1 -
> recipes-extended/xen/xen_4.15.bb              |  1 -
> recipes-extended/xen/xen_git.bb               |  1 -
> 4 files changed, 53 deletions(-)
> delete mode 100644 recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch
>
> diff --git a/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch b/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch
> deleted file mode 100644
> index 6e957a5..0000000
> --- a/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch
> +++ /dev/null
> @@ -1,50 +0,0 @@
> -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
> -From: Christopher Clark <christopher.w.clark@gmail.com>
> -Date: Fri, 26 June 2020 16:34:00 -0800
> -Subject: [PATCH] xen: implement atomic op to fix arm64 compilation
> -
> -Xen's ARM implementation of arch_fetch_and_add since f9cc3cd9
> -uses a builtin, despite the build being performed with -fno-builtin.
> -With gcc 10.1.0, this now breaks prelinking spinlock.c, so
> -implement the one atomic operation that is required with logic
> -derived from Linux's atomic_ll_sc.h: ATOMIC_FETCH_OP and comparison with
> -the binary produced with and without the patch with gcc 9.2.0.
> -
> -Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
> -diff --git a/xen/include/asm-arm/system.h b/xen/include/asm-arm/system.h
> -index e5d062667d..c46dd3ac71 100644
> ---- a/xen/include/asm-arm/system.h
> -+++ b/xen/include/asm-arm/system.h
> -@@ -55,7 +55,32 @@ static inline int local_abort_is_enabled(void)
> -     return !(flags & PSR_ABT_MASK);
> - }
> -
> -+#ifdef CONFIG_ARM_64
> -+
> -+/* see atomic_ll_sc.h:  ATOMIC_FETCH_OP(name, mb, acq, rel, cl, op, asm_op, constraint) */
> -+static inline int arch_fetch_and_add(unsigned int *ptr, unsigned long i)
> -+{
> -+    int register lptr asm("x0");
> -+    int register result asm("w1");
> -+    int register newval asm("w2");
> -+    int register status asm("w3");
> -+
> -+    asm volatile(
> -+    "   mov       %[lptr], %[ptr]\n"
> -+    "1: ldxr      %w[result], [%[lptr]]\n"
> -+    "   add       %w[newval], %w[result], %w[i]\n"
> -+    "   stlxr     %w[status], %w[newval], [%[lptr]]\n"
> -+    "   cbnz      %w[status], 1b\n"
> -+    "   dmb       ish\n"
> -+    : [result] "=&r" (result), [lptr] "=&r" (lptr), [newval] "=&r" (newval), [status] "=&r" (status), [i] "+r" (i), "+Q" (*ptr)
> -+    : [ptr] "r" (ptr), "r" (i)
> -+    : "memory");
> -+
> -+    return result;
> -+}
> -+#else
> - #define arch_fetch_and_add(x, v) __sync_fetch_and_add(x, v)
> -+#endif
> -
> - extern struct vcpu *__context_switch(struct vcpu *prev, struct vcpu *next);
> -
> diff --git a/recipes-extended/xen/xen_4.14.bb b/recipes-extended/xen/xen_4.14.bb
> index 0d7d20b..267db16 100644
> --- a/recipes-extended/xen/xen_4.14.bb
> +++ b/recipes-extended/xen/xen_4.14.bb
> @@ -6,7 +6,6 @@ XEN_BRANCH ?= "stable-${XEN_REL}"
>
> SRC_URI = " \
>     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
> -    file://xen-arm64-implement-atomic-fetch-add.patch \
>     file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
>     "
>
> diff --git a/recipes-extended/xen/xen_4.15.bb b/recipes-extended/xen/xen_4.15.bb
> index 0cfaf0c..1b87ae8 100644
> --- a/recipes-extended/xen/xen_4.15.bb
> +++ b/recipes-extended/xen/xen_4.15.bb
> @@ -6,7 +6,6 @@ XEN_BRANCH ?= "stable-${XEN_REL}"
>
> SRC_URI = " \
>     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
> -    file://xen-arm64-implement-atomic-fetch-add.patch \
>     file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
>     "
>
> diff --git a/recipes-extended/xen/xen_git.bb b/recipes-extended/xen/xen_git.bb
> index 3957de1..2fbfb54 100644
> --- a/recipes-extended/xen/xen_git.bb
> +++ b/recipes-extended/xen/xen_git.bb
> @@ -6,7 +6,6 @@ XEN_BRANCH ?= "master"
>
> SRC_URI = " \
>     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
> -    file://xen-arm64-implement-atomic-fetch-add.patch \
>     file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
>     "
>
> --
> 2.25.1
>

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes
  2022-05-21 19:04 [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Christopher Clark
                   ` (11 preceding siblings ...)
  2022-05-23  9:47 ` [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Bertrand Marquis
@ 2022-05-25 15:36 ` Bruce Ashfield
  2022-05-25 17:00   ` Christopher Clark
  12 siblings, 1 reply; 20+ messages in thread
From: Bruce Ashfield @ 2022-05-25 15:36 UTC (permalink / raw)
  To: Christopher Clark; +Cc: meta-virtualization, Doug Goldstein, Bertrand Marquis

On Sat, May 21, 2022 at 3:04 PM Christopher Clark
<christopher.w.clark@gmail.com> wrote:
>
> A series of fixes applied to master and across stable branches where
> needed to fix running Xen on the Raspberry Pi 4 board.
>
> This updates Linux kernel configuration for Xen to remove tracking from
> the linux-yocto-dev kernel, either by applying a fixed revision and
> specification of a stable branch or replacing it with the linux-yocto
> kernel. The Xen build configuration is updated to remove the hypervisor
> defconfig for the Raspberry Pi and drop the arm64 prelink patch as a
> license correction and since the build no longer needs it with the newer
> gcc toolchain.

I appreciate the patches for all the branches, it gives more
confidence in how thorough things look!

I will avoid the EOL branches, but if someone really wants them, they
are on the list and I wouldn't fight too hard about not applying them.

Just so I'm clear, there aren't actually 11 patches, just some of the
patches repeated across the various branches .. totalling 11. If that
is wrong, please do follow up to the branches with more patches, as I
definitely didn't get 11.

Bruce

>
> Tested on hardware.
>
> Christopher Clark
>
> gatesgarth:
>   01: linux-yocto-dev, raspberrypi: apply fixed revision to kernel
>   02: xen: drop patch to workaround prelink on aarch64
>   03: xen: fix boot on the Raspberry Pi 4
>
> hardknott:
>   04: linux-yocto-dev, raspberrypi: apply fixed revision to kernel
>   05: xen: drop patch to workaround prelink on aarch64
>   06: xen: fix boot on the Raspberry Pi 4
>
> honister:
>   07: linux-yocto-dev, xen, raspberrypi: remove tracking bbappend
>   08: xen: drop patch to workaround prelink on aarch64
>   09: xen: fix boot on the Raspberry Pi 4 with Xen 4.14
>
> kirkstone:
>   10: xen, raspberry pi: replace linux-yocto-dev with linux-yocto 5.15
>
> master:
>   11: xen, raspberry pi: replace linux-yocto-dev with linux-yocto 5.15



-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes
  2022-05-25 15:36 ` Bruce Ashfield
@ 2022-05-25 17:00   ` Christopher Clark
  0 siblings, 0 replies; 20+ messages in thread
From: Christopher Clark @ 2022-05-25 17:00 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: meta-virtualization, Doug Goldstein, Bertrand Marquis

 On Wed, May 25, 2022 at 8:36 AM Bruce Ashfield
<bruce.ashfield@gmail.com> wrote:
>
> On Sat, May 21, 2022 at 3:04 PM Christopher Clark
> <christopher.w.clark@gmail.com> wrote:
> >
> > A series of fixes applied to master and across stable branches where
> > needed to fix running Xen on the Raspberry Pi 4 board.
> >
> > This updates Linux kernel configuration for Xen to remove tracking from
> > the linux-yocto-dev kernel, either by applying a fixed revision and
> > specification of a stable branch or replacing it with the linux-yocto
> > kernel. The Xen build configuration is updated to remove the hypervisor
> > defconfig for the Raspberry Pi and drop the arm64 prelink patch as a
> > license correction and since the build no longer needs it with the newer
> > gcc toolchain.
>
> I appreciate the patches for all the branches, it gives more
> confidence in how thorough things look!
>
> I will avoid the EOL branches, but if someone really wants them, they
> are on the list and I wouldn't fight too hard about not applying them.

ack, ok

> Just so I'm clear, there aren't actually 11 patches, just some of the
> patches repeated across the various branches .. totalling 11. If that
> is wrong, please do follow up to the branches with more patches, as I
> definitely didn't get 11.

It is a bit confusing, sorry - I sent 11 patches in total, so I put
"0/11" on the cover letter, but that's the total over 5 branches.
(They are in sequence starting here:
https://lists.yoctoproject.org/g/meta-virtualization/message/7298 and
listed in the first message in this thread)
When I sent each patch, I put the branch name that the patch applies
to in the Subject line.

There are at most 3 patches for any given branch, and although the
patches do look similar between branches, there are small differences:
eg. selection of "v5.10/standard/bcm-2xxx-rpi" for gatesgarth vs
"v5.12/standard/bcm-2xxx-rpi" for hardknott, reflecting the state of
linux-yocto-dev at the point that the branch was active.
So I sent the patches that I tested in each branch, and I would
recommend applying the sent one rather than picking similar ones
across between branches for these.

thanks,

Christopher

>
> Bruce
>
> >
> > Tested on hardware.
> >
> > Christopher Clark
> >
> > gatesgarth:
> >   01: linux-yocto-dev, raspberrypi: apply fixed revision to kernel
> >   02: xen: drop patch to workaround prelink on aarch64
> >   03: xen: fix boot on the Raspberry Pi 4
> >
> > hardknott:
> >   04: linux-yocto-dev, raspberrypi: apply fixed revision to kernel
> >   05: xen: drop patch to workaround prelink on aarch64
> >   06: xen: fix boot on the Raspberry Pi 4
> >
> > honister:
> >   07: linux-yocto-dev, xen, raspberrypi: remove tracking bbappend
> >   08: xen: drop patch to workaround prelink on aarch64
> >   09: xen: fix boot on the Raspberry Pi 4 with Xen 4.14
> >
> > kirkstone:
> >   10: xen, raspberry pi: replace linux-yocto-dev with linux-yocto 5.15
> >
> > master:
> >   11: xen, raspberry pi: replace linux-yocto-dev with linux-yocto 5.15
>
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2022-05-25 17:00 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-21 19:04 [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Christopher Clark
2022-05-21 19:04 ` [meta-virtualization][gatesgarth][PATCH 1/3] linux-yocto-dev, raspberrypi: apply fixed revision to kernel Christopher Clark
2022-05-21 19:04 ` [meta-virtualization][gatesgarth][PATCH 2/3] xen: drop patch to workaround prelink on aarch64 Christopher Clark
2022-05-21 19:04 ` [meta-virtualization][gatesgarth][PATCH 3/3] xen: fix boot on the Raspberry Pi 4 Christopher Clark
2022-05-21 19:04 ` [meta-virtualization][hardknott][PATCH 1/3] linux-yocto-dev, raspberrypi: apply fixed revision to kernel Christopher Clark
2022-05-21 19:04 ` [meta-virtualization][hardknott][PATCH 2/3] xen: drop patch to workaround prelink on aarch64 Christopher Clark
2022-05-21 19:04 ` [meta-virtualization][hardknott][PATCH 3/3] xen: fix boot on the Raspberry Pi 4 with Xen 4.14 Christopher Clark
2022-05-21 19:04 ` [meta-virtualization][honister][PATCH 1/3] linux-yocto-dev, xen, raspberrypi: remove tracking bbappend Christopher Clark
2022-05-23  9:50   ` Bertrand Marquis
2022-05-21 19:04 ` [meta-virtualization][honister][PATCH 2/3] xen: drop patch to workaround prelink on aarch64 Christopher Clark
2022-05-23  9:55   ` Bertrand Marquis
2022-05-21 19:04 ` [meta-virtualization][honister][PATCH 3/3] xen: fix boot on the Raspberry Pi 4 with Xen 4.14 Christopher Clark
2022-05-23  9:50   ` Bertrand Marquis
2022-05-21 19:04 ` [meta-virtualization][kirkstone][PATCH] xen, raspberry pi: replace linux-yocto-dev with linux-yocto 5.15 Christopher Clark
2022-05-23  9:53   ` Bertrand Marquis
2022-05-21 19:04 ` [meta-virtualization][PATCH] " Christopher Clark
2022-05-23  9:53   ` Bertrand Marquis
2022-05-23  9:47 ` [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Bertrand Marquis
2022-05-25 15:36 ` Bruce Ashfield
2022-05-25 17:00   ` Christopher Clark

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.