mbox series

[v1,0/3] kernel/resource: make walk_system_ram_res() and walk_mem_res() search the whole tree

Message ID 20210322160200.19633-1-david@redhat.com (mailing list archive)
Headers show
Series kernel/resource: make walk_system_ram_res() and walk_mem_res() search the whole tree | expand

Message

David Hildenbrand March 22, 2021, 4:01 p.m. UTC
Playing with kdump+virtio-mem I noticed that kexec_file_load() does not
consider System RAM added via dax/kmem and virtio-mem when preparing the
elf header for kdump. Looking into the details, the logic used in
walk_system_ram_res() and walk_mem_res() seems to be outdated.

walk_system_ram_range() already does the right thing, let's change
walk_system_ram_res() and walk_mem_res(), and clean up.

Loading a kdump kernel via "kexec -p -s" ... will result in the kdump
kernel to also dump dax/kmem and virtio-mem added System RAM now.

Note: kexec-tools on x86-64 also have to be updated to consider this
memory in the kexec_load() case when processing /proc/iomem.

Against next-20210322.

David Hildenbrand (3):
  kernel/resource: make walk_system_ram_res() find all busy
    IORESOURCE_SYSTEM_RAM resources
  kernel/resource: make walk_mem_res() find all busy IORESOURCE_MEM
    resources
  kernel/resource: remove first_lvl / siblings_only logic

 kernel/resource.c | 45 ++++++++++++---------------------------------
 1 file changed, 12 insertions(+), 33 deletions(-)

Comments

Andy Shevchenko March 23, 2021, 11:05 a.m. UTC | #1
On Mon, Mar 22, 2021 at 05:01:57PM +0100, David Hildenbrand wrote:
> Playing with kdump+virtio-mem I noticed that kexec_file_load() does not
> consider System RAM added via dax/kmem and virtio-mem when preparing the
> elf header for kdump. Looking into the details, the logic used in
> walk_system_ram_res() and walk_mem_res() seems to be outdated.
> 
> walk_system_ram_range() already does the right thing, let's change
> walk_system_ram_res() and walk_mem_res(), and clean up.
> 
> Loading a kdump kernel via "kexec -p -s" ... will result in the kdump
> kernel to also dump dax/kmem and virtio-mem added System RAM now.
> 
> Note: kexec-tools on x86-64 also have to be updated to consider this
> memory in the kexec_load() case when processing /proc/iomem.


> Against next-20210322.

Hint: `git format-patch --base ...`

> 
> David Hildenbrand (3):
>   kernel/resource: make walk_system_ram_res() find all busy
>     IORESOURCE_SYSTEM_RAM resources
>   kernel/resource: make walk_mem_res() find all busy IORESOURCE_MEM
>     resources
>   kernel/resource: remove first_lvl / siblings_only logic
> 
>  kernel/resource.c | 45 ++++++++++++---------------------------------
>  1 file changed, 12 insertions(+), 33 deletions(-)
> 
> -- 
> 2.29.2
>