[gentoo-commits] proj/linux-patches:6.8 commit in: /

2024-05-25 Thread Mike Pagano
commit: 4c9513c83791150732d91fe7bccec0cdd207e493
Author: Mike Pagano  gentoo  org>
AuthorDate: Sat May 25 15:17:57 2024 +
Commit: Mike Pagano  gentoo  org>
CommitDate: Sat May 25 15:17:57 2024 +
URL:https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=4c9513c8

Linux patch 6.8.11

Signed-off-by: Mike Pagano  gentoo.org>

 _README |4 +
 1010_linux-6.8.11.patch | 1585 +++
 2 files changed, 1589 insertions(+)

diff --git a/_README b/_README
index a90ed274..7fa03211 100644
--- a/_README
+++ b/_README
@@ -83,6 +83,10 @@ Patch:  1009_linux-6.8.10.patch
 From:   https://www.kernel.org
 Desc:   Linux 6.8.10
 
+Patch:  1010_linux-6.8.11.patch
+From:   https://www.kernel.org
+Desc:   Linux 6.8.11
+
 Patch:  1510_fs-enable-link-security-restrictions-by-default.patch
 From:   
http://sources.debian.net/src/linux/3.16.7-ckt4-3/debian/patches/debian/fs-enable-link-security-restrictions-by-default.patch/
 Desc:   Enable link security restrictions by default.

diff --git a/1010_linux-6.8.11.patch b/1010_linux-6.8.11.patch
new file mode 100644
index ..e6516e5a
--- /dev/null
+++ b/1010_linux-6.8.11.patch
@@ -0,0 +1,1585 @@
+diff --git a/Documentation/ABI/stable/sysfs-block 
b/Documentation/ABI/stable/sysfs-block
+index 1fe9a553c37b7..f0025d1c3d5ac 100644
+--- a/Documentation/ABI/stable/sysfs-block
 b/Documentation/ABI/stable/sysfs-block
+@@ -101,6 +101,16 @@ Description:
+   devices that support receiving integrity metadata.
+ 
+ 
++What: /sys/block//partscan
++Date: May 2024
++Contact:  Christoph Hellwig 
++Description:
++  The /sys/block//partscan files reports if partition
++  scanning is enabled for the disk.  It returns "1" if partition
++  scanning is enabled, or "0" if not.  The value type is a 32-bit
++  unsigned integer, but only "0" and "1" are valid values.
++
++
+ What: /sys/block///alignment_offset
+ Date: April 2009
+ Contact:  Martin K. Petersen 
+diff --git a/Documentation/admin-guide/hw-vuln/core-scheduling.rst 
b/Documentation/admin-guide/hw-vuln/core-scheduling.rst
+index cf1eeefdfc32f..a92e10ec402e7 100644
+--- a/Documentation/admin-guide/hw-vuln/core-scheduling.rst
 b/Documentation/admin-guide/hw-vuln/core-scheduling.rst
+@@ -67,8 +67,8 @@ arg4:
+ will be performed for all tasks in the task group of ``pid``.
+ 
+ arg5:
+-userspace pointer to an unsigned long for storing the cookie returned by
+-``PR_SCHED_CORE_GET`` command. Should be 0 for all other commands.
++userspace pointer to an unsigned long long for storing the cookie returned
++by ``PR_SCHED_CORE_GET`` command. Should be 0 for all other commands.
+ 
+ In order for a process to push a cookie to, or pull a cookie from a process, 
it
+ is required to have the ptrace access mode: `PTRACE_MODE_READ_REALCREDS` to 
the
+diff --git a/Documentation/admin-guide/mm/damon/usage.rst 
b/Documentation/admin-guide/mm/damon/usage.rst
+index 9d23144bf9850..87fdc258d1027 100644
+--- a/Documentation/admin-guide/mm/damon/usage.rst
 b/Documentation/admin-guide/mm/damon/usage.rst
+@@ -450,7 +450,7 @@ pages of all memory cgroups except 
``/having_care_already``.::
+ # # further filter out all cgroups except one at '/having_care_already'
+ echo memcg > 1/type
+ echo /having_care_already > 1/memcg_path
+-echo N > 1/matching
++echo Y > 1/matching
+ 
+ Note that ``anon`` and ``memcg`` filters are currently supported only when
+ ``paddr`` :ref:`implementation ` is being used.
+diff --git a/Documentation/sphinx/kernel_include.py 
b/Documentation/sphinx/kernel_include.py
+index abe7680883771..6387624423363 100755
+--- a/Documentation/sphinx/kernel_include.py
 b/Documentation/sphinx/kernel_include.py
+@@ -97,7 +97,6 @@ class KernelInclude(Include):
+ # HINT: this is the only line I had to change / commented out:
+ #path = utils.relative_path(None, path)
+ 
+-path = nodes.reprunicode(path)
+ encoding = self.options.get(
+ 'encoding', self.state.document.settings.input_encoding)
+ e_handler=self.state.document.settings.input_encoding_error_handler
+diff --git a/Makefile b/Makefile
+index 01acaf667e789..ce6b03cce386d 100644
+--- a/Makefile
 b/Makefile
+@@ -1,7 +1,7 @@
+ # SPDX-License-Identifier: GPL-2.0
+ VERSION = 6
+ PATCHLEVEL = 8
+-SUBLEVEL = 10
++SUBLEVEL = 11
+ EXTRAVERSION =
+ NAME = Hurr durr I'ma ninja sloth
+ 
+diff --git a/block/genhd.c b/block/genhd.c
+index d74fb5b4ae681..d0471f469f7d0 100644
+--- a/block/genhd.c
 b/block/genhd.c
+@@ -345,9 +345,7 @@ int disk_scan_partitions(struct gendisk *disk, blk_mode_t 
mode)
+   struct bdev_handle *handle;
+   int ret = 0;
+ 
+-  if (disk->flags & (GENHD_FL_NO_PART | GENHD_FL_HIDDEN))
+-  return -EINVAL;
+-  if (test_bit(GD_SUPPRESS_PART_SCAN, >state))
++  if 

[gentoo-commits] proj/linux-patches:6.8 commit in: /

2024-05-05 Thread Mike Pagano
commit: 9dcf8bea816a2e0a4ee33c00c855bd27a5253e7f
Author: Mike Pagano  gentoo  org>
AuthorDate: Sun May  5 17:54:13 2024 +
Commit: Mike Pagano  gentoo  org>
CommitDate: Sun May  5 18:01:54 2024 +
URL:https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=9dcf8bea

Update to KSPP patch

Bug: https://bugs.gentoo.org/930733

Signed-off-by: Mike Pagano  gentoo.org>

 4567_distro-Gentoo-Kconfig.patch | 33 +
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/4567_distro-Gentoo-Kconfig.patch b/4567_distro-Gentoo-Kconfig.patch
index 6134393f..87b8fa95 100644
--- a/4567_distro-Gentoo-Kconfig.patch
+++ b/4567_distro-Gentoo-Kconfig.patch
@@ -6,9 +6,9 @@
  source "Documentation/Kconfig"
 +
 +source "distro/Kconfig"
 /dev/null  2024-04-27 13:10:54.18827 -0400
