Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] linux6.x: backport fix for kexec regression
@ 2024-03-25 18:00 ahesford
  2024-03-25 23:52 ` sgn
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: ahesford @ 2024-03-25 18:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1503 bytes --]

There is a new pull request by ahesford against master on the void-packages repository

https://github.com/ahesford/void-packages kexec-regression
https://github.com/void-linux/void-packages/pull/49529

linux6.x: backport fix for kexec regression
All of our `linux6.x` kernel series include a change that breaks `kexec` on certain hardware, notably AMD CPUs using various iterations of the Zen microarchitecture. I can reproduce the issue on my Zen 3 CPU, while [other reports](https://github.com/zbm-dev/zfsbootmenu/discussions/598) reveal that this problem affects ZFSBootMenu users on other iterations. I bisected the problem and confirmed that it is caused by the same commit that [seems to impact users more generally](https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/). Consequently, the current upstream fix is to [just revert the change](https://lore.kernel.org/linux-kernel/8142c0de-e3a4-4e78-aa1b-f5e6503752e4@intel.com/T/#m674760504b865936068602efca9a10fb72e7102e).

While I was backporting the reversion, I took the liberty of updating `linux6.1` as well.

I'm in the process of building and testing kernels with these patches to confirm that it fixes the ZFSBootMenu problem I observed and, assuming so, plan to bump our kernels to include the fix.

cc: @sgn @Duncaen 

[ci skip]

#### Testing the changes
- I tested the changes in this PR: **in process**

A patch file from https://github.com/void-linux/void-packages/pull/49529.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-kexec-regression-49529.patch --]
[-- Type: text/x-diff, Size: 17285 bytes --]

From 80b7c28d49b6c3ed89586900640f7e08f154105c Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:23:01 -0400
Subject: [PATCH 1/4] linux6.1: update to 6.1.82, backport fix for kexec
 regression

---
 srcpkgs/linux6.1/files/arm64-dotconfig        |  1 +
 srcpkgs/linux6.1/files/i386-dotconfig         |  3 +
 srcpkgs/linux6.1/files/x86_64-dotconfig       |  3 +
 srcpkgs/linux6.1/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.1/template                     |  4 +-
 5 files changed, 84 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux6.1/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.1/files/arm64-dotconfig b/srcpkgs/linux6.1/files/arm64-dotconfig
index 397682edc608b4..8906c3c9f130a7 100644
--- a/srcpkgs/linux6.1/files/arm64-dotconfig
+++ b/srcpkgs/linux6.1/files/arm64-dotconfig
@@ -11626,6 +11626,7 @@ CONFIG_NFS_DISABLE_UDP_SUPPORT=y
 # CONFIG_NFS_V4_2_READ_PLUS is not set
 CONFIG_NFSD=m
 CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V2=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
 CONFIG_NFSD_PNFS=y
diff --git a/srcpkgs/linux6.1/files/i386-dotconfig b/srcpkgs/linux6.1/files/i386-dotconfig
index 55b828bcd6f809..d68950e89816b1 100644
--- a/srcpkgs/linux6.1/files/i386-dotconfig
+++ b/srcpkgs/linux6.1/files/i386-dotconfig
@@ -459,6 +459,7 @@ CONFIG_X86_INTEL_TSX_MODE_OFF=y
 # CONFIG_X86_INTEL_TSX_MODE_AUTO is not set
 CONFIG_EFI=y
 CONFIG_EFI_STUB=y
+CONFIG_EFI_HANDOVER_PROTOCOL=y
 # CONFIG_HZ_100 is not set
 # CONFIG_HZ_250 is not set
 # CONFIG_HZ_300 is not set
@@ -489,6 +490,7 @@ CONFIG_PAGE_TABLE_ISOLATION=y
 CONFIG_RETPOLINE=y
 CONFIG_RETHUNK=y
 # CONFIG_GDS_FORCE_MITIGATION is not set
+CONFIG_MITIGATION_RFDS=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
 #
@@ -9815,6 +9817,7 @@ CONFIG_NFS_DISABLE_UDP_SUPPORT=y
 # CONFIG_NFS_V4_2_READ_PLUS is not set
 CONFIG_NFSD=m
 CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V2=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
 CONFIG_NFSD_PNFS=y
diff --git a/srcpkgs/linux6.1/files/x86_64-dotconfig b/srcpkgs/linux6.1/files/x86_64-dotconfig
index af91e23d8700a1..844dc3950fb6d5 100644
--- a/srcpkgs/linux6.1/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.1/files/x86_64-dotconfig
@@ -473,6 +473,7 @@ CONFIG_X86_INTEL_TSX_MODE_OFF=y
 # CONFIG_X86_SGX is not set
 CONFIG_EFI=y
 CONFIG_EFI_STUB=y
+CONFIG_EFI_HANDOVER_PROTOCOL=y
 CONFIG_EFI_MIXED=y
 # CONFIG_HZ_100 is not set
 # CONFIG_HZ_250 is not set
@@ -516,6 +517,7 @@ CONFIG_CPU_IBRS_ENTRY=y
 CONFIG_CPU_SRSO=y
 CONFIG_SLS=y
 # CONFIG_GDS_FORCE_MITIGATION is not set
+CONFIG_MITIGATION_RFDS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10063,6 +10065,7 @@ CONFIG_NFS_DISABLE_UDP_SUPPORT=y
 # CONFIG_NFS_V4_2_READ_PLUS is not set
 CONFIG_NFSD=m
 CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V2=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
 CONFIG_NFSD_PNFS=y
diff --git a/srcpkgs/linux6.1/patches/revert-gbpages.patch b/srcpkgs/linux6.1/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.1/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.1/template b/srcpkgs/linux6.1/template
index 5362648ff88173..3159dc39adf35a 100644
--- a/srcpkgs/linux6.1/template
+++ b/srcpkgs/linux6.1/template
@@ -1,6 +1,6 @@
 # Template file for 'linux6.1'
 pkgname=linux6.1
-version=6.1.79
+version=6.1.82
 revision=1
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
@@ -14,7 +14,7 @@ if [ "${version##*.}" != 0 ]; then
 fi
 
 checksum="2ca1f17051a430f6fed1196e4952717507171acfd97d96577212502703b25deb
- 2a5ffcf13896415ef220fbc025aed7b3065525974b2dbcc04a1f71dbee7c2e3a"
+ 697f343a8c1e655b6f2e89dd8c2703e2bfd31384e9cf5e4d1edbc04120883ca2"
 python_version=3
 
 # XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.

From 116d654f6cb51d59adb0fe5ad1aab9c5ee45a9d5 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:46:09 -0400
Subject: [PATCH 2/4] linux6.6: backport fix for kexec regression

---
 srcpkgs/linux6.6/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.6/template                     |  2 +-
 2 files changed, 76 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/linux6.6/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.6/patches/revert-gbpages.patch b/srcpkgs/linux6.6/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.6/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.6/template b/srcpkgs/linux6.6/template
index 903bcb457a83c2..722c6fe864540f 100644
--- a/srcpkgs/linux6.6/template
+++ b/srcpkgs/linux6.6/template
@@ -1,7 +1,7 @@
 # Template file for 'linux6.6'
 pkgname=linux6.6
 version=6.6.22
-revision=1
+revision=2
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
 license="GPL-2.0-only"

From 02e00d6cd33b7f4480acbd615ab15e449960fc1b Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:46:39 -0400
Subject: [PATCH 3/4] linux6.7: backport fix for kexec regression

---
 srcpkgs/linux6.7/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.7/template                     |  2 +-
 2 files changed, 76 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/linux6.7/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.7/patches/revert-gbpages.patch b/srcpkgs/linux6.7/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.7/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.7/template b/srcpkgs/linux6.7/template
index 0e9800fdaedc2e..4eb882e22ecfec 100644
--- a/srcpkgs/linux6.7/template
+++ b/srcpkgs/linux6.7/template
@@ -1,7 +1,7 @@
 # Template file for 'linux6.7'
 pkgname=linux6.7
 version=6.7.10
-revision=1
+revision=2
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
 license="GPL-2.0-only"

From 2b94fd68543851ae8820d7240b10653726960393 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:47:20 -0400
Subject: [PATCH 4/4] linux6.8: backport fix for kexec regression

---
 srcpkgs/linux6.8/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.8/template                     |  2 +-
 2 files changed, 76 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/linux6.8/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.8/patches/revert-gbpages.patch b/srcpkgs/linux6.8/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.8/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.8/template b/srcpkgs/linux6.8/template
index d060a08f883d4c..34f21132c83995 100644
--- a/srcpkgs/linux6.8/template
+++ b/srcpkgs/linux6.8/template
@@ -1,7 +1,7 @@
 # Template file for 'linux6.8'
 pkgname=linux6.8
 version=6.8.1
-revision=1
+revision=2
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
 license="GPL-2.0-only"

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: linux6.x: backport fix for kexec regression
  2024-03-25 18:00 [PR PATCH] linux6.x: backport fix for kexec regression ahesford
@ 2024-03-25 23:52 ` sgn
  2024-03-26  0:36 ` ahesford
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: sgn @ 2024-03-25 23:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 245 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/49529#issuecomment-2019120943

Comment:
Yes, that commit should be reverted, seeing that in urgency, I think there'll be a stable release soon, no?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: linux6.x: backport fix for kexec regression
  2024-03-25 18:00 [PR PATCH] linux6.x: backport fix for kexec regression ahesford
  2024-03-25 23:52 ` sgn
