kexec does not work for kernel version with patch level >= 256

2021-03-23 Thread Patrick Sung
Hello all, I am using the 4.9 long term kernel which is currently at 4.9.262. When using this kernel with kexec-tools it prints out this error Unsupported utsname.release: 4.9.262 Cannot load A quick search in the code shows that kexec/kernel_version.c doing this check: if (major >= 256

[PATCH v2 12/12] kdump: Use vmlinux_build_id() to simplify

2021-03-23 Thread Stephen Boyd
We can use the vmlinux_build_id() helper here now instead of open coding it. This consolidates code and possibly avoids calculating the build ID twice in the case of a crash with a stacktrace. Cc: Jiri Olsa Cc: Alexei Starovoitov Cc: Jessica Yu Cc: Evan Green Cc: Hsin-Yi Wang Cc: Dave Young

[PATCH v2 00/12] Add build ID to stacktraces

2021-03-23 Thread Stephen Boyd
This series adds the kernel's build ID[1] to the stacktrace header printed in oops messages, warnings, etc. and the build ID for any module that appears in the stacktrace after the module name. The goal is to make the stacktrace more self-contained and descriptive by including the relevant build

[PATCH v2 02/12] buildid: Add method to get running kernel's build ID

2021-03-23 Thread Stephen Boyd
Add vmlinux_build_id() so that callers can print a hex format string representation of the running kernel's build ID. This will be used in the kdump and dump_stack code so that developers can easily locate the vmlinux debug symbols for a crash/stacktrace. Cc: Jiri Olsa Cc: Alexei Starovoitov

[PATCH] kexec-xen: Use correct image type for Live Update

2021-03-23 Thread Raphael Ning
From: Raphael Ning Unlike xen_kexec_load(), xen_kexec_unload() and xen_kexec_status() fail to distinguish between normal kexec and Xen Live Update image types. Fix that by introducing a new helper function that maps internal flags to KEXEC_TYPE_*, and using it throughout kexec-xen.c.

[PATCH] kexec: Make --status work with normal kexec images

2021-03-23 Thread Raphael Ning
From: Raphael Ning According to kexec(8) manpage, --status (-S) works with both normal kexec (loaded by -l) and crash kernel (loaded by -p) image types, and defaults to the latter. However, the implementation does not match the description: `kexec -l -S` queries the -p image type as if -l were

[PATCH] kexec: Fix description of --status exit code

2021-03-23 Thread Raphael Ning
From: Raphael Ning On both Linux and Xen, an exit code of 0 from `kexec --status` indicates that the kexec image being queried is NOT loaded, which is contrary to what the man page and usage() say. Signed-off-by: Raphael Ning --- kexec/kexec.8 | 6 +++--- kexec/kexec.c | 3 ++- 2 files

Re: [PATCH v1 1/3] kernel/resource: make walk_system_ram_res() find all busy IORESOURCE_SYSTEM_RAM resources

2021-03-23 Thread Baoquan He
On 03/22/21 at 05:01pm, David Hildenbrand wrote: > It used to be true that we can have busy system RAM only on the first level > in the resourc tree. However, this is no longer holds for driver-managed > system RAM (i.e., added via dax/kmem and virtio-mem), which gets added on > lower levels. > >

Re: [PATCH v1 1/3] kernel/resource: make walk_system_ram_res() find all busy IORESOURCE_SYSTEM_RAM resources

2021-03-23 Thread David Hildenbrand
On 23.03.21 12:06, Andy Shevchenko wrote: On Mon, Mar 22, 2021 at 05:01:58PM +0100, David Hildenbrand wrote: It used to be true that we can have busy system RAM only on the first level in the resourc tree. However, this is no longer holds for driver-managed system RAM (i.e., added via dax/kmem

Re: [PATCH v1 2/3] kernel/resource: make walk_mem_res() find all busy IORESOURCE_MEM resources

2021-03-23 Thread David Hildenbrand
On 23.03.21 12:08, Andy Shevchenko wrote: On Mon, Mar 22, 2021 at 05:01:59PM +0100, David Hildenbrand wrote: It used to be true that we can have system RAM only on the first level in the resourc tree. However, this is no longer holds for driver-managed system RAM (i.e., dax/kmem and

Re: [PATCH v1 3/3] kernel/resource: remove first_lvl / siblings_only logic

2021-03-23 Thread David Hildenbrand
On 23.03.21 12:11, Andy Shevchenko wrote: On Mon, Mar 22, 2021 at 05:02:00PM +0100, David Hildenbrand wrote: All IORESOURCE_SYSTEM_RAM and IORESOURCE_MEM now properly consider the whole resource tree, not just the first level. Let's drop the unused first_lvl / siblings_only logic. All

Re: [PATCH v1 3/3] kernel/resource: remove first_lvl / siblings_only logic

2021-03-23 Thread Andy Shevchenko
On Mon, Mar 22, 2021 at 05:02:00PM +0100, David Hildenbrand wrote: > All IORESOURCE_SYSTEM_RAM and IORESOURCE_MEM now properly consider the > whole resource tree, not just the first level. Let's drop the unused > first_lvl / siblings_only logic. > > All functions properly search the whole tree,

Re: [PATCH v1 2/3] kernel/resource: make walk_mem_res() find all busy IORESOURCE_MEM resources

2021-03-23 Thread Andy Shevchenko
On Mon, Mar 22, 2021 at 05:01:59PM +0100, David Hildenbrand wrote: > It used to be true that we can have system RAM only on the first level > in the resourc tree. However, this is no longer holds for driver-managed > system RAM (i.e., dax/kmem and virtio-mem). > > The function walk_mem_res() only

Re: [PATCH v1 1/3] kernel/resource: make walk_system_ram_res() find all busy IORESOURCE_SYSTEM_RAM resources

2021-03-23 Thread Andy Shevchenko
On Tue, Mar 23, 2021 at 10:40:33AM +0100, David Hildenbrand wrote: > On 22.03.21 17:01, David Hildenbrand wrote: > > It used to be true that we can have busy system RAM only on the first level > > in the resourc tree. However, this is no longer holds for driver-managed > > system RAM (i.e., added

Re: [PATCH v1 1/3] kernel/resource: make walk_system_ram_res() find all busy IORESOURCE_SYSTEM_RAM resources

2021-03-23 Thread Andy Shevchenko
On Mon, Mar 22, 2021 at 05:01:58PM +0100, David Hildenbrand wrote: > It used to be true that we can have busy system RAM only on the first level > in the resourc tree. However, this is no longer holds for driver-managed > system RAM (i.e., added via dax/kmem and virtio-mem), which gets added on >

Re: [PATCH next v1 2/3] printk: remove safe buffers

2021-03-23 Thread Petr Mladek
On Wed 2021-03-17 00:33:25, John Ogness wrote: > With @logbuf_lock removed, the high level printk functions for > storing messages are lockless. Messages can be stored from any > context, so there is no need for the NMI and safe buffers anymore. > Remove the NMI and safe buffers. > > Although the

[PATCH v1 2/3] crashdump/x86: iterate only over actual crash memory ranges

2021-03-23 Thread David Hildenbrand
No need to iterate over empty entries. Cc: Simon Horman Signed-off-by: David Hildenbrand --- kexec/arch/i386/crashdump-x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c index a301ac8..43e830a 100644 ---

[PATCH v1 0/3] crashdump/x86: dump dax/kmem and virito-mem added System RAM

2021-03-23 Thread David Hildenbrand
Let's properly support dumping any kind of "System RAM" that is not on the top level of the kernel resource tree in /proc/iomem, processing any /proc/iomem entry that contains "System RAM". In addition, increase the maximum number of crash memory ranges to fully support virtio-mem even in corner

[PATCH v1 3/3] crashdump/x86: increase CRASH_MAX_MEMORY_RANGES to 32k

2021-03-23 Thread David Hildenbrand
virtio-mem in Linux adds/removes individual memory blocks (e.g., 128 MB each). Linux merges adjacent memory blocks added by virtio-mem devices, but we can still end up with a very sparse memory layout when unplugging memory in corner cases. Let's increase the maximum number of crash memory ranges

[PATCH v1 1/3] crashdump/x86: dump any kind of "System RAM"

2021-03-23 Thread David Hildenbrand
Traditionally, we had "System RAM" only on the top level of in the kernel resource tree (-> /proc/iomem). Nowadays, we can also have "System RAM" on lower levels of the tree -- driver-managed device memory that is always detected and added via drivers. Current examples are memory added via

Re: [PATCH next v1 2/3] printk: remove safe buffers

2021-03-23 Thread Petr Mladek
On Mon 2021-03-22 22:58:47, John Ogness wrote: > On 2021-03-22, Petr Mladek wrote: > > On Mon 2021-03-22 12:16:15, John Ogness wrote: > >> On 2021-03-21, Sergey Senozhatsky wrote: > >> >> @@ -369,7 +70,10 @@ __printf(1, 0) int vprintk_func(const char *fmt, > >> >> va_list args) > >> >>

Re: [PATCH v1 1/3] kernel/resource: make walk_system_ram_res() find all busy IORESOURCE_SYSTEM_RAM resources

2021-03-23 Thread David Hildenbrand
On 22.03.21 17:01, David Hildenbrand wrote: It used to be true that we can have busy system RAM only on the first level in the resourc tree. However, this is no longer holds for driver-managed system RAM (i.e., added via dax/kmem and virtio-mem), which gets added on lower levels. We have two

Re: [PATCH] include: linux: Remove duplicate include of pgtable.h

2021-03-23 Thread Baoquan He
On 03/23/21 at 11:13am, Wan Jiabing wrote: > linux/pgtable.h has been included at line 11 with annotation. > So we remove the duplicate one at line 8. > > Signed-off-by: Wan Jiabing Thanks for your posting. But this resend is still not good. I have pasted the suggested log, wondering why you

Re: [PATCH] crash_dump: Fix duplicate included pgtable.h

2021-03-23 Thread Baoquan He
On 03/19/21 at 08:03pm, Tian Tao wrote: > linux/pgtable.h is included more than once, Remove the one that isn't > necessary. > > Fixes: ca5999fde0a1 ("mm: introduce include/linux/pgtable.h") > Signed-off-by: Tian Tao Thanks, this looks good to me. But the Fixes tag is unnecessary since this