aboutsummarylogtreecommitdiffstats
path: root/0003-tpm453-enable-o3-config.patch
blob: 7a7b84572a25f12d44dd814551dd77bf16763402 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: ArianDEXaPY <arianabb.me@gmail.com>
Date: Mon, 27 Apr 2026 14:59:00 +0400
Subject: [PATCH] tpm453: enable O3 optimization config

Port the CachyOS O3 Kconfig/Makefile hook used by the newer TPM453
variants so stable can honor CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3.
---
 Makefile     | 3 +++
 init/Kconfig | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -891,6 +891,9 @@ KBUILD_CFLAGS	+= -fno-delete-null-pointer-checks
 ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
 KBUILD_CFLAGS += -O2
 KBUILD_RUSTFLAGS += -Copt-level=2
+else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
+KBUILD_CFLAGS += -O3
+KBUILD_RUSTFLAGS += -Copt-level=3
 else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
 KBUILD_CFLAGS += -Os
 KBUILD_RUSTFLAGS += -Copt-level=s
diff --git a/init/Kconfig b/init/Kconfig
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1585,2 +1585,7 @@ config CC_OPTIMIZE_FOR_PERFORMANCE
-
+config CC_OPTIMIZE_FOR_PERFORMANCE_O3
+	bool "Optimize more for performance (-O3)"
+	help
+	  Choosing this option will pass "-O3" to your compiler to optimize
+	  the kernel yet more for performance.
+
 config CC_OPTIMIZE_FOR_SIZE