From b015957717c302f9340d00e408fab84635bc5fea Mon Sep 17 00:00:00 2001 From: Lianbo Jiang Date: Mon, 10 Jul 2023 15:28:49 +0800 Subject: [PATCH] Fix "irq -a" option on Linux 6.0 and later Upstream patch: 6d0be1316aa3 ("Fix "irq -a" option on Linux 6.0 and later") Signed-off-by: Lianbo Jiang --- ...-irq-a-option-on-Linux-6.0-and-later.patch | 45 +++++++++++++++++++ crash.spec | 2 + 2 files changed, 47 insertions(+) create mode 100644 0016-Fix-irq-a-option-on-Linux-6.0-and-later.patch diff --git a/0016-Fix-irq-a-option-on-Linux-6.0-and-later.patch b/0016-Fix-irq-a-option-on-Linux-6.0-and-later.patch new file mode 100644 index 0000000..494aae7 --- /dev/null +++ b/0016-Fix-irq-a-option-on-Linux-6.0-and-later.patch @@ -0,0 +1,45 @@ +From 6d0be1316aa3666895c0a8a0d3c98c235ec03bd4 Mon Sep 17 00:00:00 2001 +From: Kazuhito Hagio +Date: Mon, 10 Jul 2023 10:42:08 +0900 +Subject: [PATCH] Fix "irq -a" option on Linux 6.0 and later + +Kernel commit f0dd891dd5a1d ("lib/cpumask: move some one-line wrappers +to header file"), which is contained in Linux 6.0 and later kernels, +inlined alloc_cpumask_var() function. As a result, the "irq -a" option +fails to determine that cpumask_var_t is a pointer, and displays wrong +CPU affinity for IRQs: + + crash> irq -a + IRQ NAME AFFINITY + 1 i8042 3 + 4 ttyS0 + 8 rtc0 + 9 acpi 3 + 12 i8042 3 + ... + +Use alloc_cpumask_var_node() function symbol instead to fix it. + +Signed-off-by: Kazuhito Hagio +Signed-off-by: Lianbo Jiang +--- + kernel.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/kernel.c b/kernel.c +index 639ed64f306a..0fc77c19f12a 100644 +--- a/kernel.c ++++ b/kernel.c +@@ -7298,7 +7298,8 @@ generic_get_irq_affinity(int irq) + tmp_addr = irq_desc_addr + \ + OFFSET(irq_desc_t_affinity); + +- if (symbol_exists("alloc_cpumask_var")) /* pointer member */ ++ if (symbol_exists("alloc_cpumask_var_node") || ++ symbol_exists("alloc_cpumask_var")) /* pointer member */ + readmem(tmp_addr,KVADDR, &affinity_ptr, sizeof(ulong), + "irq_desc affinity", FAULT_ON_ERROR); + else /* array member */ +-- +2.37.1 + diff --git a/crash.spec b/crash.spec index 390e29a..b16569c 100644 --- a/crash.spec +++ b/crash.spec @@ -34,6 +34,7 @@ Patch13: 0012-ppc64-Remove-redundant-PTE-checks.patch Patch14: 0013-Support-module-memory-layout-change-on-Linux-6.4.patch Patch15: 0014-Fix-failure-of-gathering-task-table-on-Linux-6.5-rc1.patch Patch16: 0015-Fix-compilation-error-due-to-new-strlcpy-function-th.patch +Patch17: 0016-Fix-irq-a-option-on-Linux-6.0-and-later.patch %description The core analysis suite is a self-contained tool that can be used to @@ -70,6 +71,7 @@ offered by Mission Critical Linux, or the LKCD kernel patch. %patch14 -p1 %patch15 -p1 %patch16 -p1 +%patch17 -p1 %build