@ 2024-03-26  0:36 ` ahesford
  2024-03-27 13:23 ` dkwo
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ahesford @ 2024-03-26  0:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 555 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/49529#issuecomment-2019177335

Comment:
I've built these kernels for aarch64 and x86_64 and confirm that the revert fixes booting with ZFSBootMenu for every kernel series in this PR.

We can wait a day or two to see if new kernels are forthcoming. I see some announcements for 6.1 and 6.6 RC windows, but the revert does not appear in the changelog. We should make sure this is included in the next release, or we'll have to carry patches for awhile.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: linux6.x: backport fix for kexec regression
  2024-03-25 18:00 [PR PATCH] linux6.x: backport fix for kexec regression ahesford
  2024-03-25 23:52 ` sgn
  2024-03-26  0:36 ` ahesford
@ 2024-03-27 13:23 ` dkwo
  2024-03-27 14:14 ` [PR PATCH] [Updated] " ahesford
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dkwo @ 2024-03-27 13:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 202 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/49529#issuecomment-2022756518

Comment:
New kernels today, but I can only see that patch in linux-next.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] linux6.x: backport fix for kexec regression
  2024-03-25 18:00 [PR PATCH] linux6.x: backport fix for kexec regression ahesford
                   ` (2 preceding siblings ...)
  2024-03-27 13:23 ` dkwo
@ 2024-03-27 14:14 ` ahesford
  2024-03-27 14:15 ` ahesford
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ahesford @ 2024-03-27 14:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1508 bytes --]

There is an updated pull request by ahesford against master on the void-packages repository

https://github.com/ahesford/void-packages kexec-regression
https://github.com/void-linux/void-packages/pull/49529

linux6.x: backport fix for kexec regression
All of our `linux6.x` kernel series include a change that breaks `kexec` on certain hardware, notably AMD CPUs using various iterations of the Zen microarchitecture. I can reproduce the issue on my Zen 3 CPU, while [other reports](https://github.com/zbm-dev/zfsbootmenu/discussions/598) reveal that this problem affects ZFSBootMenu users on other iterations. I bisected the problem and confirmed that it is caused by the same commit that [seems to impact users more generally](https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/). Consequently, the current upstream fix is to [just revert the change](https://lore.kernel.org/linux-kernel/8142c0de-e3a4-4e78-aa1b-f5e6503752e4@intel.com/T/#m674760504b865936068602efca9a10fb72e7102e).

While I was backporting the reversion, I took the liberty of updating `linux6.1` as well.

I'm in the process of building and testing kernels with these patches to confirm that it fixes the ZFSBootMenu problem I observed and, assuming so, plan to bump our kernels to include the fix.

cc: @sgn @Duncaen 

[ci skip]

#### Testing the changes
- I tested the changes in this PR: **in process**

A patch file from https://github.com/void-linux/void-packages/pull/49529.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-kexec-regression-49529.patch --]
[-- Type: text/x-diff, Size: 18396 bytes --]

From e4767bbe0d673ac6a44d462574fe3a9249f73d4d Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:23:01 -0400
Subject: [PATCH 1/4] linux6.1: update to 6.1.83, backport fix for kexec
 regression

---
 srcpkgs/linux6.1/files/arm64-dotconfig        |  1 +
 srcpkgs/linux6.1/files/i386-dotconfig         |  3 +
 srcpkgs/linux6.1/files/x86_64-dotconfig       |  3 +
 srcpkgs/linux6.1/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.1/template                     |  4 +-
 5 files changed, 84 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux6.1/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.1/files/arm64-dotconfig b/srcpkgs/linux6.1/files/arm64-dotconfig
index 397682edc608b4..8906c3c9f130a7 100644
--- a/srcpkgs/linux6.1/files/arm64-dotconfig
+++ b/srcpkgs/linux6.1/files/arm64-dotconfig
@@ -11626,6 +11626,7 @@ CONFIG_NFS_DISABLE_UDP_SUPPORT=y
 # CONFIG_NFS_V4_2_READ_PLUS is not set
 CONFIG_NFSD=m
 CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V2=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
 CONFIG_NFSD_PNFS=y
diff --git a/srcpkgs/linux6.1/files/i386-dotconfig b/srcpkgs/linux6.1/files/i386-dotconfig
index 55b828bcd6f809..d68950e89816b1 100644
--- a/srcpkgs/linux6.1/files/i386-dotconfig
+++ b/srcpkgs/linux6.1/files/i386-dotconfig
@@ -459,6 +459,7 @@ CONFIG_X86_INTEL_TSX_MODE_OFF=y
 # CONFIG_X86_INTEL_TSX_MODE_AUTO is not set
 CONFIG_EFI=y
 CONFIG_EFI_STUB=y
+CONFIG_EFI_HANDOVER_PROTOCOL=y
 # CONFIG_HZ_100 is not set
 # CONFIG_HZ_250 is not set
 # CONFIG_HZ_300 is not set
@@ -489,6 +490,7 @@ CONFIG_PAGE_TABLE_ISOLATION=y
 CONFIG_RETPOLINE=y
 CONFIG_RETHUNK=y
 # CONFIG_GDS_FORCE_MITIGATION is not set
+CONFIG_MITIGATION_RFDS=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
 #
@@ -9815,6 +9817,7 @@ CONFIG_NFS_DISABLE_UDP_SUPPORT=y
 # CONFIG_NFS_V4_2_READ_PLUS is not set
 CONFIG_NFSD=m
 CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V2=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
 CONFIG_NFSD_PNFS=y
diff --git a/srcpkgs/linux6.1/files/x86_64-dotconfig b/srcpkgs/linux6.1/files/x86_64-dotconfig
index af91e23d8700a1..844dc3950fb6d5 100644
--- a/srcpkgs/linux6.1/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.1/files/x86_64-dotconfig
@@ -473,6 +473,7 @@ CONFIG_X86_INTEL_TSX_MODE_OFF=y
 # CONFIG_X86_SGX is not set
 CONFIG_EFI=y
 CONFIG_EFI_STUB=y
+CONFIG_EFI_HANDOVER_PROTOCOL=y
 CONFIG_EFI_MIXED=y
 # CONFIG_HZ_100 is not set
 # CONFIG_HZ_250 is not set
@@ -516,6 +517,7 @@ CONFIG_CPU_IBRS_ENTRY=y
 CONFIG_CPU_SRSO=y
 CONFIG_SLS=y
 # CONFIG_GDS_FORCE_MITIGATION is not set
+CONFIG_MITIGATION_RFDS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -10063,6 +10065,7 @@ CONFIG_NFS_DISABLE_UDP_SUPPORT=y
 # CONFIG_NFS_V4_2_READ_PLUS is not set
 CONFIG_NFSD=m
 CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V2=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
 CONFIG_NFSD_PNFS=y
diff --git a/srcpkgs/linux6.1/patches/revert-gbpages.patch b/srcpkgs/linux6.1/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.1/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.1/template b/srcpkgs/linux6.1/template
index 5362648ff88173..c5ec1fb85ab20c 100644
--- a/srcpkgs/linux6.1/template
+++ b/srcpkgs/linux6.1/template
@@ -1,6 +1,6 @@
 # Template file for 'linux6.1'
 pkgname=linux6.1
-version=6.1.79
+version=6.1.83
 revision=1
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
@@ -14,7 +14,7 @@ if [ "${version##*.}" != 0 ]; then
 fi
 
 checksum="2ca1f17051a430f6fed1196e4952717507171acfd97d96577212502703b25deb
- 2a5ffcf13896415ef220fbc025aed7b3065525974b2dbcc04a1f71dbee7c2e3a"
+ 9268c5f79c00caf77e4be77795e26be36862eb60fd0d78a2f6bc5baeac84dd82"
 python_version=3
 
 # XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.

From bb37387e505cfe580b3bdd6942b6a3209675d5c5 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:46:09 -0400
Subject: [PATCH 2/4] linux6.6: update to 6.6.23, backport fix for kexec
 regression

---
 srcpkgs/linux6.6/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.6/template                     |  4 +-
 2 files changed, 77 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux6.6/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.6/patches/revert-gbpages.patch b/srcpkgs/linux6.6/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.6/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.6/template b/srcpkgs/linux6.6/template
index 174016326fd16d..d9ec2912b61dfe 100644
--- a/srcpkgs/linux6.6/template
+++ b/srcpkgs/linux6.6/template
@@ -1,6 +1,6 @@
 # Template file for 'linux6.6'
 pkgname=linux6.6
-version=6.6.22
+version=6.6.23
 revision=1
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
@@ -14,7 +14,7 @@ if [ "${version##*.}" != 0 ]; then
 fi
 
 checksum="d926a06c63dd8ac7df3f86ee1ffc2ce2a3b81a2d168484e76b5b389aba8e56d0
- a8a5380de3206b2aeed4cb0425e319655c2df0babbfb1cb2a4fdd7e8dbcc3c29"
+ a40130b4f55fb0b5e2c968a39a0bfa44e76b0110e62139d5fa82c02422ef31c9"
 python_version=3
 
 # XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.

From 7ce566a87b094d949efd64cd75dc7ab9ede6bf14 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:46:39 -0400
Subject: [PATCH 3/4] linux6.7: update to 6.7.11, backport fix for kexec
 regression

---
 srcpkgs/linux6.7/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.7/template                     |  4 +-
 2 files changed, 77 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux6.7/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.7/patches/revert-gbpages.patch b/srcpkgs/linux6.7/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.7/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.7/template b/srcpkgs/linux6.7/template
index b49cb06112d271..cae1c268cb59bb 100644
--- a/srcpkgs/linux6.7/template
+++ b/srcpkgs/linux6.7/template
@@ -1,6 +1,6 @@
 # Template file for 'linux6.7'
 pkgname=linux6.7
-version=6.7.10
+version=6.7.11
 revision=1
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
@@ -14,7 +14,7 @@ if [ "${version##*.}" != 0 ]; then
 fi
 
 checksum="ef31144a2576d080d8c31698e83ec9f66bf97c677fa2aaf0d5bbb9f3345b1069
- ad29958911035980290078c708a0a144943484a2f8c2ac408c040a81500393aa"
+ a3a0c4b0633b1ac22bfe73bf078e18bb2f17208f0c28c8539010df3a2d2bb760"
 python_version=3
 
 # XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.

From 630f4b553a0c8349cc13d4145c82b7d7d6190a53 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:47:20 -0400
Subject: [PATCH 4/4] linux6.8: update to 6.8.2, backport fix for kexec
 regression

---
 srcpkgs/linux6.8/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.8/template                     |  4 +-
 2 files changed, 77 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux6.8/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.8/patches/revert-gbpages.patch b/srcpkgs/linux6.8/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.8/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.8/template b/srcpkgs/linux6.8/template
index 39857b710777c2..a0365a618bd173 100644
--- a/srcpkgs/linux6.8/template
+++ b/srcpkgs/linux6.8/template
@@ -1,6 +1,6 @@
 # Template file for 'linux6.8'
 pkgname=linux6.8
-version=6.8.1
+version=6.8.2
 revision=1
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
@@ -14,7 +14,7 @@ if [ "${version##*.}" != 0 ]; then
 fi
 
 checksum="c969dea4e8bb6be991bbf7c010ba0e0a5643a3a8d8fb0a2aaa053406f1e965f3
- dfdfbf3045be48db3b99038a72eb2e6906a31dc11672230b4f45597de2e8cf11"
+ 1d190147d8eee0313f0ea1e565070fc4f88db9c20e9d85dc0c6b9ad62a69b3fa"
 python_version=3
 
 # XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: linux6.x: backport fix for kexec regression
  2024-03-25 18:00 [PR PATCH] linux6.x: backport fix for kexec regression ahesford
                   ` (3 preceding siblings ...)
  2024-03-27 14:14 ` [PR PATCH] [Updated] " ahesford
@ 2024-03-27 14:15 ` ahesford
  2024-03-27 14:39 ` [PR PATCH] [Updated] " ahesford
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ahesford @ 2024-03-27 14:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 239 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/49529#issuecomment-2022882654

Comment:
Bumped all kernels, currently testing builds on all of them to make sure there are no surprises.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] linux6.x: backport fix for kexec regression
  2024-03-25 18:00 [PR PATCH] linux6.x: backport fix for kexec regression ahesford
                   ` (4 preceding siblings ...)
  2024-03-27 14:15 ` ahesford
