diff --git a/0011-Fix-macro-TIF_SIGPENDING-values.patch b/0011-Fix-macro-TIF_SIGPENDING-values.patch new file mode 100644 index 0000000000000000000000000000000000000000..3ef0fecf55d240dce20cf9828b749806340c9824 --- /dev/null +++ b/0011-Fix-macro-TIF_SIGPENDING-values.patch @@ -0,0 +1,100 @@ +From 7ad855949e755194f41400f969c9b51f91753d6f Mon Sep 17 00:00:00 2001 +From: huskarTang +Date: Thu, 29 Dec 2022 13:16:56 +0800 +Subject: [PATCH] Fix the value of TIF_SIGPENDING macro + +Correct the change of the value of TIF_SIGPENDING macro between + different kernel versions. + + TIF_SIGPENDING changes with the kernel version as follows: + ARM 2 -> 0 at v2.6.23 + MIPS 2 -> 1 at v2.6.23 + MIPS64 2 -> 1 at v2.6.23 + PPC 2 -> 1 at v2.6.23 + IA64 1 -> 0 at v2.6.23 + PPC64 2 -> 1 at v2.6.23 + S390 2 -> 1 at v3.16 + S390X 2 -> 1 at v3.16 +--- + defs.h | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/defs.h b/defs.h +index c7cea8e..b253579 100644 +--- a/defs.h ++++ b/defs.h +@@ -2997,7 +2997,7 @@ typedef struct QEMUCPUState QEMUCPUState; + #define __swp_type(entry) SWP_TYPE(entry) + #define __swp_offset(entry) SWP_OFFSET(entry) + +-#define TIF_SIGPENDING (2) ++#define TIF_SIGPENDING (THIS_KERNEL_VERSION >= LINUX(2,6,23) ? 0 : 2) + + #define _SECTION_SIZE_BITS 28 + #define _MAX_PHYSMEM_BITS 32 +@@ -3382,7 +3382,7 @@ struct arm64_stackframe { + #define __swp_type(entry) SWP_TYPE(entry) + #define __swp_offset(entry) SWP_OFFSET(entry) + +-#define TIF_SIGPENDING (2) ++#define TIF_SIGPENDING (THIS_KERNEL_VERSION >= LINUX(2,6,23) ? 1 : 2) + + #define _SECTION_SIZE_BITS 26 + #define _MAX_PHYSMEM_BITS 32 +@@ -3421,7 +3421,7 @@ struct arm64_stackframe { + #define __swp_type(entry) SWP_TYPE(entry) + #define __swp_offset(entry) SWP_OFFSET(entry) + +-#define TIF_SIGPENDING (2) ++#define TIF_SIGPENDING (THIS_KERNEL_VERSION >= LINUX(2,6,23) ? 1 : 2) + + #define _SECTION_SIZE_BITS 28 + #define _MAX_PHYSMEM_BITS 48 +@@ -3889,7 +3889,7 @@ struct machine_specific { + #define __swp_type(entry) SWP_TYPE(entry) + #define __swp_offset(entry) SWP_OFFSET(entry) + +-#define TIF_SIGPENDING (2) ++#define TIF_SIGPENDING (THIS_KERNEL_VERSION >= LINUX(2,6,23) ? 1 : 2) + + #define _SECTION_SIZE_BITS 24 + #define _MAX_PHYSMEM_BITS 44 +@@ -4084,7 +4084,7 @@ struct efi_memory_desc_t { + #define __swp_type(entry) ((entry >> 2) & 0x7f) + #define __swp_offset(entry) ((entry << 1) >> 10) + +-#define TIF_SIGPENDING (1) ++#define TIF_SIGPENDING (THIS_KERNEL_VERSION >= LINUX(2,6,23) ? 0 : 1) + + #define KERNEL_TR_PAGE_SIZE (1 << _PAGE_SIZE_64M) + #define KERNEL_TR_PAGE_MASK (~(KERNEL_TR_PAGE_SIZE - 1)) +@@ -4224,7 +4224,7 @@ struct efi_memory_desc_t { + #define PTE_RPN_MASK (machdep->machspec->pte_rpn_mask) + #define PTE_RPN_SHIFT (machdep->machspec->pte_rpn_shift) + +-#define TIF_SIGPENDING (2) ++#define TIF_SIGPENDING (THIS_KERNEL_VERSION >= LINUX(2,6,23) ? 1 : 2) + + #define SWP_TYPE(entry) (((entry) >> 1) & 0x7f) + #define SWP_OFFSET(entry) ((entry) >> 8) +@@ -4264,7 +4264,7 @@ struct efi_memory_desc_t { + #define __swp_type(entry) SWP_TYPE(entry) + #define __swp_offset(entry) SWP_OFFSET(entry) + +-#define TIF_SIGPENDING (2) ++#define TIF_SIGPENDING (THIS_KERNEL_VERSION >= LINUX(3,16,0) ? 1 : 2) + + #define _SECTION_SIZE_BITS 25 + #define _MAX_PHYSMEM_BITS 31 +@@ -4289,7 +4289,7 @@ struct efi_memory_desc_t { + #define __swp_type(entry) SWP_TYPE(entry) + #define __swp_offset(entry) SWP_OFFSET(entry) + +-#define TIF_SIGPENDING (2) ++#define TIF_SIGPENDING (THIS_KERNEL_VERSION >= LINUX(3,16,0) ? 1 : 2) + + #define _SECTION_SIZE_BITS 28 + #define _MAX_PHYSMEM_BITS_OLD 42 +-- +2.7.4 + diff --git a/crash.spec b/crash.spec index c53340252703d2b365b0ef3aae4912cf82fcd3c3..11f53c134fe4ca802bec4c0b3b359994587f1abf 100644 --- a/crash.spec +++ b/crash.spec @@ -1,6 +1,6 @@ Name: crash Version: 7.3.0 -Release: 10 +Release: 11 Summary: Linux kernel crash utility. License: GPLv3 URL: https://crash-utility.github.io @@ -20,7 +20,7 @@ Patch8: 0007-crash-7.3.0-sw.patch Patch9: 0008-arm64-fix-backtraces-of-KASAN-kernel-dumpfile-truncated.patch Patch10: 0009-Add-lowercase-tcr_el1_t1sz.patch Patch11: 0010-Fix-kmem-option-on-Linux-5.7-and-later.patch - +Patch12: 0011-Fix-macro-TIF_SIGPENDING-values.patch BuildRequires: ncurses-devel zlib-devel lzo-devel snappy-devel BuildRequires: gcc gcc-c++ bison m4 @@ -86,6 +86,9 @@ install -D -m 0644 defs.h %{buildroot}%{_includedir}/%{name}/defs.h %{_mandir}/man8/crash.8* %changelog +* Thu Dec 29 2022 huskartang - 7.3.0-11 +- Fix the value of TIF_SIGPENDING macro + * Thu Dec 29 2022 huskartang - 7.3.0-10 - Fix "kmem -s|-S" option on Linux 5.7 and later kernels