-+++ b/distro/Kconfig   2024-04-27 17:56:56.723132353 -0400
-@@ -0,0 +1,295 @@
+--- /dev/null  2024-05-05 10:40:37.10388 -0400
 b/distro/Kconfig   2024-05-05 13:37:37.699554927 -0400
+@@ -0,0 +1,310 @@
 +menu "Gentoo Linux"
 +
 +config GENTOO_LINUX
@@ -178,7 +178,7 @@
 +  to unmet dependencies. Search for 
GENTOO_KERNEL_SELF_PROTECTION_COMMON and search for 
 +  GENTOO_KERNEL_SELF_PROTECTION_{X86_64, ARM64, X86_32, ARM} for 
dependency information on your 
 +  specific architecture.
-+  Note 2: Please see the URL above for numeric settings, e.g. 
CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 
++  Note 2: Please see the URL above for numeric settings, e.g. 
CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
 +  for X86_64
 +
 +if GENTOO_KERNEL_SELF_PROTECTION
@@ -201,10 +201,13 @@
 +  select DEBUG_SG
 +  select HARDENED_USERCOPY if HAVE_HARDENED_USERCOPY_ALLOCATOR=y
 +  select KFENCE if HAVE_ARCH_KFENCE && (!SLAB || SLUB)
++  select PAGE_TABLE_CHECK if ARCH_SUPPORTS_PAGE_TABLE_CHECK=y && 
EXCLUSIVE_SYSTEM_RAM=y  
++  select PAGE_TABLE_CHECK_ENFORCED if PAGE_TABLE_CHECK=y
 +  select RANDOMIZE_KSTACK_OFFSET_DEFAULT if 
HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET && (INIT_STACK_NONE || !CC_IS_CLANG || 
CLANG_VERSION>=14)
 +  select SECURITY_LANDLOCK
 +  select SCHED_CORE if SCHED_SMT
 +  select BUG_ON_DATA_CORRUPTION
++  select RANDOM_KMALLOC_CACHE if SLUB_TINY=n
 +  select SCHED_STACK_END_CHECK
 +  select SECCOMP if HAVE_ARCH_SECCOMP
 +  select SECCOMP_FILTER if HAVE_ARCH_SECCOMP_FILTER
@@ -245,11 +248,13 @@
 +  default n
 +  
 +  select GCC_PLUGIN_STACKLEAK
++  select X86_KERNEL_IBT if CC_HAS_IBT=y && HAVE_OBJTOOL=y && 
(!LD_IS_LLD=n || LLD_VERSION>=14) 
 +  select LEGACY_VSYSCALL_NONE
 +  select PAGE_TABLE_ISOLATION
 +  select RANDOMIZE_BASE
 +  select RANDOMIZE_MEMORY
 +  select RELOCATABLE
++  select X86_USER_SHADOW_STACK if AS_WRUSS=Y
 +  select VMAP_STACK
 +
 +
@@ -259,11 +264,21 @@
 +  depends on ARM64
 +  default n
 +
-+  select RANDOMIZE_BASE
-+  select RELOCATABLE
++  select ARM64_BTI
++  select ARM64_E0PD
++  select ARM64_EPAN if ARM64_PAN=y
++  select ARM64_MTE if (ARM64_AS_HAS_MTE=y && ARM64_TAGGED_ADDR_ABI=y ) && 
( AS_HAS_ARMV8_5=y ) && ( AS_HAS_LSE_ATOMICS=y ) && ( ARM64_PAN=y )
++  select ARM64_PTR_AUTH
++  select ARM64_PTR_AUTH_KERNEL if ( ARM64_PTR_AUTH=y ) && (( 
CC_HAS_SIGN_RETURN_ADDRESS=y || CC_HAS_BRANCH_PROT_PAC_RET=y ) && 
AS_HAS_ARMV8_3=y ) && ( LD_IS_LLD=y || LD_VERSION >= 23301 || ( CC_IS_GCC=y && 
GCC_VERSION < 90100 )) && (CC_IS_CLANG=n || AS_HAS_CFI_NEGATE_RA_STATE=y ) && 
((FUNCTION_GRAPH_TRACER=n || DYNAMIC_FTRACE_WITH_ARGS=y ))
++  select ARM64_BTI_KERNEL if ( ARM64_BTI=y ) && ( ARM64_PTR_AUTH_KERNEL=y 
) && ( CC_HAS_BRANCH_PROT_PAC_RET_BTI=y ) && (CC_IS_GCC=n || GCC_VERSION >= 
100100 ) && (CC_IS_GCC=n ) && ((FUNCTION_GRAPH_TRACE=n || 
DYNAMIC_FTRACE_WITH_ARG=y ))
 +  select ARM64_SW_TTBR0_PAN
 +  select CONFIG_UNMAP_KERNEL_AT_EL0
 +  select GCC_PLUGIN_STACKLEAK
++  select KASAN_HW_TAGS if HAVE_ARCH_KASAN_HW_TAGS=y
++  select RANDOMIZE_BASE
++  select RELOCATABLE
++  select SHADOW_CALL_STACK if ARCH_SUPPORTS_SHADOW_CALL_STACK=y && 
(DYNAMIC_FTRACE_WITH_ARGS=y || DYNAMIC_FTRACE_WITH_REGS=y || 
FUNCTION_GRAPH_TRACER=n) && MMU=y 
++  select UNWIND_PATCH_PAC_INTO_SCS if (CC_IS_CLANG=y && CLANG_VERSION >= 
CONFIG_15 ) && ( ARM64_PTR_AUTH_KERNEL=y && CC_HAS_BRANCH_PROT_PAC_RET=y ) 
&& ( SHADOW_CALL_STACK=y )
 +  select VMAP_STACK
 +
 +config GENTOO_KERNEL_SELF_PROTECTION_X86_32
@@ -304,12 +319,6 @@
 +  See the settings that become available for more details and 
fine-tuning.
 +
 +endmenu
-From bd3ff0b16792c18c0614c2b95e148943209f460a Mon Sep 17 00:00:00 2001
-From: Georgy Yakovlev 
-Date: Tue, 8 Jun 2021 13:59:57 -0700
-Subject: [PATCH 2/2] set DEFAULT_MMAP_MIN_ADDR by default
-

  mm/Kconfig | 2 ++
  1 file changed, 2 insertions(+)
 



[gentoo-commits] proj/linux-patches:6.8 commit in: /

2024-05-05 Thread Mike Pagano
commit: 54d1b8f05b1a9bb154b528bda020c5c1b9143e51
Author: Mike Pagano  gentoo  org>
AuthorDate: Sun May  5 18:00:38 2024 +
Commit: Mike Pagano  gentoo  org>
CommitDate: Sun May  5 18:00:38 2024 +
URL:https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=54d1b8f0

Default alternate schedulars (ALT_SCHED=n)

