Skip to contentSkip to conversation

arm-bsp/fvp-base: support poky-altcfg

PATCH Applied Jon Mason 3 participants 5 messages Sep 20, 2024 – Sep 24, 2024

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

PATCH 1/3 arm-bsp/fvp-base: support poky-altcfg

Add the bits to enable poky-altcfg to boot to prompt on fvp-base. Unfortunately, ssh takes a very long time to come up, which causes the ssh test to timeout. So, don't enable this by default in CI. Also, switch to building full-cmdline instead of sato, since we're never actually testing the graphics on this platform.

---
 ci/fvp-base.yml                         | 2 +-
 meta-arm-bsp/conf/machine/fvp-base.conf | 6 ++++--
 meta-arm/wic/efi-disk.wks.in            | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)
ci/fvp-base.yml +1 -1
index bbc6c44db3be..5719ea8066aa 100644
@@ -9,5 +9,5 @@ header:
 machine: fvp-base
 
 target:
-  - core-image-sato
+  - core-image-full-cmdline
   - boot-wrapper-aarch64
meta-arm-bsp/conf/machine/fvp-base.conf +4 -2
index 353024e26b72..cbfd79d25828 100644
@@ -11,13 +11,15 @@ ARM_SYSTEMREADY_ACS_CONSOLE = "default"
 EXTRA_IMAGEDEPENDS = "${ARM_SYSTEMREADY_FIRMWARE}"
 PREFERRED_VERSION_trusted-firmware-a ?= "2.10.%"
 
-MACHINE_FEATURES = "efi"
+MACHINE_FEATURES = "efi vfat"
 
 IMAGE_NAME_SUFFIX = ""
 IMAGE_FSTYPES += "wic"
 WKS_FILE ?= "efi-disk.wks.in"
 
 SERIAL_CONSOLES = "115200;ttyAMA0"
+# FIXME -  This is being upstreamed.  Remove once that has occurred.
+KERNEL_CONSOLE ?= "${@','.join(d.getVar('SERIAL_CONSOLES').split(' ')[0].split(';')[::-1]) or 'ttyS0'}"
 
 PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
 KERNEL_DTB_NAME = "fvp-base-revc.dtb"
@@ -29,7 +31,7 @@ EXTRA_IMAGEDEPENDS += "trusted-firmware-a"
 # FVP u-boot configuration
 UBOOT_MACHINE = "vexpress_fvp_defconfig"
 
-EFI_PROVIDER ?= "grub-efi"
+EFI_PROVIDER ?= "${@bb.utils.contains("DISTRO_FEATURES", "systemd", "systemd-boot", "grub-efi", d)}"
 
 # As this is a virtual target that will not be used in the real world there is
 # no need for real SSH keys.
meta-arm/wic/efi-disk.wks.in +1 -1
index 198ae2a6d0b8..e1120da056cd 100644
@@ -8,4 +8,4 @@ part / --source rootfs --fstype=ext4 --label root --align 1024 --use-uuid
 
 part swap --size 44 --label swap --fstype=swap --use-uuid
 
-bootloader --ptable gpt --timeout=5 --append="rootwait rootfstype=ext4"
+bootloader --ptable gpt --timeout=5 --append="rootwait rootfstype=ext4 console=${KERNEL_CONSOLE}"
Signature · 1 line
2.39.3 (Apple Git-146)
author
#1 lore raw

PATCH 2/3 arm-bsp/fvp-base: Get 6.10 kernel working

Apply upstream patch to get virtio networking functioning again and switch to the 6.10 kernel.

---
 ...gso-csum-offset-check-in-virtio_net_.patch | 59 +++++++++++++++++++
 .../linux/linux-arm-platforms.inc             |  1 +
 2 files changed, 60 insertions(+)
 create mode 100644 meta-arm-bsp/recipes-kernel/linux/files/fvp-base/0001-net-tighten-bad-gso-csum-offset-check-in-virtio_net_.patch