@ 2024-03-27 14:39 ` ahesford
  2024-03-27 14:40 ` ahesford
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ahesford @ 2024-03-27 14:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1508 bytes --]

There is an updated pull request by ahesford against master on the void-packages repository

https://github.com/ahesford/void-packages kexec-regression
https://github.com/void-linux/void-packages/pull/49529

linux6.x: backport fix for kexec regression
All of our `linux6.x` kernel series include a change that breaks `kexec` on certain hardware, notably AMD CPUs using various iterations of the Zen microarchitecture. I can reproduce the issue on my Zen 3 CPU, while [other reports](https://github.com/zbm-dev/zfsbootmenu/discussions/598) reveal that this problem affects ZFSBootMenu users on other iterations. I bisected the problem and confirmed that it is caused by the same commit that [seems to impact users more generally](https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/). Consequently, the current upstream fix is to [just revert the change](https://lore.kernel.org/linux-kernel/8142c0de-e3a4-4e78-aa1b-f5e6503752e4@intel.com/T/#m674760504b865936068602efca9a10fb72e7102e).

While I was backporting the reversion, I took the liberty of updating `linux6.1` as well.

I'm in the process of building and testing kernels with these patches to confirm that it fixes the ZFSBootMenu problem I observed and, assuming so, plan to bump our kernels to include the fix.

cc: @sgn @Duncaen 

[ci skip]

#### Testing the changes
- I tested the changes in this PR: **in process**

A patch file from https://github.com/void-linux/void-packages/pull/49529.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-kexec-regression-49529.patch --]
[-- Type: text/x-diff, Size: 18675 bytes --]

From 1ad6125e7173749d4cddb9a52caac9e4c752e975 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:23:01 -0400
Subject: [PATCH 1/4] linux6.1: update to 6.1.83, backport fix for kexec
 regression

---
 srcpkgs/linux6.1/files/arm64-dotconfig        |  1 +
 srcpkgs/linux6.1/files/i386-dotconfig         |  3 +
 srcpkgs/linux6.1/files/x86_64-dotconfig       |  4 +
 srcpkgs/linux6.1/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.1/template                     |  4 +-
 5 files changed, 85 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux6.1/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.1/files/arm64-dotconfig b/srcpkgs/linux6.1/files/arm64-dotconfig
index 397682edc608b4..8906c3c9f130a7 100644
--- a/srcpkgs/linux6.1/files/arm64-dotconfig
+++ b/srcpkgs/linux6.1/files/arm64-dotconfig
@@ -11626,6 +11626,7 @@ CONFIG_NFS_DISABLE_UDP_SUPPORT=y
 # CONFIG_NFS_V4_2_READ_PLUS is not set
 CONFIG_NFSD=m
 CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V2=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
 CONFIG_NFSD_PNFS=y
diff --git a/srcpkgs/linux6.1/files/i386-dotconfig b/srcpkgs/linux6.1/files/i386-dotconfig
index 55b828bcd6f809..d68950e89816b1 100644
--- a/srcpkgs/linux6.1/files/i386-dotconfig
+++ b/srcpkgs/linux6.1/files/i386-dotconfig
@@ -459,6 +459,7 @@ CONFIG_X86_INTEL_TSX_MODE_OFF=y
 # CONFIG_X86_INTEL_TSX_MODE_AUTO is not set
 CONFIG_EFI=y
 CONFIG_EFI_STUB=y
+CONFIG_EFI_HANDOVER_PROTOCOL=y
 # CONFIG_HZ_100 is not set
 # CONFIG_HZ_250 is not set
 # CONFIG_HZ_300 is not set
@@ -489,6 +490,7 @@ CONFIG_PAGE_TABLE_ISOLATION=y
 CONFIG_RETPOLINE=y
 CONFIG_RETHUNK=y
 # CONFIG_GDS_FORCE_MITIGATION is not set
+CONFIG_MITIGATION_RFDS=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
 #
@@ -9815,6 +9817,7 @@ CONFIG_NFS_DISABLE_UDP_SUPPORT=y
 # CONFIG_NFS_V4_2_READ_PLUS is not set
 CONFIG_NFSD=m
 CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V2=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
 CONFIG_NFSD_PNFS=y
diff --git a/srcpkgs/linux6.1/files/x86_64-dotconfig b/srcpkgs/linux6.1/files/x86_64-dotconfig
index af91e23d8700a1..087f28ac707f59 100644
--- a/srcpkgs/linux6.1/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.1/files/x86_64-dotconfig
@@ -473,6 +473,7 @@ CONFIG_X86_INTEL_TSX_MODE_OFF=y
 # CONFIG_X86_SGX is not set
 CONFIG_EFI=y
 CONFIG_EFI_STUB=y
+CONFIG_EFI_HANDOVER_PROTOCOL=y
 CONFIG_EFI_MIXED=y
 # CONFIG_HZ_100 is not set
 # CONFIG_HZ_250 is not set
@@ -516,6 +517,7 @@ CONFIG_CPU_IBRS_ENTRY=y
 CONFIG_CPU_SRSO=y
 CONFIG_SLS=y
 # CONFIG_GDS_FORCE_MITIGATION is not set
+CONFIG_MITIGATION_RFDS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -8885,6 +8887,7 @@ CONFIG_INTEL_IOMMU_SVM=y
 CONFIG_INTEL_IOMMU_DEFAULT_ON=y
 CONFIG_INTEL_IOMMU_FLOPPY_WA=y
 # CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON is not set
+CONFIG_INTEL_IOMMU_PERF_EVENTS=y
 CONFIG_IRQ_REMAP=y
 CONFIG_HYPERV_IOMMU=y
 CONFIG_VIRTIO_IOMMU=m
@@ -10062,6 +10065,7 @@ CONFIG_NFS_USE_KERNEL_DNS=y
 CONFIG_NFS_DISABLE_UDP_SUPPORT=y
 # CONFIG_NFS_V4_2_READ_PLUS is not set
 CONFIG_NFSD=m
+CONFIG_NFSD_V2=y
 CONFIG_NFSD_V2_ACL=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
diff --git a/srcpkgs/linux6.1/patches/revert-gbpages.patch b/srcpkgs/linux6.1/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.1/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.1/template b/srcpkgs/linux6.1/template
index 5362648ff88173..c5ec1fb85ab20c 100644
--- a/srcpkgs/linux6.1/template
+++ b/srcpkgs/linux6.1/template
@@ -1,6 +1,6 @@
 # Template file for 'linux6.1'
 pkgname=linux6.1
-version=6.1.79
+version=6.1.83
 revision=1
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
@@ -14,7 +14,7 @@ if [ "${version##*.}" != 0 ]; then
 fi
 
 checksum="2ca1f17051a430f6fed1196e4952717507171acfd97d96577212502703b25deb
- 2a5ffcf13896415ef220fbc025aed7b3065525974b2dbcc04a1f71dbee7c2e3a"
+ 9268c5f79c00caf77e4be77795e26be36862eb60fd0d78a2f6bc5baeac84dd82"
 python_version=3
 
 # XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.

From f28829b560965a474159a7d4e85610eda6c5debe Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:46:09 -0400
Subject: [PATCH 2/4] linux6.6: update to 6.6.23, backport fix for kexec
 regression

---
 srcpkgs/linux6.6/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.6/template                     |  4 +-
 2 files changed, 77 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux6.6/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.6/patches/revert-gbpages.patch b/srcpkgs/linux6.6/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.6/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.6/template b/srcpkgs/linux6.6/template
index 174016326fd16d..d9ec2912b61dfe 100644
--- a/srcpkgs/linux6.6/template
+++ b/srcpkgs/linux6.6/template
@@ -1,6 +1,6 @@
 # Template file for 'linux6.6'
 pkgname=linux6.6
-version=6.6.22
+version=6.6.23
 revision=1
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
@@ -14,7 +14,7 @@ if [ "${version##*.}" != 0 ]; then
 fi
 
 checksum="d926a06c63dd8ac7df3f86ee1ffc2ce2a3b81a2d168484e76b5b389aba8e56d0
- a8a5380de3206b2aeed4cb0425e319655c2df0babbfb1cb2a4fdd7e8dbcc3c29"
+ a40130b4f55fb0b5e2c968a39a0bfa44e76b0110e62139d5fa82c02422ef31c9"
 python_version=3
 
 # XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.

From f836ea5a117573f36c9983f9a1e18d0b316e96f7 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:46:39 -0400
Subject: [PATCH 3/4] linux6.7: update to 6.7.11, backport fix for kexec
 regression

---
 srcpkgs/linux6.7/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.7/template                     |  4 +-
 2 files changed, 77 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux6.7/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.7/patches/revert-gbpages.patch b/srcpkgs/linux6.7/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.7/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.7/template b/srcpkgs/linux6.7/template
index b49cb06112d271..cae1c268cb59bb 100644
--- a/srcpkgs/linux6.7/template
+++ b/srcpkgs/linux6.7/template
@@ -1,6 +1,6 @@
 # Template file for 'linux6.7'
 pkgname=linux6.7
-version=6.7.10
+version=6.7.11
 revision=1
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
@@ -14,7 +14,7 @@ if [ "${version##*.}" != 0 ]; then
 fi
 
 checksum="ef31144a2576d080d8c31698e83ec9f66bf97c677fa2aaf0d5bbb9f3345b1069
- ad29958911035980290078c708a0a144943484a2f8c2ac408c040a81500393aa"
+ a3a0c4b0633b1ac22bfe73bf078e18bb2f17208f0c28c8539010df3a2d2bb760"
 python_version=3
 
 # XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.

From 707dd2517852a91eff88610eae08ee0c356d7d18 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:47:20 -0400
Subject: [PATCH 4/4] linux6.8: update to 6.8.2, backport fix for kexec
 regression

---
 srcpkgs/linux6.8/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.8/template                     |  4 +-
 2 files changed, 77 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux6.8/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.8/patches/revert-gbpages.patch b/srcpkgs/linux6.8/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.8/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.8/template b/srcpkgs/linux6.8/template
index 39857b710777c2..a0365a618bd173 100644
--- a/srcpkgs/linux6.8/template
+++ b/srcpkgs/linux6.8/template
@@ -1,6 +1,6 @@
 # Template file for 'linux6.8'
 pkgname=linux6.8
-version=6.8.1
+version=6.8.2
 revision=1
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
@@ -14,7 +14,7 @@ if [ "${version##*.}" != 0 ]; then
 fi
 
 checksum="c969dea4e8bb6be991bbf7c010ba0e0a5643a3a8d8fb0a2aaa053406f1e965f3
- dfdfbf3045be48db3b99038a72eb2e6906a31dc11672230b4f45597de2e8cf11"
+ 1d190147d8eee0313f0ea1e565070fc4f88db9c20e9d85dc0c6b9ad62a69b3fa"
 python_version=3
 
 # XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: linux6.x: backport fix for kexec regression
  2024-03-25 18:00 [PR PATCH] linux6.x: backport fix for kexec regression ahesford
                   ` (5 preceding siblings ...)
  2024-03-27 14:39 ` [PR PATCH] [Updated] " ahesford
@ 2024-03-27 14:40 ` ahesford
  2024-03-27 18:05 ` [PR PATCH] [Updated] " ahesford
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ahesford @ 2024-03-27 14:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 238 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/49529#issuecomment-2022944597

Comment:
Currently all kernels fail to build on musl: https://bugzilla.kernel.org/show_bug.cgi?id=218647

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] linux6.x: backport fix for kexec regression
  2024-03-25 18:00 [PR PATCH] linux6.x: backport fix for kexec regression ahesford
                   ` (6 preceding siblings ...)
  2024-03-27 14:40 ` ahesford