Signed-off-by: Mike Pagano  gentoo.org>

 _README|  4 
 5021_BMQ-and-PDS-gentoo-defaults.patch | 13 +
 2 files changed, 17 insertions(+)

diff --git a/_README b/_README
index f9626b92..bb655415 100644
--- a/_README
+++ b/_README
@@ -122,3 +122,7 @@ Desc:   Kernel >= 5.15 patch enables gcc = v11.1+ 
optimizations for additional C
 Patch:  5020_BMQ-and-PDS-io-scheduler-v6.8-r6.patch
 From:   https://gitlab.com/alfredchen/projectc
 Desc:   BMQ(BitMap Queue) Scheduler. A new CPU scheduler developed from 
PDS(incld). Inspired by the scheduler in zircon.
+
+Patch:  5021_BMQ-and-PDS-gentoo-defaults.patch
+From:   https://gitweb.gentoo.org/proj/linux-patches.git/
+Desc:   Set defaults for BMQ. default to n

diff --git a/5021_BMQ-and-PDS-gentoo-defaults.patch 
b/5021_BMQ-and-PDS-gentoo-defaults.patch
new file mode 100644
index ..6dc48eec
--- /dev/null
+++ b/5021_BMQ-and-PDS-gentoo-defaults.patch
@@ -0,0 +1,13 @@
+--- a/init/Kconfig 2023-02-13 08:16:09.534315265 -0500
 b/init/Kconfig 2023-02-13 08:17:24.130237204 -0500
+@@ -867,8 +867,9 @@ config UCLAMP_BUCKETS_COUNT
+ If in doubt, use the default value.
+ 
+ menuconfig SCHED_ALT
++  depends on X86_64
+   bool "Alternative CPU Schedulers"
+-  default y
++  default n
+   help
+ This feature enable alternative CPU scheduler"
+ 



[gentoo-commits] proj/linux-patches:6.8 commit in: /

2024-04-28 Thread Mike Pagano
commit: 315003951b6f0bc2014da65ad339d8a961f388e3
Author: Mike Pagano  gentoo  org>
AuthorDate: Sun Apr 28 22:04:16 2024 +
Commit: Mike Pagano  gentoo  org>
CommitDate: Sun Apr 28 22:04:16 2024 +
URL:https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=31500395

BMQ Patch v6.8-r6

Signed-off-by: Mike Pagano  gentoo.org>

 _README|   2 +-
 ... => 5020_BMQ-and-PDS-io-scheduler-v6.8-r6.patch | 227 ++---
 2 files changed, 106 insertions(+), 123 deletions(-)

diff --git a/_README b/_README
index 03fbc840..7f4b52bc 100644
--- a/_README
+++ b/_README
@@ -115,6 +115,6 @@ Patch:  5010_enable-cpu-optimizations-universal.patch
 From:   https://github.com/graysky2/kernel_compiler_patch
 Desc:   Kernel >= 5.15 patch enables gcc = v11.1+ optimizations for additional 
CPUs.
 
-Patch:  5020_BMQ-and-PDS-io-scheduler-v6.8-r4.patch
+Patch:  5020_BMQ-and-PDS-io-scheduler-v6.8-r6.patch
 From:   https://gitlab.com/alfredchen/projectc
 Desc:   BMQ(BitMap Queue) Scheduler. A new CPU scheduler developed from 
PDS(incld). Inspired by the scheduler in zircon.