meta-arm-bsp/recipes-kernel/linux/files/fvp-base/0001-net-tighten-bad-gso-csum-offset-check-in-virtio_net_.patch new file +59 -0
new file mode 100644
index 000000000000..9985d57966f4
@@ -0,0 +1,59 @@
+From 6513eb3d3191574b58859ef2d6dc26c0277c6f81 Mon Sep 17 00:00:00 2001
+From: Willem de Bruijn <[email protected]>
+Date: Tue, 10 Sep 2024 17:35:35 -0400
+Subject: [PATCH] net: tighten bad gso csum offset check in virtio_net_hdr
+
+The referenced commit drops bad input, but has false positives.
+Tighten the check to avoid these.
+
+The check detects illegal checksum offload requests, which produce
+csum_start/csum_off beyond end of packet after segmentation.
+
+But it is based on two incorrect assumptions:
+
+1. virtio_net_hdr_to_skb with VIRTIO_NET_HDR_GSO_TCP[46] implies GSO.
+True in callers that inject into the tx path, such as tap.
+But false in callers that inject into rx, like virtio-net.
+Here, the flags indicate GRO, and CHECKSUM_UNNECESSARY or
+CHECKSUM_NONE without VIRTIO_NET_HDR_F_NEEDS_CSUM is normal.
+
+2. TSO requires checksum offload, i.e., ip_summed == CHECKSUM_PARTIAL.
+False, as tcp[46]_gso_segment will fix up csum_start and offset for
+all other ip_summed by calling __tcp_v4_send_check.
+
+Because of 2, we can limit the scope of the fix to virtio_net_hdr
+that do try to set these fields, with a bogus value.
+
+Link: https://lore.kernel.org/netdev/[email protected]/
+Fixes: 89add40066f9 ("net: drop bad gso csum_start and offset in virtio_net_hdr")
+Signed-off-by: Willem de Bruijn <[email protected]>
+Acked-by: Jason Wang <[email protected]>
+Acked-by: Michael S. Tsirkin <[email protected]>
+Cc: [email protected]
+Link: https://patch.msgid.link/[email protected]
+Signed-off-by: Jakub Kicinski <[email protected]>
+
+Upstream-Status: Backport
+Signed-off-by: Jon Mason <[email protected]>
+
+---
+ include/linux/virtio_net.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
+index 6c395a2600e8..276ca543ef44 100644
+--- a/include/linux/virtio_net.h
++++ b/include/linux/virtio_net.h
+@@ -173,7 +173,8 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,
+ 			break;
+ 		case SKB_GSO_TCPV4:
+ 		case SKB_GSO_TCPV6:
+-			if (skb->csum_offset != offsetof(struct tcphdr, check))
++			if (skb->ip_summed == CHECKSUM_PARTIAL &&
++			    skb->csum_offset != offsetof(struct tcphdr, check))
+ 				return -EINVAL;
+ 			break;
+ 		}
+-- 
+2.39.2
+
meta-arm-bsp/recipes-kernel/linux/linux-arm-platforms.inc +1 -0
index 01803ba20561..ac7bcf7a9ab9 100644
@@ -65,6 +65,7 @@ KMACHINE:fvp-base = "fvp"
 FILESEXTRAPATHS:prepend:fvp-base := "${ARMBSPFILESPATHS}:${ARMFILESPATHS}"
 SRC_URI:append:fvp-base = " \
     file://0001-arm64-dts-fvp-Enable-virtio-rng-support.patch \
+    file://0001-net-tighten-bad-gso-csum-offset-check-in-virtio_net_.patch \
     file://tee.cfg \
     ${@bb.utils.contains('MACHINE_FEATURES', 'ts-smm-gateway', \
                          'file://no-strict-devmem.cfg', '' , d)} \
Signature · 1 line
2.39.3 (Apple Git-146)
author
#2 lore raw

PATCH 3/3 arm-bsp/fvp: Re-enable parselogs

In reply to Jon Mason

Re-enable parselogs testing for fvp-base and corstone1000-fvp, and add an ignore file for the relevant entries. Also, increase the testing being done on corstone1000-fvp.

---
 ci/fvp.yml                                                | 5 -----
 meta-arm-bsp/conf/machine/corstone1000-fvp.conf           | 3 ++-
 .../runtime/cases/parselogs-ignores-corstone1000-fvp.txt  | 8 ++++++++
 .../lib/oeqa/runtime/cases/parselogs-ignores-fvp-base.txt | 1 +
 4 files changed, 11 insertions(+), 6 deletions(-)
 create mode 100644 meta-arm-bsp/lib/oeqa/runtime/cases/parselogs-ignores-corstone1000-fvp.txt
 create mode 100644 meta-arm-bsp/lib/oeqa/runtime/cases/parselogs-ignores-fvp-base.txt
ci/fvp.yml +0 -5
index 2bf1cef024a8..667bb641092a 100644
@@ -7,8 +7,3 @@ local_conf_header:
   testimagefvp: |
     LICENSE_FLAGS_ACCEPTED += "Arm-FVP-EULA"
     IMAGE_CLASSES += "fvpboot"
-  failing_tests: |
-    # This fails but we can't add to the ignorelist from meta-arm yet
-    # https://bugzilla.yoctoproject.org/show_bug.cgi?id=14604
-    TEST_SUITES:remove = "parselogs"
-    TEST_SUITES:remove = "xorg"
meta-arm-bsp/conf/machine/corstone1000-fvp.conf +2 -1
index 2c724bfeb2b8..a605a695b19a 100644
@@ -9,7 +9,8 @@ TFM_PLATFORM_IS_FVP = "TRUE"
 
 # testimage config
 TEST_TARGET = "OEFVPTarget"
-TEST_SUITES = "fvp_boot"
+TEST_TARGET_IP = "127.0.0.1:2222"
+DEFAULT_TEST_SUITES:append = " fvp_boot fvp_devices"
 
 # FVP Config
 FVP_PROVIDER ?= "fvp-corstone1000-native"