@ 2024-03-27 18:05 ` ahesford
  2024-03-28 13:56 ` ahesford
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ahesford @ 2024-03-27 18:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1508 bytes --]

There is an updated pull request by ahesford against master on the void-packages repository

https://github.com/ahesford/void-packages kexec-regression
https://github.com/void-linux/void-packages/pull/49529

linux6.x: backport fix for kexec regression
All of our `linux6.x` kernel series include a change that breaks `kexec` on certain hardware, notably AMD CPUs using various iterations of the Zen microarchitecture. I can reproduce the issue on my Zen 3 CPU, while [other reports](https://github.com/zbm-dev/zfsbootmenu/discussions/598) reveal that this problem affects ZFSBootMenu users on other iterations. I bisected the problem and confirmed that it is caused by the same commit that [seems to impact users more generally](https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/). Consequently, the current upstream fix is to [just revert the change](https://lore.kernel.org/linux-kernel/8142c0de-e3a4-4e78-aa1b-f5e6503752e4@intel.com/T/#m674760504b865936068602efca9a10fb72e7102e).

While I was backporting the reversion, I took the liberty of updating `linux6.1` as well.

I'm in the process of building and testing kernels with these patches to confirm that it fixes the ZFSBootMenu problem I observed and, assuming so, plan to bump our kernels to include the fix.

cc: @sgn @Duncaen 

[ci skip]

#### Testing the changes
- I tested the changes in this PR: **in process**

A patch file from https://github.com/void-linux/void-packages/pull/49529.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-kexec-regression-49529.patch --]
[-- Type: text/x-diff, Size: 18932 bytes --]

From 3a186dcbfd1fbe4d105d3326af2f1f4e573307c2 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:23:01 -0400
Subject: [PATCH 1/4] linux6.1: update to 6.1.83, backport fix for kexec
 regression

---
 srcpkgs/linux6.1/files/arm64-dotconfig        |  1 +
 srcpkgs/linux6.1/files/i386-dotconfig         |  4 +
 srcpkgs/linux6.1/files/x86_64-dotconfig       |  4 +
 srcpkgs/linux6.1/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.1/template                     |  4 +-
 5 files changed, 86 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux6.1/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.1/files/arm64-dotconfig b/srcpkgs/linux6.1/files/arm64-dotconfig
index 397682edc608b4..8906c3c9f130a7 100644
--- a/srcpkgs/linux6.1/files/arm64-dotconfig
+++ b/srcpkgs/linux6.1/files/arm64-dotconfig
@@ -11626,6 +11626,7 @@ CONFIG_NFS_DISABLE_UDP_SUPPORT=y
 # CONFIG_NFS_V4_2_READ_PLUS is not set
 CONFIG_NFSD=m
 CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V2=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
 CONFIG_NFSD_PNFS=y
diff --git a/srcpkgs/linux6.1/files/i386-dotconfig b/srcpkgs/linux6.1/files/i386-dotconfig
index 55b828bcd6f809..d9c3fd6f3ebad5 100644
--- a/srcpkgs/linux6.1/files/i386-dotconfig
+++ b/srcpkgs/linux6.1/files/i386-dotconfig
@@ -459,6 +459,7 @@ CONFIG_X86_INTEL_TSX_MODE_OFF=y
 # CONFIG_X86_INTEL_TSX_MODE_AUTO is not set
 CONFIG_EFI=y
 CONFIG_EFI_STUB=y
+CONFIG_EFI_HANDOVER_PROTOCOL=y
 # CONFIG_HZ_100 is not set
 # CONFIG_HZ_250 is not set
 # CONFIG_HZ_300 is not set
@@ -489,6 +490,7 @@ CONFIG_PAGE_TABLE_ISOLATION=y
 CONFIG_RETPOLINE=y
 CONFIG_RETHUNK=y
 # CONFIG_GDS_FORCE_MITIGATION is not set
+CONFIG_MITIGATION_RFDS=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
 #
@@ -8667,6 +8669,7 @@ CONFIG_INTEL_IOMMU=y
 CONFIG_INTEL_IOMMU_DEFAULT_ON=y
 CONFIG_INTEL_IOMMU_FLOPPY_WA=y
 # CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON is not set
+CONFIG_INTEL_IOMMU_PERF_EVENTS=y
 CONFIG_HYPERV_IOMMU=y
 CONFIG_VIRTIO_IOMMU=m
 
@@ -9814,6 +9817,7 @@ CONFIG_NFS_USE_KERNEL_DNS=y
 CONFIG_NFS_DISABLE_UDP_SUPPORT=y
 # CONFIG_NFS_V4_2_READ_PLUS is not set
 CONFIG_NFSD=m
+CONFIG_NFSD_V2=y
 CONFIG_NFSD_V2_ACL=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
diff --git a/srcpkgs/linux6.1/files/x86_64-dotconfig b/srcpkgs/linux6.1/files/x86_64-dotconfig
index af91e23d8700a1..087f28ac707f59 100644
--- a/srcpkgs/linux6.1/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.1/files/x86_64-dotconfig
@@ -473,6 +473,7 @@ CONFIG_X86_INTEL_TSX_MODE_OFF=y
 # CONFIG_X86_SGX is not set
 CONFIG_EFI=y
 CONFIG_EFI_STUB=y
+CONFIG_EFI_HANDOVER_PROTOCOL=y
 CONFIG_EFI_MIXED=y
 # CONFIG_HZ_100 is not set
 # CONFIG_HZ_250 is not set
@@ -516,6 +517,7 @@ CONFIG_CPU_IBRS_ENTRY=y
 CONFIG_CPU_SRSO=y
 CONFIG_SLS=y
 # CONFIG_GDS_FORCE_MITIGATION is not set
+CONFIG_MITIGATION_RFDS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -8885,6 +8887,7 @@ CONFIG_INTEL_IOMMU_SVM=y
 CONFIG_INTEL_IOMMU_DEFAULT_ON=y
 CONFIG_INTEL_IOMMU_FLOPPY_WA=y
 # CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON is not set
+CONFIG_INTEL_IOMMU_PERF_EVENTS=y
 CONFIG_IRQ_REMAP=y
 CONFIG_HYPERV_IOMMU=y
 CONFIG_VIRTIO_IOMMU=m
@@ -10062,6 +10065,7 @@ CONFIG_NFS_USE_KERNEL_DNS=y
 CONFIG_NFS_DISABLE_UDP_SUPPORT=y
 # CONFIG_NFS_V4_2_READ_PLUS is not set
 CONFIG_NFSD=m
+CONFIG_NFSD_V2=y
 CONFIG_NFSD_V2_ACL=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
diff --git a/srcpkgs/linux6.1/patches/revert-gbpages.patch b/srcpkgs/linux6.1/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.1/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.1/template b/srcpkgs/linux6.1/template
index 5362648ff88173..c5ec1fb85ab20c 100644
--- a/srcpkgs/linux6.1/template
+++ b/srcpkgs/linux6.1/template
@@ -1,6 +1,6 @@
 # Template file for 'linux6.1'
 pkgname=linux6.1
-version=6.1.79
+version=6.1.83
 revision=1
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
@@ -14,7 +14,7 @@ if [ "${version##*.}" != 0 ]; then
 fi
 
 checksum="2ca1f17051a430f6fed1196e4952717507171acfd97d96577212502703b25deb
- 2a5ffcf13896415ef220fbc025aed7b3065525974b2dbcc04a1f71dbee7c2e3a"
+ 9268c5f79c00caf77e4be77795e26be36862eb60fd0d78a2f6bc5baeac84dd82"
 python_version=3
 
 # XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.

From 2c9ec7aed862d526d3afdec593b484abc0344333 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:46:09 -0400
Subject: [PATCH 2/4] linux6.6: update to 6.6.23, backport fix for kexec
 regression

---
 srcpkgs/linux6.6/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.6/template                     |  4 +-
 2 files changed, 77 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux6.6/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.6/patches/revert-gbpages.patch b/srcpkgs/linux6.6/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.6/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.6/template b/srcpkgs/linux6.6/template
index 174016326fd16d..d9ec2912b61dfe 100644
--- a/srcpkgs/linux6.6/template
+++ b/srcpkgs/linux6.6/template
@@ -1,6 +1,6 @@
 # Template file for 'linux6.6'
 pkgname=linux6.6
-version=6.6.22
+version=6.6.23
 revision=1
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
@@ -14,7 +14,7 @@ if [ "${version##*.}" != 0 ]; then
 fi
 
 checksum="d926a06c63dd8ac7df3f86ee1ffc2ce2a3b81a2d168484e76b5b389aba8e56d0
- a8a5380de3206b2aeed4cb0425e319655c2df0babbfb1cb2a4fdd7e8dbcc3c29"
+ a40130b4f55fb0b5e2c968a39a0bfa44e76b0110e62139d5fa82c02422ef31c9"
 python_version=3
 
 # XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.

From 2da643eb4e14bc5476f8ff93ce999294223da817 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:46:39 -0400
Subject: [PATCH 3/4] linux6.7: update to 6.7.11, backport fix for kexec
 regression

---
 srcpkgs/linux6.7/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.7/template                     |  4 +-
 2 files changed, 77 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux6.7/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.7/patches/revert-gbpages.patch b/srcpkgs/linux6.7/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.7/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.7/template b/srcpkgs/linux6.7/template
index b49cb06112d271..cae1c268cb59bb 100644
--- a/srcpkgs/linux6.7/template
+++ b/srcpkgs/linux6.7/template
@@ -1,6 +1,6 @@
 # Template file for 'linux6.7'
 pkgname=linux6.7
-version=6.7.10
+version=6.7.11
 revision=1
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
@@ -14,7 +14,7 @@ if [ "${version##*.}" != 0 ]; then
 fi
 
 checksum="ef31144a2576d080d8c31698e83ec9f66bf97c677fa2aaf0d5bbb9f3345b1069
- ad29958911035980290078c708a0a144943484a2f8c2ac408c040a81500393aa"
+ a3a0c4b0633b1ac22bfe73bf078e18bb2f17208f0c28c8539010df3a2d2bb760"
 python_version=3
 
 # XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.

From 584ba64031b62653e29e6d92cde0fd35545231f2 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:47:20 -0400
Subject: [PATCH 4/4] linux6.8: update to 6.8.2, backport fix for kexec
 regression

---
 srcpkgs/linux6.8/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.8/template                     |  4 +-
 2 files changed, 77 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux6.8/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.8/patches/revert-gbpages.patch b/srcpkgs/linux6.8/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.8/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.8/template b/srcpkgs/linux6.8/template
index 39857b710777c2..a0365a618bd173 100644
--- a/srcpkgs/linux6.8/template
+++ b/srcpkgs/linux6.8/template
@@ -1,6 +1,6 @@
 # Template file for 'linux6.8'
 pkgname=linux6.8
-version=6.8.1
+version=6.8.2
 revision=1
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
@@ -14,7 +14,7 @@ if [ "${version##*.}" != 0 ]; then
 fi
 
 checksum="c969dea4e8bb6be991bbf7c010ba0e0a5643a3a8d8fb0a2aaa053406f1e965f3
- dfdfbf3045be48db3b99038a72eb2e6906a31dc11672230b4f45597de2e8cf11"
+ 1d190147d8eee0313f0ea1e565070fc4f88db9c20e9d85dc0c6b9ad62a69b3fa"
 python_version=3
 
 # XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] linux6.x: backport fix for kexec regression
  2024-03-25 18:00 [PR PATCH] linux6.x: backport fix for kexec regression ahesford
                   ` (7 preceding siblings ...)
  2024-03-27 18:05 ` [PR PATCH] [Updated] " ahesford
@ 2024-03-28 13:56 ` ahesford
  2024-03-28 13:57 ` ahesford
  2024-03-28 23:12 ` [PR PATCH] [Merged]: " sgn
  10 siblings, 0 replies; 12+ messages in thread
From: ahesford @ 2024-03-28 13:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1508 bytes --]

There is an updated pull request by ahesford against master on the void-packages repository

https://github.com/ahesford/void-packages kexec-regression
https://github.com/void-linux/void-packages/pull/49529

linux6.x: backport fix for kexec regression
All of our `linux6.x` kernel series include a change that breaks `kexec` on certain hardware, notably AMD CPUs using various iterations of the Zen microarchitecture. I can reproduce the issue on my Zen 3 CPU, while [other reports](https://github.com/zbm-dev/zfsbootmenu/discussions/598) reveal that this problem affects ZFSBootMenu users on other iterations. I bisected the problem and confirmed that it is caused by the same commit that [seems to impact users more generally](https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/). Consequently, the current upstream fix is to [just revert the change](https://lore.kernel.org/linux-kernel/8142c0de-e3a4-4e78-aa1b-f5e6503752e4@intel.com/T/#m674760504b865936068602efca9a10fb72e7102e).

While I was backporting the reversion, I took the liberty of updating `linux6.1` as well.

I'm in the process of building and testing kernels with these patches to confirm that it fixes the ZFSBootMenu problem I observed and, assuming so, plan to bump our kernels to include the fix.

cc: @sgn @Duncaen 

[ci skip]

#### Testing the changes
- I tested the changes in this PR: **in process**

A patch file from https://github.com/void-linux/void-packages/pull/49529.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-kexec-regression-49529.patch --]
[-- Type: text/x-diff, Size: 22141 bytes --]

From e92fbf2bb9003f3d93d3e5ef2ae780ebc86c3504 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:23:01 -0400
Subject: [PATCH 1/4] linux6.1: update to 6.1.83, backport fix for kexec
 regression

---
 srcpkgs/linux6.1/files/arm64-dotconfig        |  1 +
 srcpkgs/linux6.1/files/i386-dotconfig         |  4 +
 srcpkgs/linux6.1/files/x86_64-dotconfig       |  4 +
 .../linux6.1/patches/fix-musl-btf-ids.patch   | 15 ++++
 srcpkgs/linux6.1/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.1/template                     |  4 +-
 6 files changed, 101 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux6.1/patches/fix-musl-btf-ids.patch
 create mode 100644 srcpkgs/linux6.1/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.1/files/arm64-dotconfig b/srcpkgs/linux6.1/files/arm64-dotconfig
index 397682edc608b4..8906c3c9f130a7 100644
--- a/srcpkgs/linux6.1/files/arm64-dotconfig
+++ b/srcpkgs/linux6.1/files/arm64-dotconfig
@@ -11626,6 +11626,7 @@ CONFIG_NFS_DISABLE_UDP_SUPPORT=y
 # CONFIG_NFS_V4_2_READ_PLUS is not set
 CONFIG_NFSD=m
 CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V2=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
 CONFIG_NFSD_PNFS=y
diff --git a/srcpkgs/linux6.1/files/i386-dotconfig b/srcpkgs/linux6.1/files/i386-dotconfig
index 55b828bcd6f809..d9c3fd6f3ebad5 100644
--- a/srcpkgs/linux6.1/files/i386-dotconfig
+++ b/srcpkgs/linux6.1/files/i386-dotconfig
@@ -459,6 +459,7 @@ CONFIG_X86_INTEL_TSX_MODE_OFF=y
 # CONFIG_X86_INTEL_TSX_MODE_AUTO is not set
 CONFIG_EFI=y
 CONFIG_EFI_STUB=y
+CONFIG_EFI_HANDOVER_PROTOCOL=y
 # CONFIG_HZ_100 is not set
 # CONFIG_HZ_250 is not set
 # CONFIG_HZ_300 is not set
@@ -489,6 +490,7 @@ CONFIG_PAGE_TABLE_ISOLATION=y
 CONFIG_RETPOLINE=y
 CONFIG_RETHUNK=y
 # CONFIG_GDS_FORCE_MITIGATION is not set
+CONFIG_MITIGATION_RFDS=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
 #
@@ -8667,6 +8669,7 @@ CONFIG_INTEL_IOMMU=y
 CONFIG_INTEL_IOMMU_DEFAULT_ON=y
 CONFIG_INTEL_IOMMU_FLOPPY_WA=y
 # CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON is not set
+CONFIG_INTEL_IOMMU_PERF_EVENTS=y
 CONFIG_HYPERV_IOMMU=y
 CONFIG_VIRTIO_IOMMU=m
 
@@ -9814,6 +9817,7 @@ CONFIG_NFS_USE_KERNEL_DNS=y
 CONFIG_NFS_DISABLE_UDP_SUPPORT=y
 # CONFIG_NFS_V4_2_READ_PLUS is not set
 CONFIG_NFSD=m
+CONFIG_NFSD_V2=y
 CONFIG_NFSD_V2_ACL=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
diff --git a/srcpkgs/linux6.1/files/x86_64-dotconfig b/srcpkgs/linux6.1/files/x86_64-dotconfig
index af91e23d8700a1..087f28ac707f59 100644
--- a/srcpkgs/linux6.1/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.1/files/x86_64-dotconfig
@@ -473,6 +473,7 @@ CONFIG_X86_INTEL_TSX_MODE_OFF=y
 # CONFIG_X86_SGX is not set
 CONFIG_EFI=y
 CONFIG_EFI_STUB=y
+CONFIG_EFI_HANDOVER_PROTOCOL=y
 CONFIG_EFI_MIXED=y
 # CONFIG_HZ_100 is not set
 # CONFIG_HZ_250 is not set
@@ -516,6 +517,7 @@ CONFIG_CPU_IBRS_ENTRY=y
 CONFIG_CPU_SRSO=y
 CONFIG_SLS=y
 # CONFIG_GDS_FORCE_MITIGATION is not set
+CONFIG_MITIGATION_RFDS=y
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -8885,6 +8887,7 @@ CONFIG_INTEL_IOMMU_SVM=y
 CONFIG_INTEL_IOMMU_DEFAULT_ON=y
 CONFIG_INTEL_IOMMU_FLOPPY_WA=y
 # CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON is not set
+CONFIG_INTEL_IOMMU_PERF_EVENTS=y
 CONFIG_IRQ_REMAP=y
 CONFIG_HYPERV_IOMMU=y
 CONFIG_VIRTIO_IOMMU=m
@@ -10062,6 +10065,7 @@ CONFIG_NFS_USE_KERNEL_DNS=y
 CONFIG_NFS_DISABLE_UDP_SUPPORT=y
 # CONFIG_NFS_V4_2_READ_PLUS is not set
 CONFIG_NFSD=m
+CONFIG_NFSD_V2=y
 CONFIG_NFSD_V2_ACL=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
diff --git a/srcpkgs/linux6.1/patches/fix-musl-btf-ids.patch b/srcpkgs/linux6.1/patches/fix-musl-btf-ids.patch
new file mode 100644
index 00000000000000..bec96095197c45
--- /dev/null
+++ b/srcpkgs/linux6.1/patches/fix-musl-btf-ids.patch
@@ -0,0 +1,15 @@
+https://bugzilla.kernel.org/show_bug.cgi?id=218647
+
+diff --git a/tools/include/linux/btf_ids.h b/tools/include/linux/btf_ids.h
+index 72535f00572f..72ea363d434d 100644
+--- a/tools/include/linux/btf_ids.h
++++ b/tools/include/linux/btf_ids.h
+@@ -3,6 +3,8 @@
+ #ifndef _LINUX_BTF_IDS_H
+ #define _LINUX_BTF_IDS_H
+ 
++#include <linux/types.h> /* for u32 */
++
+ struct btf_id_set {
+        u32 cnt;
+        u32 ids[];
diff --git a/srcpkgs/linux6.1/patches/revert-gbpages.patch b/srcpkgs/linux6.1/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.1/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.1/template b/srcpkgs/linux6.1/template
index 5362648ff88173..c5ec1fb85ab20c 100644
--- a/srcpkgs/linux6.1/template
+++ b/srcpkgs/linux6.1/template
@@ -1,6 +1,6 @@
 # Template file for 'linux6.1'
 pkgname=linux6.1
-version=6.1.79
+version=6.1.83
 revision=1
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
@@ -14,7 +14,7 @@ if [ "${version##*.}" != 0 ]; then
 fi
 
 checksum="2ca1f17051a430f6fed1196e4952717507171acfd97d96577212502703b25deb
- 2a5ffcf13896415ef220fbc025aed7b3065525974b2dbcc04a1f71dbee7c2e3a"
+ 9268c5f79c00caf77e4be77795e26be36862eb60fd0d78a2f6bc5baeac84dd82"
 python_version=3
 
 # XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.

From 0345bb070574443aefa6c8726c674cdddf4c832c Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:46:09 -0400
Subject: [PATCH 2/4] linux6.6: update to 6.6.23, backport fix for kexec
 regression

---
 .../linux6.6/patches/fix-musl-btf-ids.patch   | 15 ++++
 srcpkgs/linux6.6/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.6/template                     |  4 +-
 3 files changed, 92 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux6.6/patches/fix-musl-btf-ids.patch
 create mode 100644 srcpkgs/linux6.6/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.6/patches/fix-musl-btf-ids.patch b/srcpkgs/linux6.6/patches/fix-musl-btf-ids.patch
new file mode 100644
index 00000000000000..bec96095197c45
--- /dev/null
+++ b/srcpkgs/linux6.6/patches/fix-musl-btf-ids.patch
@@ -0,0 +1,15 @@
+https://bugzilla.kernel.org/show_bug.cgi?id=218647
+
+diff --git a/tools/include/linux/btf_ids.h b/tools/include/linux/btf_ids.h
+index 72535f00572f..72ea363d434d 100644
+--- a/tools/include/linux/btf_ids.h
++++ b/tools/include/linux/btf_ids.h
+@@ -3,6 +3,8 @@
+ #ifndef _LINUX_BTF_IDS_H
+ #define _LINUX_BTF_IDS_H
+ 
++#include <linux/types.h> /* for u32 */
++
+ struct btf_id_set {
+        u32 cnt;
+        u32 ids[];
diff --git a/srcpkgs/linux6.6/patches/revert-gbpages.patch b/srcpkgs/linux6.6/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.6/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.6/template b/srcpkgs/linux6.6/template
index 174016326fd16d..d9ec2912b61dfe 100644
--- a/srcpkgs/linux6.6/template
+++ b/srcpkgs/linux6.6/template
@@ -1,6 +1,6 @@
 # Template file for 'linux6.6'
 pkgname=linux6.6
-version=6.6.22
+version=6.6.23
 revision=1
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
@@ -14,7 +14,7 @@ if [ "${version##*.}" != 0 ]; then
 fi
 
 checksum="d926a06c63dd8ac7df3f86ee1ffc2ce2a3b81a2d168484e76b5b389aba8e56d0
- a8a5380de3206b2aeed4cb0425e319655c2df0babbfb1cb2a4fdd7e8dbcc3c29"
+ a40130b4f55fb0b5e2c968a39a0bfa44e76b0110e62139d5fa82c02422ef31c9"
 python_version=3
 
 # XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.

From cefebba1d00497141eaec72ba789cb9793d2b102 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:46:39 -0400
Subject: [PATCH 3/4] linux6.7: update to 6.7.11, backport fix for kexec
 regression

---
 .../linux6.7/patches/fix-musl-btf-ids.patch   | 15 ++++
 srcpkgs/linux6.7/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.7/template                     |  4 +-
 3 files changed, 92 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux6.7/patches/fix-musl-btf-ids.patch
 create mode 100644 srcpkgs/linux6.7/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.7/patches/fix-musl-btf-ids.patch b/srcpkgs/linux6.7/patches/fix-musl-btf-ids.patch
new file mode 100644
index 00000000000000..bec96095197c45
--- /dev/null
+++ b/srcpkgs/linux6.7/patches/fix-musl-btf-ids.patch
@@ -0,0 +1,15 @@
+https://bugzilla.kernel.org/show_bug.cgi?id=218647
+
+diff --git a/tools/include/linux/btf_ids.h b/tools/include/linux/btf_ids.h
+index 72535f00572f..72ea363d434d 100644
+--- a/tools/include/linux/btf_ids.h
++++ b/tools/include/linux/btf_ids.h
+@@ -3,6 +3,8 @@
+ #ifndef _LINUX_BTF_IDS_H
+ #define _LINUX_BTF_IDS_H
+ 
++#include <linux/types.h> /* for u32 */
++
+ struct btf_id_set {
+        u32 cnt;
+        u32 ids[];
diff --git a/srcpkgs/linux6.7/patches/revert-gbpages.patch b/srcpkgs/linux6.7/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.7/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.7/template b/srcpkgs/linux6.7/template
index b49cb06112d271..cae1c268cb59bb 100644
--- a/srcpkgs/linux6.7/template
+++ b/srcpkgs/linux6.7/template
@@ -1,6 +1,6 @@
 # Template file for 'linux6.7'
 pkgname=linux6.7
-version=6.7.10
+version=6.7.11
 revision=1
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
@@ -14,7 +14,7 @@ if [ "${version##*.}" != 0 ]; then
 fi
 
 checksum="ef31144a2576d080d8c31698e83ec9f66bf97c677fa2aaf0d5bbb9f3345b1069
- ad29958911035980290078c708a0a144943484a2f8c2ac408c040a81500393aa"
+ a3a0c4b0633b1ac22bfe73bf078e18bb2f17208f0c28c8539010df3a2d2bb760"
 python_version=3
 
 # XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.

From 168c1196fefa402916450c8de9911c437ba22706 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 25 Mar 2024 13:47:20 -0400
Subject: [PATCH 4/4] linux6.8: update to 6.8.2, backport fix for kexec
 regression

---
 .../linux6.8/patches/fix-musl-btf-ids.patch   | 15 ++++
 srcpkgs/linux6.8/patches/revert-gbpages.patch | 75 +++++++++++++++++++
 srcpkgs/linux6.8/template                     |  4 +-
 3 files changed, 92 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux6.8/patches/fix-musl-btf-ids.patch
 create mode 100644 srcpkgs/linux6.8/patches/revert-gbpages.patch

diff --git a/srcpkgs/linux6.8/patches/fix-musl-btf-ids.patch b/srcpkgs/linux6.8/patches/fix-musl-btf-ids.patch
new file mode 100644
index 00000000000000..bec96095197c45
--- /dev/null
+++ b/srcpkgs/linux6.8/patches/fix-musl-btf-ids.patch
@@ -0,0 +1,15 @@
+https://bugzilla.kernel.org/show_bug.cgi?id=218647
+
+diff --git a/tools/include/linux/btf_ids.h b/tools/include/linux/btf_ids.h
+index 72535f00572f..72ea363d434d 100644
+--- a/tools/include/linux/btf_ids.h
++++ b/tools/include/linux/btf_ids.h
+@@ -3,6 +3,8 @@
+ #ifndef _LINUX_BTF_IDS_H
+ #define _LINUX_BTF_IDS_H
+ 
++#include <linux/types.h> /* for u32 */
++
+ struct btf_id_set {
+        u32 cnt;
+        u32 ids[];
diff --git a/srcpkgs/linux6.8/patches/revert-gbpages.patch b/srcpkgs/linux6.8/patches/revert-gbpages.patch
new file mode 100644
index 00000000000000..48098db868202d
--- /dev/null
+++ b/srcpkgs/linux6.8/patches/revert-gbpages.patch
@@ -0,0 +1,75 @@
+From c567f2948f57bdc03ed03403ae0234085f376b7d Mon Sep 17 00:00:00 2001
+From: Ingo Molnar <mingo@kernel.org>
+Date: Mon, 25 Mar 2024 11:47:51 +0100
+Subject: Revert "x86/mm/ident_map: Use gbpages only where full GB page should
+ be mapped."
+
+This reverts commit d794734c9bbfe22f86686dc2909c25f5ffe1a572.
+
+While the original change tries to fix a bug, it also unintentionally broke
+existing systems, see the regressions reported at:
+
+  https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+
+Since d794734c9bbf was also marked for -stable, let's back it out before
+causing more damage.
+
+Note that due to another upstream change the revert was not 100% automatic:
+
+  0a845e0f6348 mm/treewide: replace pud_large() with pud_leaf()
+
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: <stable@vger.kernel.org>
+Cc: Russ Anderson <rja@hpe.com>
+Cc: Steve Wahl <steve.wahl@hpe.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/
+Fixes: d794734c9bbf ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
+---
+ arch/x86/mm/ident_map.c | 23 +++++------------------
+ 1 file changed, 5 insertions(+), 18 deletions(-)
+
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
+index a204a332c71fc5..968d7005f4a724 100644
+--- a/arch/x86/mm/ident_map.c
++++ b/arch/x86/mm/ident_map.c
+@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
+ 	for (; addr < end; addr = next) {
+ 		pud_t *pud = pud_page + pud_index(addr);
+ 		pmd_t *pmd;
+-		bool use_gbpage;
+ 
+ 		next = (addr & PUD_MASK) + PUD_SIZE;
+ 		if (next > end)
+ 			next = end;
+ 
+-		/* if this is already a gbpage, this portion is already mapped */
+-		if (pud_large(*pud))
+-			continue;
+-
+-		/* Is using a gbpage allowed? */
+-		use_gbpage = info->direct_gbpages;
+-
+-		/* Don't use gbpage if it maps more than the requested region. */
+-		/* at the begining: */
+-		use_gbpage &= ((addr & ~PUD_MASK) == 0);
+-		/* ... or at the end: */
+-		use_gbpage &= ((next & ~PUD_MASK) == 0);
+-
+-		/* Never overwrite existing mappings */
+-		use_gbpage &= !pud_present(*pud);
+-
+-		if (use_gbpage) {
++		if (info->direct_gbpages) {
+ 			pud_t pudval;
+ 
++			if (pud_present(*pud))
++				continue;
++
++			addr &= PUD_MASK;
+ 			pudval = __pud((addr - info->offset) | info->page_flag);
+ 			set_pud(pud, pudval);
+ 			continue;
+-- 
+cgit 1.2.3-korg
+
diff --git a/srcpkgs/linux6.8/template b/srcpkgs/linux6.8/template
index 39857b710777c2..a0365a618bd173 100644
--- a/srcpkgs/linux6.8/template
+++ b/srcpkgs/linux6.8/template
@@ -1,6 +1,6 @@
 # Template file for 'linux6.8'
 pkgname=linux6.8
-version=6.8.1
+version=6.8.2
 revision=1
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
@@ -14,7 +14,7 @@ if [ "${version##*.}" != 0 ]; then
 fi
 
 checksum="c969dea4e8bb6be991bbf7c010ba0e0a5643a3a8d8fb0a2aaa053406f1e965f3
- dfdfbf3045be48db3b99038a72eb2e6906a31dc11672230b4f45597de2e8cf11"
+ 1d190147d8eee0313f0ea1e565070fc4f88db9c20e9d85dc0c6b9ad62a69b3fa"
 python_version=3
 
 # XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: linux6.x: backport fix for kexec regression
  2024-03-25 18:00 [PR PATCH] linux6.x: backport fix for kexec regression ahesford
                   ` (8 preceding siblings ...)
  2024-03-28 13:56 ` ahesford
@ 2024-03-28 13:57 ` ahesford
  2024-03-28 23:12 ` [PR PATCH] [Merged]: " sgn
  10 siblings, 0 replies; 12+ messages in thread
From: ahesford @ 2024-03-28 13:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/49529#issuecomment-2025251051

Comment:
Looks like Alpine found a fix, so I'm build-testing all of them again.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Merged]: linux6.x: backport fix for kexec regression
  2024-03-25 18:00 [PR PATCH] linux6.x: backport fix for kexec regression ahesford
                   ` (9 preceding siblings ...)
  2024-03-28 13:57 ` ahesford
@ 2024-03-28 23:12 ` sgn
  10 siblings, 0 replies; 12+ messages in thread
From: sgn @ 2024-03-28 23:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1341 bytes --]

