All of lore.kernel.org
 help / color / mirror / Atom feed
  • * [PATCH v3 3/3] kexec_file: Load kernel at top of system RAM if required
           [not found] <20180419001848.3041-1-bhe@redhat.com>
           [not found] ` <20180419001848.3041-1-bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    @ 2018-04-19  0:18 ` Baoquan He
      1 sibling, 0 replies; 31+ messages in thread
    From: Baoquan He @ 2018-04-19  0:18 UTC (permalink / raw)
      To: linux-kernel, akpm, robh+dt, dan.j.williams, nicolas.pitre, josh
      Cc: Baoquan He, Dave Young, kexec, Eric Biederman, Yinghai Lu,
    	Vivek Goyal
    
    For kexec_file loading, if kexec_buf.top_down is 'true', the memory which
    is used to load kernel/initrd/purgatory is supposed to be allocated from
    top to down. This is what we have been doing all along in the old kexec
    loading interface and the kexec loading is still default setting in some
    distributions. However, the current kexec_file loading interface doesn't
    do likt this. The function arch_kexec_walk_mem() it calls ignores checking
    kexec_buf.top_down, but calls walk_system_ram_res() directly to go through
    all resources of System RAM from bottom to up, to try to find memory region
    which can contain the specific kexec buffer, then call locate_mem_hole_callback()
    to allocate memory in that found memory region from top to down. This brings
    confusion. These two interfaces need be unified on behaviour.
    
    Here add checking if kexec_buf.top_down is 'true' in arch_kexec_walk_mem(),
    if yes, call the newly added walk_system_ram_res_rev() to find memory region
    from top to down to load kernel.
    
    Signed-off-by: Baoquan He <bhe@redhat.com>
    Cc: Eric Biederman <ebiederm@xmission.com>
    Cc: Vivek Goyal <vgoyal@redhat.com>
    Cc: Dave Young <dyoung@redhat.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Yinghai Lu <yinghai@kernel.org>
    Cc: kexec@lists.infradead.org
    ---
     kernel/kexec_file.c | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
    index 75d8e7cf040e..7a66d9d5a534 100644
    --- a/kernel/kexec_file.c
    +++ b/kernel/kexec_file.c
    @@ -518,6 +518,8 @@ int __weak arch_kexec_walk_mem(struct kexec_buf *kbuf,
     					   IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY,
     					   crashk_res.start, crashk_res.end,
     					   kbuf, func);
    +	else if (kbuf->top_down)
    +		return walk_system_ram_res_rev(0, ULONG_MAX, kbuf, func);
     	else
     		return walk_system_ram_res(0, ULONG_MAX, kbuf, func);
     }
    -- 
    2.13.6
    
    
    _______________________________________________
    kexec mailing list
    kexec@lists.infradead.org
    http://lists.infradead.org/mailman/listinfo/kexec
    
    ^ permalink raw reply related	[flat|nested] 31+ messages in thread

  • end of thread, other threads:[~2018-05-08 23:41 UTC | newest]
    
    Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <20180419001848.3041-1-bhe@redhat.com>
         [not found] ` <20180419001848.3041-1-bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    2018-04-19  0:18   ` [PATCH v3 1/3] resource: Use list_head to link sibling resource Baoquan He
    2018-04-19  0:18     ` Baoquan He
    2018-04-19  0:18     ` Baoquan He
         [not found]     ` <20180419001848.3041-2-bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    2018-04-26  1:18       ` Wei Yang
    2018-04-26  1:18         ` Wei Yang
    2018-04-26  1:18         ` Wei Yang
    2018-05-07  1:14         ` Baoquan He
    2018-05-07  1:14           ` Baoquan He
    2018-05-07  1:14           ` Baoquan He
    2018-05-08 11:48           ` Wei Yang
    2018-05-08 11:48             ` Wei Yang
    2018-05-08 11:48             ` Wei Yang
         [not found]             ` <20180508114845.GA19459-1F0jQSPB5oJ4KljauMffTLjjLBE8jN/0@public.gmane.org>
    2018-05-08 12:11               ` Baoquan He
    2018-05-08 12:11                 ` Baoquan He
    2018-05-08 12:11                 ` Baoquan He
    2018-05-08 23:41                 ` Wei Yang
    2018-05-08 23:41                   ` Wei Yang
    2018-05-08 23:41                   ` Wei Yang
    2018-04-26  3:01       ` kbuild test robot
    2018-04-26  3:01         ` kbuild test robot
    2018-04-26  3:01         ` kbuild test robot
         [not found]         ` <201804261045.v9iHAD1T%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
    2018-05-06  6:31           ` Baoquan He
    2018-05-06  6:31             ` Baoquan He
    2018-05-06  6:31             ` Baoquan He
    2018-04-26  3:23       ` kbuild test robot
    2018-04-26  3:23         ` kbuild test robot
    2018-04-26  3:23         ` kbuild test robot
         [not found]         ` <201804261137.HPgv5SSG%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
    2018-05-06  6:30           ` Baoquan He
    2018-05-06  6:30             ` Baoquan He
    2018-05-06  6:30             ` Baoquan He
    2018-04-19  0:18 ` [PATCH v3 3/3] kexec_file: Load kernel at top of system RAM if required Baoquan He
    

    This is an external index of several public inboxes,
    see mirroring instructions on how to clone and mirror
    all data and code used by this external index.