Skip to contentSkip to conversation

arm/libts: Patch to fix 6.10 kernel builds breaks

PATCH Applied Jon Mason 3 participants 6 messages Sep 4, 2024 – Sep 19, 2024

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

PATCH 1/3 arm/libts: Patch to fix 6.10 kernel builds breaks

The ts-tee driver was upstreamed into the v6.10 kernel. Remove arm-tstee driver package, since the upstream one should be used.

Parselogs is failing on the qemuarm64-secureboot tests because the arm ffs linux kernel driver requires gicv3 to be in the DT and logs an error if not (though still appears to work).

---
 ci/qemuarm64-secureboot-ts.yml                |   1 +
 meta-arm-bsp/conf/machine/fvp-base.conf       |   2 -
 .../conf/machine/qemuarm64-secureboot.conf    |   3 -
 .../arm-tstee/arm-tstee_2.0.0.bb              |  23 --
 .../linux/files/arm-ffa-transport.cfg         |   1 +
 ...Remove-TEE-driver-external-component.patch | 223 ++++++++++++++++++
 .../trusted-services/libts_git.bb             |   4 +-
 7 files changed, 227 insertions(+), 30 deletions(-)
 delete mode 100644 meta-arm/recipes-kernel/arm-tstee/arm-tstee_2.0.0.bb
 create mode 100644 meta-arm/recipes-security/trusted-services/libts/0001-Remove-TEE-driver-external-component.patch
ci/qemuarm64-secureboot-ts.yml +1 -0
index 87f0fa9ed888..fc35d3f38b18 100644
@@ -8,6 +8,7 @@ header:
 local_conf_header:
   trusted_services: |
     TEST_SUITES:append = " trusted_services"
+    TEST_SUITES:remove = "parselogs"
     # Include TS Crypto, TS Protected Storage, and TS Internal Trusted Storage and SPs into optee-os image
     # FIXME - remove TS SMM Gateway due to QEMU v9.0.0 test failures
     MACHINE_FEATURES:append = " arm-ffa ts-crypto ts-storage ts-its"
meta-arm-bsp/conf/machine/fvp-base.conf +0 -2
index 2fc49fc7bfe2..353024e26b72 100644
@@ -23,8 +23,6 @@ PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
 KERNEL_DTB_NAME = "fvp-base-revc.dtb"
 KERNEL_DEVICETREE = "arm/${KERNEL_DTB_NAME}"
 KERNEL_IMAGETYPE = "Image"
-#FIXME - Working around arm-tstee not compiling on kernels greater than 6.8
-PREFERRED_VERSION_linux-yocto ?= "6.6.%"
 
 EXTRA_IMAGEDEPENDS += "trusted-firmware-a"
 
meta-arm/conf/machine/qemuarm64-secureboot.conf +0 -3
index cfc6ff7706fb..78a39c03c1bd 100644
@@ -3,9 +3,6 @@ MACHINEOVERRIDES =. "qemuarm64:"
 require ${COREBASE}/meta/conf/machine/qemuarm64.conf
 
 KMACHINE = "qemuarm64"
-#FIXME - Working around arm-tstee not compiling on kernels greater than 6.8
-PREFERRED_VERSION_linux-yocto ?= "6.6.%"
-PREFERRED_VERSION_linux-yocto-rt ?= "6.6.%"
 
 # secure=on can't ever use KVM, so force it off
 QEMU_USE_KVM = ""
meta-arm/recipes-kernel/arm-tstee/arm-tstee_2.0.0.bb deleted +0 -23
deleted file mode 100644
index 34beac945ffa..000000000000
@@ -1,23 +0,0 @@
-SUMMARY = "A Linux kernel module providing user space access to Trusted Services"
-DESCRIPTION = "${SUMMARY}"
-LICENSE = "GPL-2.0-only"
-LIC_FILES_CHKSUM = "file://COPYING;md5=05e355bbd617507216a836c56cf24983"
-
-inherit module
-
-SRC_URI = "git://gitlab.arm.com/linux-arm/linux-trusted-services;protocol=https;branch=main \
-           file://Makefile;subdir=git \
-          "
-S = "${WORKDIR}/git"
-
-# Tag tee-v2.0.0
-SRCREV = "a2d7349a96c3b3afb44bf1555d53f1c46e45a23d"
-UPSTREAM_CHECK_GITTAGREGEX = "^tee-v(?P<pver>\d+(\.\d+)+)$"
-
-COMPATIBLE_HOST = "(arm|aarch64).*-linux"
-KERNEL_MODULE_AUTOLOAD += "arm-tstee"
-
-do_install:append() {
-    install -d ${D}${includedir}
-    install -m 0644 ${S}/uapi/arm_tstee.h ${D}${includedir}/
-}
meta-arm/recipes-kernel/linux/files/arm-ffa-transport.cfg +1 -0
index 34de78e8955d..53f19610ccaf 100644
@@ -1 +1,2 @@
 CONFIG_ARM_FFA_TRANSPORT=y
+CONFIG_ARM_TSTEE=y
meta-arm/recipes-security/trusted-services/libts/0001-Remove-TEE-driver-external-component.patch new file +223 -0

223 lines not on this page · raw message

meta-arm/recipes-security/trusted-services/libts_git.bb +2 -2
index dfcd4bde98e0..635e4769afd4 100644
@@ -6,12 +6,12 @@ TS_ENV = "arm-linux"
 require trusted-services.inc
 
 SRC_URI += "file://tee-udev.rules \
+            file://0001-Remove-TEE-driver-external-component.patch \
            "
 
 OECMAKE_SOURCEPATH="${S}/deployments/libts/${TS_ENV}"
 