There's a merged pull request on the void-packages repository

linux6.x: backport fix for kexec regression
https://github.com/void-linux/void-packages/pull/49529

Description:
All of our `linux6.x` kernel series include a change that breaks `kexec` on certain hardware, notably AMD CPUs using various iterations of the Zen microarchitecture. I can reproduce the issue on my Zen 3 CPU, while [other reports](https://github.com/zbm-dev/zfsbootmenu/discussions/598) reveal that this problem affects ZFSBootMenu users on other iterations. I bisected the problem and confirmed that it is caused by the same commit that [seems to impact users more generally](https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/). Consequently, the current upstream fix is to [just revert the change](https://lore.kernel.org/linux-kernel/8142c0de-e3a4-4e78-aa1b-f5e6503752e4@intel.com/T/#m674760504b865936068602efca9a10fb72e7102e).

While I was backporting the reversion, I took the liberty of updating `linux6.1` as well.

I'm in the process of building and testing kernels with these patches to confirm that it fixes the ZFSBootMenu problem I observed and, assuming so, plan to bump our kernels to include the fix.

cc: @sgn @Duncaen 

[ci skip]

#### Testing the changes
- I tested the changes in this PR: **in process**

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-03-28 23:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-25 18:00 [PR PATCH] linux6.x: backport fix for kexec regression ahesford
2024-03-25 23:52 ` sgn
2024-03-26  0:36 ` ahesford
2024-03-27 13:23 ` dkwo
2024-03-27 14:14 ` [PR PATCH] [Updated] " ahesford
2024-03-27 14:15 ` ahesford
2024-03-27 14:39 ` [PR PATCH] [Updated] " ahesford
2024-03-27 14:40 ` ahesford
2024-03-27 18:05 ` [PR PATCH] [Updated] " ahesford
2024-03-28 13:56 ` ahesford
2024-03-28 13:57 ` ahesford
2024-03-28 23:12 ` [PR PATCH] [Merged]: " sgn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).