meta-arm-bsp/lib/oeqa/runtime/cases/parselogs-ignores-corstone1000-fvp.txt new file +8 -0
new file mode 100644
index 000000000000..63cef943e792
@@ -0,0 +1,8 @@
+psci: failed to boot CPU1 (-95)
+CPU1: failed to boot: -95
+psci: failed to boot CPU2 (-95)
+CPU2: failed to boot: -95
+psci: failed to boot CPU3 (-95)
+CPU3: failed to boot: -95
+ARM FF-A: Notification setup failed -95, not enabled
+ARM FF-A: Failed to register driver sched callback -95
meta-arm-bsp/lib/oeqa/runtime/cases/parselogs-ignores-fvp-base.txt new file +1 -0
new file mode 100644
index 000000000000..eaffc181556b
@@ -0,0 +1 @@
+basic-mmio-gpio: Failed to locate of_node [id: -2]
Signature · 1 line
2.39.3 (Apple Git-146)
#3 lore raw

Re: [meta-arm] [PATCH 3/3] arm-bsp/fvp: Re-enable parselogs

Hi,

One minor issue,

Quoted 47 lines · Jon Mason via lists.yoctoproject.org

Re-enable parselogs testing for fvp-base and corstone1000-fvp, and add an ignore file for the relevant entries. Also, increase the testing being done on corstone1000-fvp.

---
 ci/fvp.yml                                                | 5 -----
 meta-arm-bsp/conf/machine/corstone1000-fvp.conf           | 3 ++-
 .../runtime/cases/parselogs-ignores-corstone1000-fvp.txt  | 8 ++++++++
 .../lib/oeqa/runtime/cases/parselogs-ignores-fvp-base.txt | 1 +
 4 files changed, 11 insertions(+), 6 deletions(-)
 create mode 100644 meta-arm-bsp/lib/oeqa/runtime/cases/parselogs-ignores-corstone1000-fvp.txt
 create mode 100644 meta-arm-bsp/lib/oeqa/runtime/cases/parselogs-ignores-fvp-base.txt
ci/fvp.yml +0 -5
index 2bf1cef024a8..667bb641092a 100644
@@ -7,8 +7,3 @@ local_conf_header:
   testimagefvp: |
     LICENSE_FLAGS_ACCEPTED += "Arm-FVP-EULA"
     IMAGE_CLASSES += "fvpboot"
-  failing_tests: |
-    # This fails but we can't add to the ignorelist from meta-arm yet
-    # https://bugzilla.yoctoproject.org/show_bug.cgi?id=14604
-    TEST_SUITES:remove = "parselogs"
-    TEST_SUITES:remove = "xorg"
meta-arm-bsp/conf/machine/corstone1000-fvp.conf +2 -1
index 2c724bfeb2b8..a605a695b19a 100644
@@ -9,7 +9,8 @@ TFM_PLATFORM_IS_FVP = "TRUE"
 
 # testimage config
 TEST_TARGET = "OEFVPTarget"
-TEST_SUITES = "fvp_boot"
+TEST_TARGET_IP = "127.0.0.1:2222"
+DEFAULT_TEST_SUITES:append = " fvp_boot fvp_devices"
 
 # FVP Config
 FVP_PROVIDER ?= "fvp-corstone1000-native"
meta-arm-bsp/lib/oeqa/runtime/cases/parselogs-ignores-corstone1000-fvp.txt new file +0 -0
new file mode 100644
index 000000000000..63cef943e792

meta-arm-bsp/lib/oeqa/runtime/cases/parselogs-ignores-corstone1000-fvp.txt line 8

Quoted 8 lines
meta-arm-bsp/lib/oeqa/runtime/cases/parselogs-ignores-corstone1000-fvp.txt new file +8 -0
@@ -0,0 +1,8 @@
+psci: failed to boot CPU1 (-95)
+CPU1: failed to boot: -95
+psci: failed to boot CPU2 (-95)
+CPU2: failed to boot: -95
+psci: failed to boot CPU3 (-95)
+CPU3: failed to boot: -95
+ARM FF-A: Notification setup failed -95, not enabled
+ARM FF-A: Failed to register driver sched callback -95

These lines could be amended with comment lines using # in case some analysis of the failures has been done. Sometimes these could be open bug reports to upstream etc or HW related quirks.

Cheers,

-Mikko

Applied
#4 lore raw
In reply to Jon Mason
Quoted 8 lines · Jon Mason

Add the bits to enable poky-altcfg to boot to prompt on fvp-base. Unfortunately, ssh takes a very long time to come up, which causes the ssh test to timeout. So, don't enable this by default in CI. Also, switch to building full-cmdline instead of sato, since we're never actually testing the graphics on this platform.

[...]

Applied, thanks!

[1/3] arm-bsp/fvp-base: support poky-altcfg

      commit: a6e74d3926dbd5ad1d7e1ebab60371d807f545d2
[2/3] arm-bsp/fvp-base: Get 6.10 kernel working
      commit: 60fd47edd0f4757c11554848d717283f06c8c846
[3/3] arm-bsp/fvp: Re-enable parselogs
      commit: ea2c1ab5db4e2bd9ad0e93534f62391c86417a0c

Best regards,

Signature · 1 line
Jon Mason <[email protected]>