From patchwork Mon Jun 5 13:01:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Mason X-Patchwork-Id: 25130 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F41AC77B73 for ; Mon, 5 Jun 2023 13:02:03 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.6905.1685970122286774281 for ; Mon, 05 Jun 2023 06:02:02 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: jon.mason@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DEEA1D75 for ; Mon, 5 Jun 2023 06:02:46 -0700 (PDT) Received: from debian.lan?044arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 39C423F663 for ; Mon, 5 Jun 2023 06:02:01 -0700 (PDT) From: Jon Mason To: meta-arm@lists.yoctoproject.org Subject: [PATCH 1/4] arm/linux-yocto: remove unused 5.15 patches and inc file Date: Mon, 5 Jun 2023 08:01:53 -0500 Message-Id: <20230605130156.3309199-1-jon.mason@arm.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 05 Jun 2023 13:02:03 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/4722 Signed-off-by: Jon Mason --- .../recipes-kernel/linux/arm-ffa-5.15.inc | 5 -- .../Add-sec_world_id-to-struct-tee_shm.patch | 44 ---------- .../skip-unavailable-memory.patch | 85 ------------------- 3 files changed, 134 deletions(-) delete mode 100644 meta-arm/recipes-kernel/linux/arm-ffa-5.15.inc delete mode 100644 meta-arm/recipes-kernel/linux/linux-yocto-5.15/Add-sec_world_id-to-struct-tee_shm.patch delete mode 100644 meta-arm/recipes-kernel/linux/linux-yocto-5.15/skip-unavailable-memory.patch diff --git a/meta-arm/recipes-kernel/linux/arm-ffa-5.15.inc b/meta-arm/recipes-kernel/linux/arm-ffa-5.15.inc deleted file mode 100644 index bc66efbf..00000000 --- a/meta-arm/recipes-kernel/linux/arm-ffa-5.15.inc +++ /dev/null @@ -1,5 +0,0 @@ -# Include a backport kernel patch for TEE driver - -SRC_URI:append = " \ - file://Add-sec_world_id-to-struct-tee_shm.patch \ - " diff --git a/meta-arm/recipes-kernel/linux/linux-yocto-5.15/Add-sec_world_id-to-struct-tee_shm.patch b/meta-arm/recipes-kernel/linux/linux-yocto-5.15/Add-sec_world_id-to-struct-tee_shm.patch deleted file mode 100644 index 8f54b308..00000000 --- a/meta-arm/recipes-kernel/linux/linux-yocto-5.15/Add-sec_world_id-to-struct-tee_shm.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 9028b2463c1ea96f51c3ba53e2479346019ff6ad Mon Sep 17 00:00:00 2001 -From: Jens Wiklander -Date: Thu, 25 Mar 2021 15:08:44 +0100 -Subject: [PATCH] tee: add sec_world_id to struct tee_shm - -Adds sec_world_id to struct tee_shm which describes a shared memory -object. sec_world_id can be used by a driver to store an id assigned by -secure world. - -Reviewed-by: Sumit Garg -Signed-off-by: Jens Wiklander - -Upstream-Status: Submitted [https://github.com/torvalds/linux/commit/9028b2463c1ea96f51c3ba53e2479346019ff6ad] -Signed-off-by: Anton Antonov - ---- - include/linux/tee_drv.h | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h -index 3ebfea0781f100..a1f03461369bd9 100644 ---- a/include/linux/tee_drv.h -+++ b/include/linux/tee_drv.h -@@ -197,7 +197,11 @@ int tee_session_calc_client_uuid(uuid_t *uuid, u32 connection_method, - * @num_pages: number of locked pages - * @dmabuf: dmabuf used to for exporting to user space - * @flags: defined by TEE_SHM_* in tee_drv.h -- * @id: unique id of a shared memory object on this device -+ * @id: unique id of a shared memory object on this device, shared -+ * with user space -+ * @sec_world_id: -+ * secure world assigned id of this shared memory object, not -+ * used by all drivers - * - * This pool is only supposed to be accessed directly from the TEE - * subsystem and from drivers that implements their own shm pool manager. -@@ -213,6 +217,7 @@ struct tee_shm { - struct dma_buf *dmabuf; - u32 flags; - int id; -+ u64 sec_world_id; - }; - - /** diff --git a/meta-arm/recipes-kernel/linux/linux-yocto-5.15/skip-unavailable-memory.patch b/meta-arm/recipes-kernel/linux/linux-yocto-5.15/skip-unavailable-memory.patch deleted file mode 100644 index d157ef70..00000000 --- a/meta-arm/recipes-kernel/linux/linux-yocto-5.15/skip-unavailable-memory.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 7bfeda1c9224270af97adf799ce0b5a4292bceb6 Mon Sep 17 00:00:00 2001 -From: Andre Przywara -Date: Tue, 17 May 2022 11:14:10 +0100 -Subject: [PATCH] of/fdt: Ignore disabled memory nodes - -When we boot a machine using a devicetree, the generic DT code goes -through all nodes with a 'device_type = "memory"' property, and collects -all memory banks mentioned there. However it does not check for the -status property, so any nodes which are explicitly "disabled" will still -be added as a memblock. -This ends up badly for QEMU, when booting with secure firmware on -arm/arm64 machines, because QEMU adds a node describing secure-only -memory: -=================== - secram@e000000 { - secure-status = "okay"; - status = "disabled"; - reg = <0x00 0xe000000 0x00 0x1000000>; - device_type = "memory"; - }; -=================== - -The kernel will eventually use that memory block (which is located below -the main DRAM bank), but accesses to that will be answered with an -SError: -=================== -[ 0.000000] Internal error: synchronous external abort: 96000050 [#1] PREEMPT SMP -[ 0.000000] Modules linked in: -[ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.18.0-rc6-00014-g10c8acb8b679 #524 -[ 0.000000] Hardware name: linux,dummy-virt (DT) -[ 0.000000] pstate: 200000c5 (nzCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) -[ 0.000000] pc : new_slab+0x190/0x340 -[ 0.000000] lr : new_slab+0x184/0x340 -[ 0.000000] sp : ffff80000a4b3d10 -.... -================== -The actual crash location and call stack will be somewhat random, and -depend on the specific allocation of that physical memory range. - -As the DT spec[1] explicitly mentions standard properties, add a simple -check to skip over disabled memory nodes, so that we only use memory -that is meant for non-secure code to use. - -That fixes booting a QEMU arm64 VM with EL3 enabled ("secure=on"), when -not using UEFI. In this case the QEMU generated DT will be handed on -to the kernel, which will see the secram node. -This issue is reproducible when using TF-A together with U-Boot as -firmware, then booting with the "booti" command. - -When using U-Boot as an UEFI provider, the code there [2] explicitly -filters for disabled nodes when generating the UEFI memory map, so we -are safe. -EDK/2 only reads the first bank of the first DT memory node [3] to learn -about memory, so we got lucky there. - -[1] https://github.com/devicetree-org/devicetree-specification/blob/main/source/chapter3-devicenodes.rst#memory-node (after the table) -[2] https://source.denx.de/u-boot/u-boot/-/blob/master/lib/fdtdec.c#L1061-1063 -[3] https://github.com/tianocore/edk2/blob/master/ArmVirtPkg/PrePi/FdtParser.c - -Reported-by: Ross Burton -Signed-off-by: Andre Przywara - -Upstream-Status: Submitted [https://lore.kernel.org/linux-arm-kernel/20220517101410.3493781-1-andre.przywara@arm.com/T/#u] -Signed-off-by: Ross Burton - ---- - drivers/of/fdt.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c -index 59a7a9ee58ef..5439c899fe04 100644 ---- a/drivers/of/fdt.c -+++ b/drivers/of/fdt.c -@@ -1102,6 +1102,9 @@ int __init early_init_dt_scan_memory(unsigned long node, const char *uname, - if (type == NULL || strcmp(type, "memory") != 0) - return 0; - -+ if (!of_fdt_device_is_available(initial_boot_params, node)) -+ return 0; -+ - reg = of_get_flat_dt_prop(node, "linux,usable-memory", &l); - if (reg == NULL) - reg = of_get_flat_dt_prop(node, "reg", &l); --- -2.25.1 From patchwork Mon Jun 5 13:01:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Mason X-Patchwork-Id: 25131 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D0CCC7EE23 for ; Mon, 5 Jun 2023 13:02:13 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.6914.1685970122549539891 for ; Mon, 05 Jun 2023 06:02:02 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: jon.mason@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 251F9152B for ; Mon, 5 Jun 2023 06:02:47 -0700 (PDT) Received: from debian.lan?044arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 70A243F663 for ; Mon, 5 Jun 2023 06:02:01 -0700 (PDT) From: Jon Mason To: meta-arm@lists.yoctoproject.org Subject: [PATCH 2/4] arm-bsp/optee: Remove unreferenced patches Date: Mon, 5 Jun 2023 08:01:54 -0500 Message-Id: <20230605130156.3309199-2-jon.mason@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230605130156.3309199-1-jon.mason@arm.com> References: <20230605130156.3309199-1-jon.mason@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 05 Jun 2023 13:02:13 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/4725 Signed-off-by: Jon Mason --- ...ow-setting-sysroot-for-libgcc-lookup.patch | 35 ---------- ...0007-allow-setting-sysroot-for-clang.patch | 30 --------- .../files/0008-no-warn-rwx-segments.patch | 65 ------------------- .../recipes-devtools/fiptool/files/ssl.patch | 52 --------------- 4 files changed, 182 deletions(-) delete mode 100644 meta-arm-bsp/recipes-security/optee/files/0006-allow-setting-sysroot-for-libgcc-lookup.patch delete mode 100644 meta-arm-bsp/recipes-security/optee/files/0007-allow-setting-sysroot-for-clang.patch delete mode 100644 meta-arm-bsp/recipes-security/optee/files/0008-no-warn-rwx-segments.patch delete mode 100644 meta-arm/recipes-devtools/fiptool/files/ssl.patch diff --git a/meta-arm-bsp/recipes-security/optee/files/0006-allow-setting-sysroot-for-libgcc-lookup.patch b/meta-arm-bsp/recipes-security/optee/files/0006-allow-setting-sysroot-for-libgcc-lookup.patch deleted file mode 100644 index b838335e..00000000 --- a/meta-arm-bsp/recipes-security/optee/files/0006-allow-setting-sysroot-for-libgcc-lookup.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 4b2c1a31efe0c5514ae27e696e75659b55e41259 Mon Sep 17 00:00:00 2001 -From: Ross Burton -Date: Tue, 26 May 2020 14:38:02 -0500 -Subject: [PATCH] allow setting sysroot for libgcc lookup - -Explicitly pass the new variable LIBGCC_LOCATE_CFLAGS variable when searching -for the compiler libraries as there's no easy way to reliably pass --sysroot -otherwise. - -Upstream-Status: Pending [https://github.com/OP-TEE/optee_os/issues/4188] -Signed-off-by: Ross Burton - ---- - mk/gcc.mk | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/mk/gcc.mk b/mk/gcc.mk -index adc77a24..81bfa78a 100644 ---- a/mk/gcc.mk -+++ b/mk/gcc.mk -@@ -13,11 +13,11 @@ nostdinc$(sm) := -nostdinc -isystem $(shell $(CC$(sm)) \ - -print-file-name=include 2> /dev/null) - - # Get location of libgcc from gcc --libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) \ -+libgcc$(sm) := $(shell $(CC$(sm)) $(LIBGCC_LOCATE_CFLAGS) $(CFLAGS$(arch-bits-$(sm))) \ - -print-libgcc-file-name 2> /dev/null) --libstdc++$(sm) := $(shell $(CXX$(sm)) $(CXXFLAGS$(arch-bits-$(sm))) $(comp-cxxflags$(sm)) \ -+libstdc++$(sm) := $(shell $(CXX$(sm)) $(LIBGCC_LOCATE_CFLAGS) $(CXXFLAGS$(arch-bits-$(sm))) $(comp-cxxflags$(sm)) \ - -print-file-name=libstdc++.a 2> /dev/null) --libgcc_eh$(sm) := $(shell $(CXX$(sm)) $(CXXFLAGS$(arch-bits-$(sm))) $(comp-cxxflags$(sm)) \ -+libgcc_eh$(sm) := $(shell $(CXX$(sm)) $(LIBGCC_LOCATE_CFLAGS) $(CXXFLAGS$(arch-bits-$(sm))) $(comp-cxxflags$(sm)) \ - -print-file-name=libgcc_eh.a 2> /dev/null) - - # Define these to something to discover accidental use diff --git a/meta-arm-bsp/recipes-security/optee/files/0007-allow-setting-sysroot-for-clang.patch b/meta-arm-bsp/recipes-security/optee/files/0007-allow-setting-sysroot-for-clang.patch deleted file mode 100644 index d5e36948..00000000 --- a/meta-arm-bsp/recipes-security/optee/files/0007-allow-setting-sysroot-for-clang.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 992bed8a62c75aab034fe53d6329fa7c15cf06ee Mon Sep 17 00:00:00 2001 -From: Brett Warren -Date: Wed, 23 Sep 2020 09:27:34 +0100 -Subject: [PATCH] optee: enable clang support - -When compiling with clang, the LIBGCC_LOCATE_CFLAG variable used -to provide a sysroot wasn't included, which results in not locating -compiler-rt. This is mitigated by including the variable as ammended. - -Upstream-Status: Pending -ChangeId: 8ba69a4b2eb8ebaa047cb266c9aa6c2c3da45701 -Signed-off-by: Brett Warren - ---- - mk/clang.mk | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mk/clang.mk b/mk/clang.mk -index 0f48c836..47465523 100644 ---- a/mk/clang.mk -+++ b/mk/clang.mk -@@ -27,7 +27,7 @@ comp-cflags-warns-clang := -Wno-language-extension-token \ - - # Note, use the compiler runtime library (libclang_rt.builtins.*.a) instead of - # libgcc for clang --libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) \ -+libgcc$(sm) := $(shell $(CC$(sm)) $(LIBGCC_LOCATE_CFLAGS) $(CFLAGS$(arch-bits-$(sm))) \ - -rtlib=compiler-rt -print-libgcc-file-name 2> /dev/null) - - # Core ASLR relies on the executable being ready to run from its preferred load diff --git a/meta-arm-bsp/recipes-security/optee/files/0008-no-warn-rwx-segments.patch b/meta-arm-bsp/recipes-security/optee/files/0008-no-warn-rwx-segments.patch deleted file mode 100644 index 40482282..00000000 --- a/meta-arm-bsp/recipes-security/optee/files/0008-no-warn-rwx-segments.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 3126adccaf9c9dc669bb7e1f96326c03da4b570d Mon Sep 17 00:00:00 2001 -From: Jerome Forissier -Date: Fri, 5 Aug 2022 09:48:03 +0200 -Subject: [PATCH] core: link: add --no-warn-rwx-segments - -Signed-off-by: Anton Antonov -Upstream-Status: Backport [https://github.com/OP-TEE/optee_os/pull/5474] - -binutils ld.bfd generates one RWX LOAD segment by merging several sections -with mixed R/W/X attributes (.text, .rodata, .data). After version 2.38 it -also warns by default when that happens [1], which breaks the build due to ---fatal-warnings. The RWX segment is not a problem for the TEE core, since -that information is not used to set memory permissions. Therefore, silence -the warning. - -Link: [1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107 -Link: https://sourceware.org/bugzilla/show_bug.cgi?id=29448 -Reported-by: Dominique Martinet -Signed-off-by: Jerome Forissier -Acked-by: Jens Wiklander - ---- - core/arch/arm/kernel/link.mk | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/core/arch/arm/kernel/link.mk b/core/arch/arm/kernel/link.mk -index 69375ad6..bea239cf 100644 ---- a/core/arch/arm/kernel/link.mk -+++ b/core/arch/arm/kernel/link.mk -@@ -17,6 +17,7 @@ link-ldflags += -T $(link-script-pp) -Map=$(link-out-dir)/tee.map - link-ldflags += --sort-section=alignment - link-ldflags += --fatal-warnings - link-ldflags += --gc-sections -+link-ldflags += $(call ld-option,--no-warn-rwx-segments) - - link-ldadd = $(LDADD) - link-ldadd += $(libdeps) -@@ -37,6 +38,7 @@ link-script-cppflags := \ - $(cppflagscore)) - - ldargs-all_objs := -T $(link-script-dummy) --no-check-sections \ -+ $(call ld-option,--no-warn-rwx-segments) \ - $(link-objs) $(link-ldadd) $(libgcccore) - cleanfiles += $(link-out-dir)/all_objs.o - $(link-out-dir)/all_objs.o: $(objs) $(libdeps) $(MAKEFILE_LIST) -@@ -49,7 +51,8 @@ $(link-out-dir)/unpaged_entries.txt: $(link-out-dir)/all_objs.o - $(q)$(NMcore) $< | \ - $(AWK) '/ ____keep_pager/ { printf "-u%s ", $$3 }' > $@ - --unpaged-ldargs = -T $(link-script-dummy) --no-check-sections --gc-sections -+unpaged-ldargs := -T $(link-script-dummy) --no-check-sections --gc-sections \ -+ $(call ld-option,--no-warn-rwx-segments) - unpaged-ldadd := $(objs) $(link-ldadd) $(libgcccore) - cleanfiles += $(link-out-dir)/unpaged.o - $(link-out-dir)/unpaged.o: $(link-out-dir)/unpaged_entries.txt -@@ -77,7 +80,8 @@ $(link-out-dir)/init_entries.txt: $(link-out-dir)/all_objs.o - $(q)$(NMcore) $< | \ - $(AWK) '/ ____keep_init/ { printf "-u%s ", $$3 }' > $@ - --init-ldargs := -T $(link-script-dummy) --no-check-sections --gc-sections -+init-ldargs := -T $(link-script-dummy) --no-check-sections --gc-sections \ -+ $(call ld-option,--no-warn-rwx-segments) - init-ldadd := $(link-objs-init) $(link-out-dir)/version.o $(link-ldadd) \ - $(libgcccore) - cleanfiles += $(link-out-dir)/init.o diff --git a/meta-arm/recipes-devtools/fiptool/files/ssl.patch b/meta-arm/recipes-devtools/fiptool/files/ssl.patch deleted file mode 100644 index cdabd1b7..00000000 --- a/meta-arm/recipes-devtools/fiptool/files/ssl.patch +++ /dev/null @@ -1,52 +0,0 @@ -fiptool: respect OPENSSL_DIR - -fiptool links to libcrypto, so as with the other tools it should respect -OPENSSL_DIR for include/library paths. - -Upstream-Status: Submitted -Signed-off-by: Ross Burton - -diff --git a/Makefile b/Makefile -index ec6f88585..2d3b9fc26 100644 ---- a/Makefile -+++ b/Makefile -@@ -1388,7 +1388,7 @@ fwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME} - - ${FIPTOOL}: FORCE - ifdef UNIX_MK -- ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" FIPTOOL=${FIPTOOL} --no-print-directory -C ${FIPTOOLPATH} -+ ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" FIPTOOL=${FIPTOOL} OPENSSL_DIR=${OPENSSL_DIR} --no-print-directory -C ${FIPTOOLPATH} - else - # Clear the MAKEFLAGS as we do not want - # to pass the gnumake flags to nmake. -diff --git a/tools/fiptool/Makefile b/tools/fiptool/Makefile -index 11d2e7b0b..7c2a08379 100644 ---- a/tools/fiptool/Makefile -+++ b/tools/fiptool/Makefile -@@ -12,6 +12,8 @@ FIPTOOL ?= fiptool${BIN_EXT} - PROJECT := $(notdir ${FIPTOOL}) - OBJECTS := fiptool.o tbbr_config.o - V ?= 0 -+OPENSSL_DIR := /usr -+ - - override CPPFLAGS += -D_GNU_SOURCE -D_XOPEN_SOURCE=700 - HOSTCCFLAGS := -Wall -Werror -pedantic -std=c99 -@@ -20,7 +22,7 @@ ifeq (${DEBUG},1) - else - HOSTCCFLAGS += -O2 - endif --LDLIBS := -lcrypto -+LDLIBS := -L${OPENSSL_DIR}/lib -lcrypto - - ifeq (${V},0) - Q := @ -@@ -28,7 +30,7 @@ else - Q := - endif - --INCLUDE_PATHS := -I../../include/tools_share -+INCLUDE_PATHS := -I../../include/tools_share -I${OPENSSL_DIR}/include - - HOSTCC ?= gcc - From patchwork Mon Jun 5 13:01:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Mason X-Patchwork-Id: 25128 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30FE1C7EE2A for ; Mon, 5 Jun 2023 13:02:03 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.6906.1685970122292081525 for ; Mon, 05 Jun 2023 06:02:02 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: jon.mason@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 550E115BF for ; Mon, 5 Jun 2023 06:02:47 -0700 (PDT) Received: from debian.lan?044arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A9EBE3F663 for ; Mon, 5 Jun 2023 06:02:01 -0700 (PDT) From: Jon Mason To: meta-arm@lists.yoctoproject.org Subject: [PATCH 3/4] CI: add debug yml file for ease of use Date: Mon, 5 Jun 2023 08:01:55 -0500 Message-Id: <20230605130156.3309199-3-jon.mason@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230605130156.3309199-1-jon.mason@arm.com> References: <20230605130156.3309199-1-jon.mason@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 05 Jun 2023 13:02:03 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/4723 There are cases where a developer might want to enable things, like debug-tweaks, which are useful in their testing but not something we would want in a production environment. Create a file where these can be added without affecting other things. Signed-off-by: Jon Mason --- ci/debug.yml | 7 +++++++ ci/testimage.yml | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 ci/debug.yml diff --git a/ci/debug.yml b/ci/debug.yml new file mode 100644 index 00000000..757f6d1d --- /dev/null +++ b/ci/debug.yml @@ -0,0 +1,7 @@ +header: + version: 11 + +# Add universally helpful features when testing boards +local_conf_header: + debug: | + EXTRA_IMAGE_FEATURES:append = " debug-tweaks" diff --git a/ci/testimage.yml b/ci/testimage.yml index b4b5599b..5d402f0f 100644 --- a/ci/testimage.yml +++ b/ci/testimage.yml @@ -1,9 +1,10 @@ header: version: 11 + includes: + - ci/debug.yml local_conf_header: testimage: | - EXTRA_IMAGE_FEATURES:append = " debug-tweaks" IMAGE_CLASSES += "testimage" TESTIMAGE_AUTO = "1" kvm: | From patchwork Mon Jun 5 13:01:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Mason X-Patchwork-Id: 25129 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32F2DC7EE23 for ; Mon, 5 Jun 2023 13:02:03 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.6907.1685970122603343162 for ; Mon, 05 Jun 2023 06:02:02 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: jon.mason@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8CD6815A1 for ; Mon, 5 Jun 2023 06:02:47 -0700 (PDT) Received: from debian.lan?044arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DE3BC3F663 for ; Mon, 5 Jun 2023 06:02:01 -0700 (PDT) From: Jon Mason To: meta-arm@lists.yoctoproject.org Subject: [PATCH 4/4] arm/linux-yocto: add gcc 13 gimple backport patch Date: Mon, 5 Jun 2023 08:01:56 -0500 Message-Id: <20230605130156.3309199-4-jon.mason@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230605130156.3309199-1-jon.mason@arm.com> References: <20230605130156.3309199-1-jon.mason@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 05 Jun 2023 13:02:03 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/4724 Issue when building the kernel on FVP (and probably all aarch64 platforms) with GCC 13 on the 6.1 kernel (and possibly others). Backport the upstream fix. Signed-off-by: Jon Mason --- ...eorganize-gimple-includes-for-GCC-13.patch | 47 +++++++++++++++++++ .../linux/linux-yocto%.bbappend | 1 + 2 files changed, 48 insertions(+) create mode 100644 meta-arm/recipes-kernel/linux/files/aarch64/0001-gcc-plugins-Reorganize-gimple-includes-for-GCC-13.patch diff --git a/meta-arm/recipes-kernel/linux/files/aarch64/0001-gcc-plugins-Reorganize-gimple-includes-for-GCC-13.patch b/meta-arm/recipes-kernel/linux/files/aarch64/0001-gcc-plugins-Reorganize-gimple-includes-for-GCC-13.patch new file mode 100644 index 00000000..e4d8936f --- /dev/null +++ b/meta-arm/recipes-kernel/linux/files/aarch64/0001-gcc-plugins-Reorganize-gimple-includes-for-GCC-13.patch @@ -0,0 +1,47 @@ +From e6a71160cc145e18ab45195abf89884112e02dfb Mon Sep 17 00:00:00 2001 +From: Kees Cook +Date: Wed, 18 Jan 2023 12:21:35 -0800 +Subject: [PATCH] gcc-plugins: Reorganize gimple includes for GCC 13 + +The gimple-iterator.h header must be included before gimple-fold.h +starting with GCC 13. Reorganize gimple headers to work for all GCC +versions. + +Reported-by: Palmer Dabbelt +Acked-by: Palmer Dabbelt +Link: https://lore.kernel.org/all/20230113173033.4380-1-palmer@rivosinc.com/ +Cc: linux-hardening@vger.kernel.org +Signed-off-by: Kees Cook + +Upstream-Status: Backport +Signed-off-by: Jon Mason + +--- + scripts/gcc-plugins/gcc-common.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h +index 9a1895747b15..84c730da36dd 100644 +--- a/scripts/gcc-plugins/gcc-common.h ++++ b/scripts/gcc-plugins/gcc-common.h +@@ -71,7 +71,9 @@ + #include "varasm.h" + #include "stor-layout.h" + #include "internal-fn.h" ++#include "gimple.h" + #include "gimple-expr.h" ++#include "gimple-iterator.h" + #include "gimple-fold.h" + #include "context.h" + #include "tree-ssa-alias.h" +@@ -85,10 +87,8 @@ + #include "tree-eh.h" + #include "stmt.h" + #include "gimplify.h" +-#include "gimple.h" + #include "tree-phinodes.h" + #include "tree-cfg.h" +-#include "gimple-iterator.h" + #include "gimple-ssa.h" + #include "ssa-iterators.h" + diff --git a/meta-arm/recipes-kernel/linux/linux-yocto%.bbappend b/meta-arm/recipes-kernel/linux/linux-yocto%.bbappend index 883ed2ca..3f2c83fd 100644 --- a/meta-arm/recipes-kernel/linux/linux-yocto%.bbappend +++ b/meta-arm/recipes-kernel/linux/linux-yocto%.bbappend @@ -4,6 +4,7 @@ FILESEXTRAPATHS:prepend:aarch64 = "${ARMFILESPATHS}" SRC_URI:append:aarch64 = " \ file://0001-Revert-arm64-defconfig-Enable-Tegra-MGBE-driver.patch \ file://0002-Revert-arm64-defconfig-Add-Nuvoton-NPCM-family-suppo.patch \ + file://0001-gcc-plugins-Reorganize-gimple-includes-for-GCC-13.patch \ " COMPATIBLE_MACHINE:generic-arm64 = "generic-arm64"