[Crash-utility] [PATCH] x86_64: fix "bt" command on 5.12-rc1 and later kernels

HAGIO KAZUHITO(萩尾 一仁) k-hagio-ab at nec.com
Tue Mar 2 04:38:18 UTC 2021


Fix "bt" command on Linux 5.12-rc1 and later kernels that contains
kernel commit 951c2a51ae75 ("x86/irq/64: Adjust the per CPU irq stack
pointer by 8").  Without the patch, the "bt" command and some options
that read irq stack fails with the error message "bt: read of stack
at <address> failed".

Signed-off-by: Kazuhito Hagio <k-hagio-ab at nec.com>
---
 x86_64.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/x86_64.c b/x86_64.c
index 23a40a04bbc4..f5b2f7b5f040 100644
--- a/x86_64.c
+++ b/x86_64.c
@@ -1326,6 +1326,8 @@ x86_64_per_cpu_init(void)
 		    	    KVADDR, &hardirq_stack_ptr, sizeof(void *),
 		    	    "hardirq_stack_ptr (per_cpu)", QUIET|RETURN_ON_ERROR))
 				continue;
+			if (hardirq_stack_ptr != PAGEBASE(hardirq_stack_ptr))
+				hardirq_stack_ptr += 8;
 			ms->stkinfo.ibase[i] = hardirq_stack_ptr - ms->stkinfo.isize;
 		} else if (irq_sp)
 			ms->stkinfo.ibase[i] = irq_sp->value + kt->__per_cpu_offset[i];
-- 
2.18.4





More information about the Crash-utility mailing list