summaryrefslogtreecommitdiffstats
path: root/meta-ti-bsp/recipes-kernel
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-05-11 23:19:12 -0700
committerRyan Eatmon <reatmon@ti.com>2023-05-15 08:40:21 -0500
commit4137bd9b30e6d43a927a37bfeee7e8091e682ed1 (patch)
treef782b98f59603a2da0262ee16ee54cd0f9a4f84c /meta-ti-bsp/recipes-kernel
parent96c6006bb0d6a900ba480fb8c5065669c0a787da (diff)
downloadmeta-ti-4137bd9b30e6d43a927a37bfeee7e8091e682ed1.tar.gz
linux-bb.org_git.bb: Fix build with gcc-13
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Diffstat (limited to 'meta-ti-bsp/recipes-kernel')
-rw-r--r--meta-ti-bsp/recipes-kernel/linux/files/0001-gcc-plugins-Fix-build-for-upcoming-GCC-release.patch46
-rw-r--r--meta-ti-bsp/recipes-kernel/linux/linux-bb.org/0001-blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch56
-rw-r--r--meta-ti-bsp/recipes-kernel/linux/linux-bb.org/0001-block-blk-iocost-gcc13-keep-large-values-in-a-new-en.patch54
-rw-r--r--meta-ti-bsp/recipes-kernel/linux/linux-bb.org_git.bb4
4 files changed, 160 insertions, 0 deletions
diff --git a/meta-ti-bsp/recipes-kernel/linux/files/0001-gcc-plugins-Fix-build-for-upcoming-GCC-release.patch b/meta-ti-bsp/recipes-kernel/linux/files/0001-gcc-plugins-Fix-build-for-upcoming-GCC-release.patch
new file mode 100644
index 00000000..3dfa31a1
--- /dev/null
+++ b/meta-ti-bsp/recipes-kernel/linux/files/0001-gcc-plugins-Fix-build-for-upcoming-GCC-release.patch
@@ -0,0 +1,46 @@
1From 3cd29a3d7c25cca9989e7d8966141f725fa99c68 Mon Sep 17 00:00:00 2001
2From: Palmer Dabbelt <palmer@rivosinc.com>
3Date: Fri, 13 Jan 2023 09:30:33 -0800
4Subject: [PATCH] gcc-plugins: Fix build for upcoming GCC release
5
6The upcoming GCC release has refactored the gimple plugin interface a
7bit and unless gimple-iterator.h is included before gimple-fold.h I end
8up with a bunch of missing declarations when building the stack
9protector plugin.
10
11Upstream-Status: Backport [https://lore.kernel.org/all/20230113173033.4380-1-palmer@rivosinc.com/]
12Reported-by: Palmer Dabbelt <palmer@rivosinc.com>
13Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
14Link: https://lore.kernel.org/all/20230113173033.4380-1-palmer@rivosinc.com/
15Cc: linux-hardening@vger.kernel.org
16Signed-off-by: Kees Cook <keescook@chromium.org>
17---
18 scripts/gcc-plugins/gcc-common.h | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21--- a/scripts/gcc-plugins/gcc-common.h
22+++ b/scripts/gcc-plugins/gcc-common.h
23@@ -108,7 +108,9 @@
24 #include "varasm.h"
25 #include "stor-layout.h"
26 #include "internal-fn.h"
27+#include "gimple.h"
28 #include "gimple-expr.h"
29+#include "gimple-iterator.h"
30 #include "gimple-fold.h"
31 #include "context.h"
32 #include "tree-ssa-alias.h"
33@@ -124,13 +126,10 @@
34 #include "gimplify.h"
35 #endif
36
37-#include "gimple.h"
38-
39 #if BUILDING_GCC_VERSION >= 4009
40 #include "tree-ssa-operands.h"
41 #include "tree-phinodes.h"
42 #include "tree-cfg.h"
43-#include "gimple-iterator.h"
44 #include "gimple-ssa.h"
45 #include "ssa-iterators.h"
46 #endif
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-bb.org/0001-blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch b/meta-ti-bsp/recipes-kernel/linux/linux-bb.org/0001-blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch
new file mode 100644
index 00000000..a7806c22
--- /dev/null
+++ b/meta-ti-bsp/recipes-kernel/linux/linux-bb.org/0001-blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch
@@ -0,0 +1,56 @@
1From 5f2779dfa7b8cc7dfd4a1b6586d86e0d193266f3 Mon Sep 17 00:00:00 2001
2From: Arnd Bergmann <arnd@arndb.de>
3Date: Wed, 18 Jan 2023 09:07:01 +0100
4Subject: [PATCH] blk-iocost: avoid 64-bit division in ioc_timer_fn
5
6The behavior of 'enum' types has changed in gcc-13, so now the
7UNBUSY_THR_PCT constant is interpreted as a 64-bit number because
8it is defined as part of the same enum definition as some other
9constants that do not fit within a 32-bit integer. This in turn
10leads to some inefficient code on 32-bit architectures as well
11as a link error:
12
13arm-linux-gnueabi/bin/arm-linux-gnueabi-ld: block/blk-iocost.o: in function `ioc_timer_fn':
14blk-iocost.c:(.text+0x68e8): undefined reference to `__aeabi_uldivmod'
15arm-linux-gnueabi-ld: blk-iocost.c:(.text+0x6908): undefined reference to `__aeabi_uldivmod'
16
17Split the enum definition to keep the 64-bit timing constants in
18a separate enum type from those constants that can clearly fit
19within a smaller type.
20
21Signed-off-by: Arnd Bergmann <arnd@arndb.de>
22Acked-by: Tejun Heo <tj@kernel.org>
23Link: https://lore.kernel.org/r/20230118080706.3303186-1-arnd@kernel.org
24Signed-off-by: Jens Axboe <axboe@kernel.dk>
25---
26 block/blk-iocost.c | 8 +++++---
27 1 file changed, 5 insertions(+), 3 deletions(-)
28
29diff --git a/block/blk-iocost.c b/block/blk-iocost.c
30index 6955605629e4..b691b6bb498f 100644
31--- a/block/blk-iocost.c
32+++ b/block/blk-iocost.c
33@@ -258,6 +258,11 @@ enum {
34 VRATE_MIN = VTIME_PER_USEC * VRATE_MIN_PPM / MILLION,
35 VRATE_CLAMP_ADJ_PCT = 4,
36
37+ /* switch iff the conditions are met for longer than this */
38+ AUTOP_CYCLE_NSEC = 10LLU * NSEC_PER_SEC,
39+};
40+
41+enum {
42 /* if IOs end up waiting for requests, issue less */
43 RQ_WAIT_BUSY_PCT = 5,
44
45@@ -296,9 +301,6 @@ enum {
46 /* don't let cmds which take a very long time pin lagging for too long */
47 MAX_LAGGING_PERIODS = 10,
48
49- /* switch iff the conditions are met for longer than this */
50- AUTOP_CYCLE_NSEC = 10LLU * NSEC_PER_SEC,
51-
52 /*
53 * Count IO size in 4k pages. The 12bit shift helps keeping
54 * size-proportional components of cost calculation in closer
55--
562.40.1
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-bb.org/0001-block-blk-iocost-gcc13-keep-large-values-in-a-new-en.patch b/meta-ti-bsp/recipes-kernel/linux/linux-bb.org/0001-block-blk-iocost-gcc13-keep-large-values-in-a-new-en.patch
new file mode 100644
index 00000000..f5d0f476
--- /dev/null
+++ b/meta-ti-bsp/recipes-kernel/linux/linux-bb.org/0001-block-blk-iocost-gcc13-keep-large-values-in-a-new-en.patch
@@ -0,0 +1,54 @@
1From ff1cc97b1f4c10db224f276d9615b22835b8c424 Mon Sep 17 00:00:00 2001
2From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
3Date: Tue, 13 Dec 2022 13:08:26 +0100
4Subject: [PATCH] block/blk-iocost (gcc13): keep large values in a new enum
5
6Since gcc13, each member of an enum has the same type as the enum [1]. And
7that is inherited from its members. Provided:
8 VTIME_PER_SEC_SHIFT = 37,
9 VTIME_PER_SEC = 1LLU << VTIME_PER_SEC_SHIFT,
10 ...
11 AUTOP_CYCLE_NSEC = 10LLU * NSEC_PER_SEC,
12the named type is unsigned long.
13
14This generates warnings with gcc-13:
15 block/blk-iocost.c: In function 'ioc_weight_prfill':
16 block/blk-iocost.c:3037:37: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int'
17
18 block/blk-iocost.c: In function 'ioc_weight_show':
19 block/blk-iocost.c:3047:34: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int'
20
21So split the anonymous enum with large values to a separate enum, so
22that they don't affect other members.
23
24[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36113
25
26Cc: Martin Liska <mliska@suse.cz>
27Cc: Tejun Heo <tj@kernel.org>
28Cc: Josef Bacik <josef@toxicpanda.com>
29Cc: Jens Axboe <axboe@kernel.dk>
30Cc: cgroups@vger.kernel.org
31Cc: linux-block@vger.kernel.org
32Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
33Link: https://lore.kernel.org/r/20221213120826.17446-1-jirislaby@kernel.org
34Signed-off-by: Jens Axboe <axboe@kernel.dk>
35---
36 block/blk-iocost.c | 2 ++
37 1 file changed, 2 insertions(+)
38
39diff --git a/block/blk-iocost.c b/block/blk-iocost.c
40index d1bdc12deaa7..549ddc9e0c6f 100644
41--- a/block/blk-iocost.c
42+++ b/block/blk-iocost.c
43@@ -232,7 +232,9 @@ enum {
44
45 /* 1/64k is granular enough and can easily be handled w/ u32 */
46 WEIGHT_ONE = 1 << 16,
47+};
48
49+enum {
50 /*
51 * As vtime is used to calculate the cost of each IO, it needs to
52 * be fairly high precision. For example, it should be able to
53--
542.40.1
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-bb.org_git.bb b/meta-ti-bsp/recipes-kernel/linux/linux-bb.org_git.bb
index ca137c71..886aaef5 100644
--- a/meta-ti-bsp/recipes-kernel/linux/linux-bb.org_git.bb
+++ b/meta-ti-bsp/recipes-kernel/linux/linux-bb.org_git.bb
@@ -29,6 +29,10 @@ BRANCH:aarch64 = "v5.10.162-ti-arm64-r99"
29SRC_URI = "git://github.com/beagleboard/linux.git;protocol=https;branch=${BRANCH} \ 29SRC_URI = "git://github.com/beagleboard/linux.git;protocol=https;branch=${BRANCH} \
30 file://defconfig \ 30 file://defconfig \
31 file://init_disassemble_info-signature-changes-causes-compile-failures.patch \ 31 file://init_disassemble_info-signature-changes-causes-compile-failures.patch \
32 file://0001-gcc-plugins-Fix-build-for-upcoming-GCC-release.patch \
33 file://0001-ata-ahci-fix-enum-constants-for-gcc-13.patch \
34 file://0001-blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch \
35 file://0001-block-blk-iocost-gcc13-keep-large-values-in-a-new-en.patch \
32" 36"
33 37
34SRC_URI:append:armv7a = " file://0001-defconfig-switch-default-kernel-compression-to-LZMA.patch" 38SRC_URI:append:armv7a = " file://0001-defconfig-switch-default-kernel-compression-to-LZMA.patch"