-DEPENDS           += "arm-tstee arm-ffa-user"
-RRECOMMENDS:${PN} += "arm-tstee"
+DEPENDS           += "arm-ffa-user"
 
 # Unix group name for dev/tee* ownership.
 TEE_GROUP_NAME ?= "teeclnt"
Signature · 1 line
2.39.3 (Apple Git-146)
author
#1 lore raw

PATCH 2/3 arm-bsp/linux-yocto: corstone1000: bump to v6.10

From: Bence Balogh <[email protected]>

This commit updates the linux-yocto version to the latest availabe one. No additional work was needed to make it work in Corstone-1000.

---
 meta-arm-bsp/conf/machine/include/corstone1000.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-arm-bsp/conf/machine/include/corstone1000.inc +1 -1
index db1880e56a59..d65906362d54 100644
@@ -34,7 +34,7 @@ IMAGE_CMD:wic[vardeps] += "GRUB_LINUX_APPEND"
 
 # Linux kernel
 PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
-PREFERRED_VERSION_linux-yocto ?= "6.6.%"
+PREFERRED_VERSION_linux-yocto ?= "6.10.%"
 KERNEL_IMAGETYPE = "Image"
 KERNEL_IMAGETYPE:firmware = "Image.gz"
 # add FF-A support in the kernel
Signature · 1 line
2.39.3 (Apple Git-146)
author
#2 lore raw

PATCH 3/3 arm-bsp/documentation: corstone1000: remove TEE driver load

In reply to Jon Mason

From: Bence Balogh <[email protected]>

The arm-tstee driver was upstreamed to the v6.10 kernel so it doesn't have to be loaded manually. Updated the related parts in the Corstone-1000 user guide.

---
 .../documentation/corstone1000/user-guide.rst | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
meta-arm-bsp/documentation/corstone1000/user-guide.rst +9 -10
index 359caf2d572c..038f8ad34eba 100644
@@ -1232,25 +1232,24 @@ When running the tests on the Corstone-1000 FVP, the user should follow the
 instructions in `Running the software on FVP`_ section to boot Linux in FVP
 host_terminal_0, and login using the username ``root``.
 
-First, load FF-A TEE kernel module:
+The tests use the `arm_tstee` driver to access Trusted Services Secure Partitions from user space.
+This driver is included in the Linux Kernel, starting from v6.10.
 
-::
-
-  insmod /lib/modules/*-yocto-standard/updates/arm-tstee.ko
-
-Then, check whether the FF-A TEE driver is loaded correctly by using the following command:
+Run the following command in the Host terminal (ttyUSB2) to verify that the driver is present:
 
 ::
 
-  cat /proc/modules | grep arm_tstee
+  ls /sys/bus/arm_ffa/drivers | grep arm_tstee
 
-The output should be similar to:
+
+The output should be:
 
 ::
 
-   arm_tstee 16384 - - Live 0xffffffc000510000 (O)
+  arm_tstee
+
 
-Now, run the PSA API tests in the following order:
+Run the PSA API tests in the following order:
 
 ::
 
Signature · 1 line
2.39.3 (Apple Git-146)
#3 lore raw
In reply to Jon Mason

Hi,

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

The ts-tee driver was upstreamed into the v6.10 kernel. Remove arm-tstee driver package, since the upstream one should be used.

Parselogs is failing on the qemuarm64-secureboot tests because the arm ffs linux kernel driver requires gicv3 to be in the DT and logs an error if not (though still appears to work).

I think it would be better to filter out the specific warnings via meta-arm side ignore list entries in meta-arm/lib/oeqa/runtime/cases/parselogs-ignores-qemuarm64-secureboot.txt. File content is the error string which is acceptable for now.

poky/meta/lib/oeqa/runtime/cases/parselogs-ignores-* has examples.

Cheers,

-Mikko

#4 lore raw
Quoted 11 lines · Mikko Rapeli via lists.yoctoproject.org

Hi,

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

The ts-tee driver was upstreamed into the v6.10 kernel. Remove arm-tstee driver package, since the upstream one should be used.

Parselogs is failing on the qemuarm64-secureboot tests because the arm ffs linux kernel driver requires gicv3 to be in the DT and logs an error if not (though still appears to work).

Quoted 6 lines

I think it would be better to filter out the specific warnings via meta-arm side ignore list entries in meta-arm/lib/oeqa/runtime/cases/parselogs-ignores-qemuarm64-secureboot.txt. File content is the error string which is acceptable for now.

poky/meta/lib/oeqa/runtime/cases/parselogs-ignores-* has examples.

Thanks so much for letting me know about this. I'll do as you suggest and ignore the appropriate errors, and send out a v2

Thanks,
Jon

Quoted 13 lines

Cheers,

-Mikko

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#6060): https://lists.yoctoproject.org/g/meta-arm/message/6060
Mute This Topic: https://lists.yoctoproject.org/mt/108266536/3616920
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-arm/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

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

The ts-tee driver was upstreamed into the v6.10 kernel. Remove arm-tstee driver package, since the upstream one should be used.

Parselogs is failing on the qemuarm64-secureboot tests because the arm ffs linux kernel driver requires gicv3 to be in the DT and logs an error if not (though still appears to work).

[...]

Applied, thanks!

[1/3] arm/libts: Patch to fix 6.10 kernel builds breaks

      commit: 5c12aab7973711154bf850d7252e7e7d35be4f31
[2/3] arm-bsp/linux-yocto: corstone1000: bump to v6.10
      commit: bd1e228d4a35fc2d2fd64e8cdd00cbff322a26cf
[3/3] arm-bsp/documentation: corstone1000: remove TEE driver load
      commit: 6ce3f43792bc669767315b5cd3a85545f832098e

Best regards,

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