diff --git a/5020_BMQ-and-PDS-io-scheduler-v6.8-r4.patch 
b/5020_BMQ-and-PDS-io-scheduler-v6.8-r6.patch
similarity index 98%
rename from 5020_BMQ-and-PDS-io-scheduler-v6.8-r4.patch
rename to 5020_BMQ-and-PDS-io-scheduler-v6.8-r6.patch
index 6ade9048..6fd79852 100644
--- a/5020_BMQ-and-PDS-io-scheduler-v6.8-r4.patch
+++ b/5020_BMQ-and-PDS-io-scheduler-v6.8-r6.patch
@@ -268,10 +268,10 @@ index df3aca89d4f5..1df1f7635188 100644
  static inline bool dl_time_before(u64 a, u64 b)
  {
 diff --git a/include/linux/sched/prio.h b/include/linux/sched/prio.h
-index ab83d85e1183..a9a1dfa99140 100644
+index ab83d85e1183..e66dfb553bc5 100644
 --- a/include/linux/sched/prio.h
 +++ b/include/linux/sched/prio.h
-@@ -18,6 +18,32 @@
+@@ -18,6 +18,28 @@
  #define MAX_PRIO  (MAX_RT_PRIO + NICE_WIDTH)
  #define DEFAULT_PRIO  (MAX_RT_PRIO + NICE_WIDTH / 2)
  
@@ -284,20 +284,16 @@ index ab83d85e1183..a9a1dfa99140 100644
 +/* +/- priority levels from the base priority */
 +#ifdef CONFIG_SCHED_BMQ
 +#define MAX_PRIORITY_ADJ  (12)
-+
-+#define MIN_NORMAL_PRIO   (MAX_RT_PRIO)
-+#define MAX_PRIO  (MIN_NORMAL_PRIO + NICE_WIDTH)
-+#define DEFAULT_PRIO  (MIN_NORMAL_PRIO + NICE_WIDTH / 2)
 +#endif
 +
 +#ifdef CONFIG_SCHED_PDS
 +#define MAX_PRIORITY_ADJ  (0)
++#endif
 +
 +#define MIN_NORMAL_PRIO   (128)
 +#define NORMAL_PRIO_NUM   (64)
 +#define MAX_PRIO  (MIN_NORMAL_PRIO + NORMAL_PRIO_NUM)
-+#define DEFAULT_PRIO  (MAX_PRIO - NICE_WIDTH / 2)
-+#endif
++#define DEFAULT_PRIO  (MAX_PRIO - MAX_PRIORITY_ADJ - NICE_WIDTH / 2)
 +
 +#endif /* CONFIG_SCHED_ALT */
 +
@@ -422,7 +418,7 @@ index bee58f7468c3..81f568107a6b 100644
select CGROUP_SCHED
select FAIR_GROUP_SCHED
 diff --git a/init/init_task.c b/init/init_task.c
-index 7ecb458eb3da..40d2e86da6f9 100644
+index 7ecb458eb3da..e8f8be4f23ba 100644
 --- a/init/init_task.c
 +++ b/init/init_task.c
 @@ -70,9 +70,15 @@ struct task_struct init_task __aligned(L1_CACHE_BYTES) = {
@@ -430,9 +426,9 @@ index 7ecb458eb3da..40d2e86da6f9 100644
.usage  = REFCOUNT_INIT(2),
.flags  = PF_KTHREAD,
 +#ifdef CONFIG_SCHED_ALT
-+  .prio   = DEFAULT_PRIO + MAX_PRIORITY_ADJ,
++  .prio   = DEFAULT_PRIO,
 +  .static_prio= DEFAULT_PRIO,
-+  .normal_prio= DEFAULT_PRIO + MAX_PRIORITY_ADJ,
++  .normal_prio= DEFAULT_PRIO,
 +#else
.prio   = MAX_PRIO - 20,
.static_prio= MAX_PRIO - 20,
@@ -663,10 +659,10 @@ index 976092b7bd45..31d587c16ec1 100644
  obj-y += build_utility.o
 diff --git a/kernel/sched/alt_core.c b/kernel/sched/alt_core.c
 new file mode 100644
-index ..1044207ba0ad
+index ..c566583fe838
 --- /dev/null
 +++ b/kernel/sched/alt_core.c
-@@ -0,0 +1,8945 @@
+@@ -0,0 +1,8934 @@
 +/*
 + *  kernel/sched/alt_core.c
 + *
@@ -745,7 +741,7 @@ index ..1044207ba0ad
 +#define sched_feat(x) (0)
 +#endif /* CONFIG_SCHED_DEBUG */
 +
-+#define ALT_SCHED_VERSION "v6.8-r4"
++#define ALT_SCHED_VERSION "v6.8-r6"
 +
 +/*
 + * Compile time debug macro
@@ -856,27 +852,21 @@ index ..1044207ba0ad
 +  idle->on_rq = TASK_ON_RQ_QUEUED;
 +}
 +
-+static inline void
-+clear_recorded_preempt_mask(int pr, int low, int high, int cpu)
-+{
-+  if (low < pr && pr <= high)
++#define CLEAR_CACHED_PREEMPT_MASK(pr, low, high, cpu) \
++  if (low < pr && pr <= high) \
 +  cpumask_clear_cpu(cpu, sched_preempt_mask + pr);
-+}
 +
-+static inline void
-+set_recorded_preempt_mask(int pr, int low, int high, int cpu)
-+{
-+  if (low < pr && pr <= high)
++#define SET_CACHED_PREEMPT_MASK(pr, low, high, cpu)   \
++  if (low < pr && pr <= high) \
 +

[gentoo-commits] proj/linux-patches:6.8 commit in: /

2024-04-27 Thread Mike Pagano
commit: 910c52a332d5bc4800f6d510cc7427a5af1d7a28
Author: Mike Pagano  gentoo  org>
AuthorDate: Sat Apr 27 22:01:28 2024 +
Commit: Mike Pagano  gentoo  org>
CommitDate: Sat Apr 27 22:03:10 2024 +
URL:https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=910c52a3

Add UBSAN_BOUNDS and UBSAN_SHIFT and dependencies

Bug: https://bugs.gentoo.org/930733

Signed-off-by: Mike Pagano  gentoo.org>

 4567_distro-Gentoo-Kconfig.patch | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/4567_distro-Gentoo-Kconfig.patch b/4567_distro-Gentoo-Kconfig.patch
index d215166c..6134393f 100644
--- a/4567_distro-Gentoo-Kconfig.patch
+++ b/4567_distro-Gentoo-Kconfig.patch
@@ -6,9 +6,9 @@
  source "Documentation/Kconfig"
 +
 +source "distro/Kconfig"
 /dev/null  2022-08-25 07:13:06.694086407 -0400
-+++ b/distro/Kconfig   2022-08-25 13:21:55.150660724 -0400
-@@ -0,0 +1,291 @@
+--- /dev/null  2024-04-27 13:10:54.18827 -0400
 b/distro/Kconfig   2024-04-27 17:56:56.723132353 -0400
+@@ -0,0 +1,295 @@
 +menu "Gentoo Linux"
 +
 +config GENTOO_LINUX
@@ -213,6 +213,10 @@
 +  select SLAB_FREELIST_HARDENED
 +  select SHUFFLE_PAGE_ALLOCATOR
 +  select SLUB_DEBUG
++  select UBSAN
++  select CC_HAS_UBSAN_BOUNDS_STRICT if !CC_HAS_UBSAN_ARRAY_BOUNDS
++  select UBSAN_BOUNDS
++  select UBSAN_SHIFT
 +  select PAGE_POISONING
 +  select PAGE_POISONING_NO_SANITY
 +  select PAGE_POISONING_ZERO
@@ -300,9 +304,6 @@
 +  See the settings that become available for more details and 
fine-tuning.
 +
 +endmenu
--- 
-2.31.1
-
 From bd3ff0b16792c18c0614c2b95e148943209f460a Mon Sep 17 00:00:00 2001
 From: Georgy Yakovlev 
 Date: Tue, 8 Jun 2021 13:59:57 -0700
@@ -327,4 +328,3 @@ index 24c045b24..e13fc740c 100644
  This is the portion of low virtual memory which should be protected
 -- 
 2.31.1
-```



[gentoo-commits] proj/linux-patches:6.8 commit in: /

2024-04-21 Thread Mike Pagano
commit: 3584cee31ed8f353980cc8b10137fc86a44d0669
Author: Mike Pagano  gentoo  org>
AuthorDate: Sun Apr 21 22:24:38 2024 +
Commit: Mike Pagano  gentoo  org>
CommitDate: Sun Apr 21 22:24:38 2024 +
URL:https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=3584cee3

Remove redundant patch

Removed:
1800_gcc-plugins-stackleak-Avoid-head-text-section.patch

Bug: https://bugs.gentoo.org/930389

Signed-off-by: Mike Pagano  gentoo.org>

 _README|  4 ---
 ...plugins-stackleak-Avoid-head-text-section.patch | 36 --
 2 files changed, 40 deletions(-)

diff --git a/_README b/_README
index 1380bd5c..ba3f48c8 100644
--- a/_README
+++ b/_README
@@ -83,10 +83,6 @@ Patch:  1730_parisc-Disable-prctl.patch
 From:
https://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git
 Desc:prctl: Temporarily disable prctl(PR_SET_MDWE) on parisc
 
-Patch:  1800_gcc-plugins-stackleak-Avoid-head-text-section.patch
-From:https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
-Desc:gcc-plugins/stackleak: Avoid .head.text section
-
 Patch:  2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch
 From:   
https://lore.kernel.org/linux-bluetooth/20190522070540.48895-1-mar...@holtmann.org/raw
 Desc:   Bluetooth: Check key sizes only when Secure Simple Pairing is enabled. 
See bug #686758

diff --git a/1800_gcc-plugins-stackleak-Avoid-head-text-section.patch 
b/1800_gcc-plugins-stackleak-Avoid-head-text-section.patch
deleted file mode 100644
index 28964f01..
--- a/1800_gcc-plugins-stackleak-Avoid-head-text-section.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From e7d24c0aa8e678f41457d1304e2091cac6fd1a2e Mon Sep 17 00:00:00 2001
-From: Ard Biesheuvel 
-Date: Thu, 28 Mar 2024 07:42:57 +0100
-Subject: gcc-plugins/stackleak: Avoid .head.text section
-
-The .head.text section carries the startup code that runs with the MMU
-off or with a translation of memory that deviates from the ordinary one.
-So avoid instrumentation with the stackleak plugin, which already avoids
-.init.text and .noinstr.text entirely.
-
-Fixes: 48204aba801f1b51 ("x86/sme: Move early SME kernel encryption handling 
into .head.text")
-Reported-by: kernel test robot 
-Closes: 
https://lore.kernel.org/oe-lkp/202403221630.2692c998-oliver.s...@intel.com
-Signed-off-by: Ard Biesheuvel 
-Link: https://lore.kernel.org/r/20240328064256.2358634-2-ardb+...@google.com
-Signed-off-by: Kees Cook 

- scripts/gcc-plugins/stackleak_plugin.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/scripts/gcc-plugins/stackleak_plugin.c 
b/scripts/gcc-plugins/stackleak_plugin.c
-index c5c2ce113c9232..d20c47d21ad835 100644
 a/scripts/gcc-plugins/stackleak_plugin.c
-+++ b/scripts/gcc-plugins/stackleak_plugin.c
-@@ -467,6 +467,8 @@ static bool stackleak_gate(void)
-   return false;
-   if (STRING_EQUAL(section, ".entry.text"))
-   return false;
-+  if (STRING_EQUAL(section, ".head.text"))
-+  return false;
-   }
- 
-   return track_frame_size >= 0;
--- 
-cgit 1.2.3-korg
-



[gentoo-commits] proj/linux-patches:6.8 commit in: /

2024-04-17 Thread Alice Ferrazzi
commit: d3215cc0cf839cfd06cd6f2e3f6b02da939e86ab
Author: Alice Ferrazzi  gentoo  org>
AuthorDate: Thu Apr 18 05:29:34 2024 +
Commit: Alice Ferrazzi  gentoo  org>
CommitDate: Thu Apr 18 05:29:34 2024 +
URL:https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=d3215cc0

Linux patch 6.8.1: fix patch filename

Signed-off-by: Alice Ferrazzi  gentoo.org>

 1001_linux-6.8.1.patch => 1000_linux-6.8.1.patch | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/1001_linux-6.8.1.patch b/1000_linux-6.8.1.patch
similarity index 100%
rename from 1001_linux-6.8.1.patch
rename to 1000_linux-6.8.1.patch



[gentoo-commits] proj/linux-patches:6.8 commit in: /

2024-04-11 Thread Mike Pagano
commit: e9ca04d0b0f60f591603f76063130b0f82920234
Author: Mike Pagano  gentoo  org>
AuthorDate: Thu Apr 11 14:46:47 2024 +
Commit: Mike Pagano  gentoo  org>
CommitDate: Thu Apr 11 14:46:47 2024 +
URL:https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=e9ca04d0

gcc-plugins/stackleak: Avoid .head.text section

Signed-off-by: Mike Pagano  gentoo.org>

 _README|  4 +++
 ...plugins-stackleak-Avoid-head-text-section.patch | 36 ++
 2 files changed, 40 insertions(+)

diff --git a/_README b/_README
index d556a3be..a7081596 100644
--- a/_README
+++ b/_README
@@ -75,6 +75,10 @@ Patch:  1730_parisc-Disable-prctl.patch
 From:
https://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git
 Desc:prctl: Temporarily disable prctl(PR_SET_MDWE) on parisc
 
+Patch:  1800_gcc-plugins-stackleak-Avoid-head-text-section.patch
+From:https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
+Desc:gcc-plugins/stackleak: Avoid .head.text section
+
 Patch:  2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch
 From:   
https://lore.kernel.org/linux-bluetooth/20190522070540.48895-1-mar...@holtmann.org/raw
 Desc:   Bluetooth: Check key sizes only when Secure Simple Pairing is enabled. 
See bug #686758

diff --git a/1800_gcc-plugins-stackleak-Avoid-head-text-section.patch 
b/1800_gcc-plugins-stackleak-Avoid-head-text-section.patch
new file mode 100644
index ..28964f01
--- /dev/null
+++ b/1800_gcc-plugins-stackleak-Avoid-head-text-section.patch
@@ -0,0 +1,36 @@
+From e7d24c0aa8e678f41457d1304e2091cac6fd1a2e Mon Sep 17 00:00:00 2001
+From: Ard Biesheuvel 
+Date: Thu, 28 Mar 2024 07:42:57 +0100
+Subject: gcc-plugins/stackleak: Avoid .head.text section
+
+The .head.text section carries the startup code that runs with the MMU
+off or with a translation of memory that deviates from the ordinary one.
+So avoid instrumentation with the stackleak plugin, which already avoids
+.init.text and .noinstr.text entirely.
+
+Fixes: 48204aba801f1b51 ("x86/sme: Move early SME kernel encryption handling 
into .head.text")
+Reported-by: kernel test robot 
+Closes: 
https://lore.kernel.org/oe-lkp/202403221630.2692c998-oliver.s...@intel.com
+Signed-off-by: Ard Biesheuvel 
+Link: https://lore.kernel.org/r/20240328064256.2358634-2-ardb+...@google.com
+Signed-off-by: Kees Cook 
+---
+ scripts/gcc-plugins/stackleak_plugin.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/scripts/gcc-plugins/stackleak_plugin.c 
b/scripts/gcc-plugins/stackleak_plugin.c
+index c5c2ce113c9232..d20c47d21ad835 100644
+--- a/scripts/gcc-plugins/stackleak_plugin.c
 b/scripts/gcc-plugins/stackleak_plugin.c
+@@ -467,6 +467,8 @@ static bool stackleak_gate(void)
+   return false;
+   if (STRING_EQUAL(section, ".entry.text"))
+   return false;
++  if (STRING_EQUAL(section, ".head.text"))
++  return false;
+   }
+ 
+   return track_frame_size >= 0;
+-- 
+cgit 1.2.3-korg
+



[gentoo-commits] proj/linux-patches:6.8 commit in: /

2024-04-04 Thread Mike Pagano
commit: f8b1656b3b322d7aa4d35ccd7d4739ebff2287ea
Author: Mike Pagano  gentoo  org>
AuthorDate: Thu Apr  4 19:21:54 2024 +
Commit: Mike Pagano  gentoo  org>
CommitDate: Thu Apr  4 19:21:54 2024 +
URL:https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=f8b1656b

BMQ Patch 6.8-r4 (USE=experimental)

Signed-off-by: Mike Pagano  gentoo.org>

 _README|  2 +-
 ...atch => 5020_BMQ-and-PDS-io-scheduler-v6.8-r4.patch | 18 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/_README b/_README
index 36e97fef..a4ecb94d 100644
--- a/_README
+++ b/_README
@@ -99,6 +99,6 @@ Patch:  5010_enable-cpu-optimizations-universal.patch
 From:   https://github.com/graysky2/kernel_compiler_patch
 Desc:   Kernel >= 5.15 patch enables gcc = v11.1+ optimizations for additional 
CPUs.
 
-Patch:  5020_BMQ-and-PDS-io-scheduler-v6.8-r2.patch
+Patch:  5020_BMQ-and-PDS-io-scheduler-v6.8-r4.patch
 From:   https://gitlab.com/alfredchen/projectc
 Desc:   BMQ(BitMap Queue) Scheduler. A new CPU scheduler developed from 
PDS(incld). Inspired by the scheduler in zircon.

diff --git a/5020_BMQ-and-PDS-io-scheduler-v6.8-r2.patch 
b/5020_BMQ-and-PDS-io-scheduler-v6.8-r4.patch
similarity index 99%
rename from 5020_BMQ-and-PDS-io-scheduler-v6.8-r2.patch
rename to 5020_BMQ-and-PDS-io-scheduler-v6.8-r4.patch
index f0f8c11e..6ade9048 100644
--- a/5020_BMQ-and-PDS-io-scheduler-v6.8-r2.patch
+++ b/5020_BMQ-and-PDS-io-scheduler-v6.8-r4.patch
@@ -663,10 +663,10 @@ index 976092b7bd45..31d587c16ec1 100644
  obj-y += build_utility.o
 diff --git a/kernel/sched/alt_core.c b/kernel/sched/alt_core.c
 new file mode 100644
-index ..31fadbf46a7b
+index ..1044207ba0ad
 --- /dev/null
 +++ b/kernel/sched/alt_core.c
-@@ -0,0 +1,8944 @@
+@@ -0,0 +1,8945 @@
 +/*
 + *  kernel/sched/alt_core.c
 + *
@@ -745,7 +745,7 @@ index ..31fadbf46a7b
 +#define sched_feat(x) (0)
 +#endif /* CONFIG_SCHED_DEBUG */
 +
-+#define ALT_SCHED_VERSION "v6.8-r2"
++#define ALT_SCHED_VERSION "v6.8-r4"
 +
 +/*
 + * Compile time debug macro
@@ -4920,8 +4920,8 @@ index ..31fadbf46a7b
 +  stop_one_cpu_nowait(cpu, sg_balance_cpu_stop, p,
 +  >active_balance_work);
 +
-+  raw_spin_lock(_rq->lock);
 +  preempt_enable();
++  raw_spin_lock(_rq->lock);
 +  }
 +
 +  return res;
@@ -6043,7 +6043,8 @@ index ..31fadbf46a7b
 +  /* Avoid rq from going away on us: */
 +  preempt_disable();
 +
-+  __balance_callbacks(rq);
++  if (task_on_rq_queued(p))
++  __balance_callbacks(rq);
 +  __task_access_unlock(p, lock);
 +
 +  preempt_enable();
@@ -10632,10 +10633,10 @@ index ..ba1b7b805f1a
 +#endif /* ALT_SCHED_H */
 diff --git a/kernel/sched/bmq.h b/kernel/sched/bmq.h
 new file mode 100644
-index ..f270fd1b9086
+index ..b7c9813f6fa7
 --- /dev/null
 +++ b/kernel/sched/bmq.h
-@@ -0,0 +1,102 @@
+@@ -0,0 +1,101 @@
 +#define ALT_SCHED_NAME "BMQ"
 +
 +/*
@@ -10715,8 +10716,7 @@ index ..f270fd1b9086
 +
 +static inline void sched_task_renew(struct task_struct *p, const struct rq 
*rq)
 +{
-+  if (rq_switch_time(rq) > sysctl_sched_base_slice)
-+  deboost_task(p);
++  deboost_task(p);
 +}
 +
 +static inline void sched_task_sanity_check(struct task_struct *p, struct rq 
*rq) {}



[gentoo-commits] proj/linux-patches:6.8 commit in: /

2024-04-04 Thread Mike Pagano
commit: 0d78c2ebad9a1ed5fc2d9fddee412d3890647efc
Author: Mike Pagano  gentoo  org>
AuthorDate: Thu Apr  4 19:04:59 2024 +
Commit: Mike Pagano  gentoo  org>
CommitDate: Thu Apr  4 19:04:59 2024 +
URL:https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=0d78c2eb

Linux patch 6.8.4

Signed-off-by: Mike Pagano  gentoo.org>

 _README|4 +
 1003_linux-6.8.4.patch | 1218 
 2 files changed, 1222 insertions(+)

diff --git a/_README b/_README
index b8286427..36e97fef 100644
--- a/_README
+++ b/_README
@@ -55,6 +55,10 @@ Patch:  1002_linux-6.8.3.patch
 From:   https://www.kernel.org
 Desc:   Linux 6.8.3
 
+Patch:  1003_linux-6.8.4.patch
+From:   https://www.kernel.org
+Desc:   Linux 6.8.4
+
 Patch:  1510_fs-enable-link-security-restrictions-by-default.patch
 From:   
http://sources.debian.net/src/linux/3.16.7-ckt4-3/debian/patches/debian/fs-enable-link-security-restrictions-by-default.patch/
 Desc:   Enable link security restrictions by default.

diff --git a/1003_linux-6.8.4.patch b/1003_linux-6.8.4.patch
new file mode 100644
index ..82e75213
--- /dev/null
+++ b/1003_linux-6.8.4.patch
@@ -0,0 +1,1218 @@
+diff --git a/Makefile b/Makefile
+index a78379891d221..c436247d750c7 100644
+--- a/Makefile
 b/Makefile
+@@ -1,7 +1,7 @@
+ # SPDX-License-Identifier: GPL-2.0
+ VERSION = 6
+ PATCHLEVEL = 8
+-SUBLEVEL = 3
++SUBLEVEL = 4
+ EXTRAVERSION =
+ NAME = Hurr durr I'ma ninja sloth
+ 
+diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
+index 515e7958c6c10..2cc0a9606175f 100644
+--- a/include/linux/workqueue.h
 b/include/linux/workqueue.h
+@@ -391,13 +391,6 @@ enum {
+   WQ_MAX_ACTIVE   = 512,/* I like 512, better ideas? */
+   WQ_UNBOUND_MAX_ACTIVE   = WQ_MAX_ACTIVE,
+   WQ_DFL_ACTIVE   = WQ_MAX_ACTIVE / 2,
+-
+-  /*
+-   * Per-node default cap on min_active. Unless explicitly set, min_active
+-   * is set to min(max_active, WQ_DFL_MIN_ACTIVE). For more details, see
+-   * workqueue_struct->min_active definition.
+-   */
+-  WQ_DFL_MIN_ACTIVE   = 8,
+ };
+ 
+ /*
+@@ -440,33 +433,11 @@ extern struct workqueue_struct 
*system_freezable_power_efficient_wq;
+  * alloc_workqueue - allocate a workqueue
+  * @fmt: printf format for the name of the workqueue
+  * @flags: WQ_* flags
+- * @max_active: max in-flight work items, 0 for default
++ * @max_active: max in-flight work items per CPU, 0 for default
+  * remaining args: args for @fmt
+  *
+- * For a per-cpu workqueue, @max_active limits the number of in-flight work
+- * items for each CPU. e.g. @max_active of 1 indicates that each CPU can be
+- * executing at most one work item for the workqueue.
+- *
+- * For unbound workqueues, @max_active limits the number of in-flight work 
items
+- * for the whole system. e.g. @max_active of 16 indicates that that there can 
be
+- * at most 16 work items executing for the workqueue in the whole system.
+- *
+- * As sharing the same active counter for an unbound workqueue across multiple
+- * NUMA nodes can be expensive, @max_active is distributed to each NUMA node
+- * according to the proportion of the number of online CPUs and enforced
+- * independently.
+- *
+- * Depending on online CPU distribution, a node may end up with per-node
+- * max_active which is significantly lower than @max_active, which can lead to
+- * deadlocks if the per-node concurrency limit is lower than the maximum 
number
+- * of interdependent work items for the workqueue.
+- *
+- * To guarantee forward progress regardless of online CPU distribution, the
+- * concurrency limit on every node is guaranteed to be equal to or greater 
than
+- * min_active which is set to min(@max_active, %WQ_DFL_MIN_ACTIVE). This means
+- * that the sum of per-node max_active's may be larger than @max_active.
+- *
+- * For detailed information on %WQ_* flags, please refer to
++ * Allocate a workqueue with the specified parameters.  For detailed
++ * information on WQ_* flags, please refer to
+  * Documentation/core-api/workqueue.rst.
+  *
+  * RETURNS:
+diff --git a/kernel/workqueue.c b/kernel/workqueue.c
+index 781900b148b67..7b482a26d7419 100644
+--- a/kernel/workqueue.c
 b/kernel/workqueue.c
+@@ -108,7 +108,7 @@ enum {
+   RESCUER_NICE_LEVEL  = MIN_NICE,
+   HIGHPRI_NICE_LEVEL  = MIN_NICE,
+ 
+-  WQ_NAME_LEN = 32,
++  WQ_NAME_LEN = 24,
+ };
+ 
+ /*
+@@ -122,9 +122,6 @@ enum {
+  *
+  * L: pool->lock protected.  Access with pool->lock held.
+  *
+- * LN: pool->lock and wq_node_nr_active->lock protected for writes. Either for
+- * reads.
+- *
+  * K: Only modified by worker while holding pool->lock. Can be safely read by
+  *self, while holding pool->lock or from IRQ context if %current is the
+  *kworker.
+@@ -146,9 +143,6 @@ enum {
+  *
+  * WR: wq->mutex protected for writes.  RCU protected for reads.
+  *
+- * 

[gentoo-commits] proj/linux-patches:6.8 commit in: /

2024-03-15 Thread Mike Pagano
commit: 8c47d4e09a8d4127e428ed961b17408e56d0f7ab
Author: Mike Pagano  gentoo  org>
AuthorDate: Fri Mar 15 21:58:25 2024 +
Commit: Mike Pagano  gentoo  org>
CommitDate: Fri Mar 15 21:58:25 2024 +
URL:https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=8c47d4e0

Linux patch 6.8.1

Signed-off-by: Mike Pagano  gentoo.org>

 _README|   4 +
 1001_linux-6.8.1.patch | 523 +
 2 files changed, 527 insertions(+)

diff --git a/_README b/_README
index e6b9bd5b..5fe89b7e 100644
--- a/_README
+++ b/_README
@@ -43,6 +43,10 @@ EXPERIMENTAL
 Individual Patch Descriptions:
 --
 
+Patch:  1000_linux-6.8.1.patch
+From:   https://www.kernel.org
+Desc:   Linux 6.8.1
+
 Patch:  1510_fs-enable-link-security-restrictions-by-default.patch
 From:   
http://sources.debian.net/src/linux/3.16.7-ckt4-3/debian/patches/debian/fs-enable-link-security-restrictions-by-default.patch/
 Desc:   Enable link security restrictions by default.

diff --git a/1001_linux-6.8.1.patch b/1001_linux-6.8.1.patch
new file mode 100644
index ..071efefa
--- /dev/null
+++ b/1001_linux-6.8.1.patch
@@ -0,0 +1,523 @@
+diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu 
b/Documentation/ABI/testing/sysfs-devices-system-cpu
+index a1db6db475055..710d47be11e04 100644
+--- a/Documentation/ABI/testing/sysfs-devices-system-cpu
 b/Documentation/ABI/testing/sysfs-devices-system-cpu
+@@ -516,6 +516,7 @@ What:  /sys/devices/system/cpu/vulnerabilities
+   /sys/devices/system/cpu/vulnerabilities/mds
+   /sys/devices/system/cpu/vulnerabilities/meltdown
+   /sys/devices/system/cpu/vulnerabilities/mmio_stale_data
++  /sys/devices/system/cpu/vulnerabilities/reg_file_data_sampling
+   /sys/devices/system/cpu/vulnerabilities/retbleed
+   /sys/devices/system/cpu/vulnerabilities/spec_store_bypass
+   /sys/devices/system/cpu/vulnerabilities/spectre_v1
+diff --git a/Documentation/admin-guide/hw-vuln/index.rst 
b/Documentation/admin-guide/hw-vuln/index.rst
+index de99caabf65a3..ff0b440ef2dc9 100644
+--- a/Documentation/admin-guide/hw-vuln/index.rst
 b/Documentation/admin-guide/hw-vuln/index.rst
+@@ -21,3 +21,4 @@ are configurable at compile, boot or run time.
+cross-thread-rsb
+srso
+gather_data_sampling
++   reg-file-data-sampling
+diff --git a/Documentation/admin-guide/hw-vuln/reg-file-data-sampling.rst 
b/Documentation/admin-guide/hw-vuln/reg-file-data-sampling.rst
+new file mode 100644
+index 0..0585d02b9a6cb
+--- /dev/null
 b/Documentation/admin-guide/hw-vuln/reg-file-data-sampling.rst
+@@ -0,0 +1,104 @@
++==
++Register File Data Sampling (RFDS)
++==
++
++Register File Data Sampling (RFDS) is a microarchitectural vulnerability that
++only affects Intel Atom parts(also branded as E-cores). RFDS may allow
++a malicious actor to infer data values previously used in floating point
++registers, vector registers, or integer registers. RFDS does not provide the
++ability to choose which data is inferred. CVE-2023-28746 is assigned to RFDS.
++
++Affected Processors
++===
++Below is the list of affected Intel processors [#f1]_:
++
++   ===  
++   Common name  Family_Model
++   ===  
++   ATOM_GOLDMONT   06_5CH
++   ATOM_GOLDMONT_D 06_5FH
++   ATOM_GOLDMONT_PLUS  06_7AH
++   ATOM_TREMONT_D  06_86H
++   ATOM_TREMONT06_96H
++   ALDERLAKE   06_97H
++   ALDERLAKE_L 06_9AH
++   ATOM_TREMONT_L  06_9CH
++   RAPTORLAKE  06_B7H
++   RAPTORLAKE_P06_BAH
++   ATOM_GRACEMONT  06_BEH
++   RAPTORLAKE_S06_BFH
++   ===  
++
++As an exception to this table, Intel Xeon E family parts ALDERLAKE(06_97H) and
++RAPTORLAKE(06_B7H) codenamed Catlow are not affected. They are reported as
++vulnerable in Linux because they share the same family/model with an affected
++part. Unlike their affected counterparts, they do not enumerate RFDS_CLEAR or
++CPUID.HYBRID. This information could be used to distinguish between the
++affected and unaffected parts, but it is deemed not worth adding complexity as
++the reporting is fixed automatically when these parts enumerate RFDS_NO.
++
++Mitigation
++==
++Intel released a microcode update that enables software to clear sensitive
++information using the VERW instruction. Like MDS, RFDS deploys the same
++mitigation strategy to force the CPU to clear the affected buffers before an
++attacker can extract the secrets. This is achieved by using the otherwise
++unused and obsolete VERW instruction in combination with a microcode update.
++The microcode clears 

[gentoo-commits] proj/linux-patches:6.8 commit in: /

2024-03-11 Thread Mike Pagano
commit: d28bc7b26a2b978abb89076172397bcd551bc4d5
Author: Mike Pagano  gentoo  org>
AuthorDate: Mon Mar 11 20:48:49 2024 +
Commit: Mike Pagano  gentoo  org>
CommitDate: Mon Mar 11 20:48:49 2024 +
URL:https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=d28bc7b2

CPU Optimization patch

Signed-off-by: Mike Pagano  gentoo.org>

 _README   |   4 +
 5010_enable-cpu-optimizations-universal.patch | 787 ++
 2 files changed, 791 insertions(+)

diff --git a/_README b/_README
index a4c7916d..887cea4c 100644
--- a/_README
+++ b/_README
@@ -78,3 +78,7 @@ Desc:   Print firmware info (Reqs 
CONFIG_GENTOO_PRINT_FIRMWARE_INFO). Thanks to
 Patch:  4567_distro-Gentoo-Kconfig.patch
 From:   Tom Wijsman 
 Desc:   Add Gentoo Linux support config settings and defaults.
+
+Patch:  5010_enable-cpu-optimizations-universal.patch
+From:   https://github.com/graysky2/kernel_compiler_patch
+Desc:   Kernel >= 5.15 patch enables gcc = v11.1+ optimizations for additional 
CPUs.

diff --git a/5010_enable-cpu-optimizations-universal.patch 
b/5010_enable-cpu-optimizations-universal.patch
new file mode 100644
index ..75c48bf1
--- /dev/null
+++ b/5010_enable-cpu-optimizations-universal.patch
@@ -0,0 +1,787 @@
+From 71dd30c3e2ab2852b0290ae1f34ce1c7f8655040 Mon Sep 17 00:00:00 2001
+From: graysky 
+Date: Wed, 21 Feb 2024 08:38:13 -0500
+
+FEATURES
+This patch adds additional CPU options to the Linux kernel accessible under:
+ Processor type and features  --->
+  Processor family --->
+
+With the release of gcc 11.1 and clang 12.0, several generic 64-bit levels are
+offered which are good for supported Intel or AMD CPUs:
+• x86-64-v2
+• x86-64-v3
+• x86-64-v4
+
+Users of glibc 2.33 and above can see which level is supported by running:
+  /lib/ld-linux-x86-64.so.2 --help | grep supported
+Or
+  /lib64/ld-linux-x86-64.so.2 --help | grep supported
+
+Alternatively, compare the flags from /proc/cpuinfo to this list.[1]
+
+CPU-specific microarchitectures include:
+• AMD Improved K8-family
+• AMD K10-family
+• AMD Family 10h (Barcelona)
+• AMD Family 14h (Bobcat)
+• AMD Family 16h (Jaguar)
+• AMD Family 15h (Bulldozer)
+• AMD Family 15h (Piledriver)
+• AMD Family 15h (Steamroller)
+• AMD Family 15h (Excavator)
+• AMD Family 17h (Zen)
+• AMD Family 17h (Zen 2)
+• AMD Family 19h (Zen 3)†
+• AMD Family 19h (Zen 4)§
+• Intel Silvermont low-power processors
+• Intel Goldmont low-power processors (Apollo Lake and Denverton)
+• Intel Goldmont Plus low-power processors (Gemini Lake)
+• Intel 1st Gen Core i3/i5/i7 (Nehalem)
+• Intel 1.5 Gen Core i3/i5/i7 (Westmere)
+• Intel 2nd Gen Core i3/i5/i7 (Sandybridge)
+• Intel 3rd Gen Core i3/i5/i7 (Ivybridge)
+• Intel 4th Gen Core i3/i5/i7 (Haswell)
+• Intel 5th Gen Core i3/i5/i7 (Broadwell)
+• Intel 6th Gen Core i3/i5/i7 (Skylake)
+• Intel 6th Gen Core i7/i9 (Skylake X)
+• Intel 8th Gen Core i3/i5/i7 (Cannon Lake)
+• Intel 10th Gen Core i7/i9 (Ice Lake)
+• Intel Xeon (Cascade Lake)
+• Intel Xeon (Cooper Lake)*
+• Intel 3rd Gen 10nm++ i3/i5/i7/i9-family (Tiger Lake)*
+• Intel 4th Gen 10nm++ Xeon (Sapphire Rapids)‡
+• Intel 11th Gen i3/i5/i7/i9-family (Rocket Lake)‡
+• Intel 12th Gen i3/i5/i7/i9-family (Alder Lake)‡
+• Intel 13th Gen i3/i5/i7/i9-family (Raptor Lake)§
+• Intel 14th Gen i3/i5/i7/i9-family (Meteor Lake)§
+• Intel 5th Gen 10nm++ Xeon (Emerald Rapids)§
+
+Notes: If not otherwise noted, gcc >=9.1 is required for support.
+   *Requires gcc >=10.1 or clang >=10.0
+   †Required gcc >=10.3 or clang >=12.0
+   ‡Required gcc >=11.1 or clang >=12.0
+   §Required gcc >=13.0 or clang >=15.0.5
+
+It also offers to compile passing the 'native' option which, "selects the CPU
+to generate code for at compilation time by determining the processor type of
+the compiling machine. Using -march=native enables all instruction subsets
+supported by the local machine and will produce code optimized for the local
+machine under the constraints of the selected instruction set."[2]
+
+Users of Intel CPUs should select the 'Intel-Native' option and users of AMD
+CPUs should select the 'AMD-Native' option.
+
+MINOR NOTES RELATING TO INTEL ATOM PROCESSORS
+This patch also changes -march=atom to -march=bonnell in accordance with the
+gcc v4.9 changes. Upstream is using the deprecated -match=atom flags when I
+believe it should use the newer -march=bonnell flag for atom processors.[3]
+
+It is not recommended to compile on Atom-CPUs with the 'native' option.[4] The
+recommendation is to use the 'atom' option instead.
+
+BENEFITS
+Small but real speed increases are measurable using a make endpoint comparing
+a generic kernel to one built with one of the respective microarchs.
+
+See the following experimental evidence supporting this statement:
+https://github.com/graysky2/kernel_gcc_patch
+
+REQUIREMENTS
+linux version 5.17+
+gcc version >=9.0 or clang version >=9.0
+
+ACKNOWLEDGMENTS
+This patch builds