Skip to contentSkip to conversation

arm/libts: Patch to fix 6.10 kernel builds breaks

PATCH New Jon Mason 1 participant 3 messages Sep 17, 2024

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

PATCH v2 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.

optee and arm ffa driver are logging non-fatal errors in dmesg, which is causing the parselogs test to fail. This is due to arm ffa needing givc3.

---
 meta-arm-bsp/conf/machine/fvp-base.conf       |   2 -
 .../conf/machine/qemuarm64-secureboot.conf    |   3 -
 ...parselogs-ignores-qemuarm64-secureboot.txt |   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, 229 insertions(+), 30 deletions(-)
 create mode 100644 meta-arm/lib/oeqa/runtime/cases/parselogs-ignores-qemuarm64-secureboot.txt
 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
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/lib/oeqa/runtime/cases/parselogs-ignores-qemuarm64-secureboot.txt new file +3 -0
new file mode 100644
index 000000000000..92de01b66a63
@@ -0,0 +1,3 @@
+optee: Failed to initialize async notifications: -95
+ARM FF-A: Failed to register driver sched callback -95
+ARM FF-A: Notification setup failed -95, not enabled
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 v2 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 v2 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 58231731b918..f397c641c407 100644
@@ -1236,25 +1236,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)