[RESEND PATCH v5 02/11] powerpc/kexec_file: mark PPC64 specific code

2020-07-26 Thread Hari Bathini
Some of the kexec_file_load code isn't PPC64 specific. Move PPC64 specific code from kexec/file_load.c to kexec/file_load_64.c. Also, rename purgatory/trampoline.S to purgatory/trampoline_64.S in the same spirit. No functional changes. Signed-off-by: Hari Bathini Tested-by: Pingfan Liu Rev

[RESEND PATCH v5 01/11] kexec_file: allow archs to handle special regions while locating memory hole

2020-07-26 Thread Hari Bathini
hole. Also, add the missing declarations for arch overridable functions and and drop the __weak descriptors in the declarations to avoid non-weak definitions from becoming weak. Reported-by: kernel test robot [lkp: In v1, arch_kimage_file_post_load_cleanup() declaration was missing] Signed-off-by:

[RESEND PATCH v5 00/11] ppc64: enable kdump support for kexec_file_load syscall

2020-07-26 Thread Hari Bathini
files added. * Added an option to merge ranges to minimize reallocations while adding memory ranges. * Dropped within_crashkernel parameter for add_opal_mem_range() & add_rtas_mem_range() functions as it is not really needed. --- Hari Bathini (11): kexec_file: allow archs to handle special

[PATCH v5 02/11] powerpc/kexec_file: mark PPC64 specific code

2020-07-24 Thread Hari Bathini
Some of the kexec_file_load code isn't PPC64 specific. Move PPC64 specific code from kexec/file_load.c to kexec/file_load_64.c. Also, rename purgatory/trampoline.S to purgatory/trampoline_64.S in the same spirit. No functional changes. Signed-off-by: Hari Bathini Tested-by: Pingfan Liu Rev

[PATCH v5 01/11] kexec_file: allow archs to handle special regions while locating memory hole

2020-07-24 Thread Hari Bathini
hole. Also, add the missing declarations for arch overridable functions and and drop the __weak descriptors in the declarations to avoid non-weak definitions from becoming weak. Reported-by: kernel test robot [lkp: In v1, arch_kimage_file_post_load_cleanup() declaration was missing] Signed-off-by:

[PATCH v5 00/11] ppc64: enable kdump support for kexec_file_load syscall

2020-07-24 Thread Hari Bathini
meter for add_opal_mem_range() & add_rtas_mem_range() functions as it is not really needed. --- Hari Bathini (11): kexec_file: allow archs to handle special regions while locating memory hole powerpc/kexec_file: mark PPC64 specific code powerpc/kexec_file: add helper func

Re: [PATCH v4 06/12] ppc64/kexec_file: restrict memory usage of kdump kernel

2020-07-24 Thread Hari Bathini
On 24/07/20 5:36 am, Thiago Jung Bauermann wrote: > > Hari Bathini writes: > >> Kdump kernel, used for capturing the kernel core image, is supposed >> to use only specific memory regions to avoid corrupting the image to >> be captured. The regions are crashkernel

Re: [PATCH v4 07/12] ppc64/kexec_file: add support to relocate purgatory

2020-07-22 Thread Hari Bathini
On 22/07/20 9:55 am, Michael Ellerman wrote: > Hari Bathini writes: >> Right now purgatory implementation is only minimal. But if purgatory >> code is to be enhanced to copy memory to the backup region and verify >> sha256 digest, relocations may have to be applied to the

Re: [PATCH v4 03/12] powerpc/kexec_file: add helper functions for getting memory ranges

2020-07-20 Thread Hari Bathini
On 20/07/20 6:21 pm, Hari Bathini wrote: > In kexec case, the kernel to be loaded uses the same memory layout as > the running kernel. So, passing on the DT of the running kernel would > be good enough. > > But in case of kdump, different memory ranges are needed to manage >

[PATCH v4 12/12] ppc64/kexec_file: fix kexec load failure with lack of memory hole

2020-07-20 Thread Hari Bathini
address isn't available while loading, are placed in an intermediate location till a flush to the actual destination address happens during kexec boot sequence. Signed-off-by: Hari Bathini Tested-by: Pingfan Liu Reviewed-by: Thiago Jung Bauermann --- v3 -> v4: * Unchanged. Added Reviewed-by

[PATCH v4 11/12] ppc64/kexec_file: add appropriate regions for memory reserve map

2020-07-20 Thread Hari Bathini
While initrd, elfcorehdr and backup regions are already added to the reserve map, there are a few missing regions that need to be added to the memory reserve map. Add them here. And now that all the changes to load panic kernel are in place, claim likewise. Signed-off-by: Hari Bathini Tested-by

[PATCH v4 10/12] ppc64/kexec_file: prepare elfcore header for crashing kernel

2020-07-20 Thread Hari Bathini
ff-by: Hari Bathini Tested-by: Pingfan Liu --- v3 -> v4: * Added a FIXME tag to indicate issue in adding opal/rtas regions to core image. * Folded prepare_elf_headers() function into load_elfcorehdr_segment(). v2 -> v3: * Unchanged. Added Tested-by tag from Pingfan. v1 -> v2: * Tried me

[PATCH v4 09/12] ppc64/kexec_file: setup backup region for kdump kernel

2020-07-20 Thread Hari Bathini
ry to avoid kdump kernel from accidentially using that memory. Reported-by: kernel test robot [lkp: In v1, purgatory() declaration was missing] Signed-off-by: Hari Bathini --- v3 -> v4: * Moved fdt_add_mem_rsv() for backup region under kdump flag, on Thiago's suggestion, as it is only

[PATCH v4 08/12] ppc64/kexec_file: setup the stack for purgatory

2020-07-20 Thread Hari Bathini
To avoid any weird errors, the purgatory should run with its own stack. Set one up by adding the stack buffer to .data section of the purgatory. Also, setup opal base & entry values in r8 & r9 registers to help early OPAL debugging. Signed-off-by: Hari Bathini Tested-by: Pingfan Liu Rev

[PATCH v4 07/12] ppc64/kexec_file: add support to relocate purgatory

2020-07-20 Thread Hari Bathini
pointer and applying RELA relocations as needed. Reported-by: kernel test robot [lkp: In v1, 'struct mem_sym' was declared in parameter list] Signed-off-by: Hari Bathini --- * Michael, can you share your opinion on the below: - https://lore.kernel.org/patchwork/patch/1272027/ - My

[PATCH v4 06/12] ppc64/kexec_file: restrict memory usage of kdump kernel

2020-07-20 Thread Hari Bathini
as applicable. Restrict kdump kernel memory to use only these regions by setting up usable-memory DT property. Also, tell the kdump kernel to run at the loaded address by setting the magic word at 0x5c. Signed-off-by: Hari Bathini Tested-by: Pingfan Liu --- v3 -> v4: * Updated get_node_path()

[PATCH v4 05/12] powerpc/drmem: make lmb walk a bit more flexible

2020-07-20 Thread Hari Bathini
n an error is encountered in the callback function. Signed-off-by: Hari Bathini Tested-by: Pingfan Liu Reviewed-by: Thiago Jung Bauermann --- v3 -> v4: * Unchanged. Added Reviewed-by tag from Thiago. v2 -> v3: * Unchanged. Added Tested-by tag from Pingfan. v1 -> v2: * No changes.

[PATCH v4 02/12] powerpc/kexec_file: mark PPC64 specific code

2020-07-20 Thread Hari Bathini
Some of the kexec_file_load code isn't PPC64 specific. Move PPC64 specific code from kexec/file_load.c to kexec/file_load_64.c. Also, rename purgatory/trampoline.S to purgatory/trampoline_64.S in the same spirit. No functional changes. Signed-off-by: Hari Bathini Tested-by: Pingfan Liu Rev

[PATCH v4 04/12] ppc64/kexec_file: avoid stomping memory used by special regions

2020-07-20 Thread Hari Bathini
ride arch_kexec_locate_mem_hole() to locate a memory hole taking these ranges into account. Signed-off-by: Hari Bathini --- v3 -> v4: * Dropped KDUMP_BUF_MIN & KDUMP_BUF_MAX macros and fixed off-by-one error in arch_locate_mem_hole() helper routines. v2 -> v3: * If there are no exclude ranges, t

[PATCH v4 03/12] powerpc/kexec_file: add helper functions for getting memory ranges

2020-07-20 Thread Hari Bathini
erstanding the subsequent changes better and make it easy to setup the different memory ranges listed above, as and when appropriate. Signed-off-by: Hari Bathini Tested-by: Pingfan Liu --- v3 -> v4: * Unchanged. Added Reviewed-by tag from Thiago. v2 -> v3: * Unchanged. Added Acked-by

[PATCH v4 01/12] kexec_file: allow archs to handle special regions while locating memory hole

2020-07-20 Thread Hari Bathini
hole. Also, add the missing declarations for arch overridable functions and and drop the __weak descriptors in the declarations to avoid non-weak definitions from becoming weak. Reported-by: kernel test robot [lkp: In v1, arch_kimage_file_post_load_cleanup() declaration was missing] Signed-off-by:

[PATCH v4 00/12] ppc64: enable kdump support for kexec_file_load syscall

2020-07-20 Thread Hari Bathini
crashkernel. * Used the appropriate license header for the new files added. * Added an option to merge ranges to minimize reallocations while adding memory ranges. * Dropped within_crashkernel parameter for add_opal_mem_range() & add_rtas_mem_range() functions as it is not really neede

Re: [PATCH v3 03/12] powerpc/kexec_file: add helper functions for getting memory ranges

2020-07-17 Thread Hari Bathini
On 17/07/20 10:02 am, Hari Bathini wrote: > > > On 15/07/20 5:19 am, Thiago Jung Bauermann wrote: >> >> Hello Hari, >> >> Hari Bathini writes: >> >>> In kexec case, the kernel to be loaded uses the same memory layout as >>> the ru

Re: [PATCH v3 02/12] powerpc/kexec_file: mark PPC64 specific code

2020-07-16 Thread Hari Bathini
On 16/07/20 7:19 am, Thiago Jung Bauermann wrote: > > I didn't forget about this patch. I just wanted to see more of the > changes before comenting on it. > > Hari Bathini writes: > >> Some of the kexec_file_load code isn't PPC64 specific. Move PPC64 >&

Re: [PATCH v3 03/12] powerpc/kexec_file: add helper functions for getting memory ranges

2020-07-16 Thread Hari Bathini
On 15/07/20 5:19 am, Thiago Jung Bauermann wrote: > > Hello Hari, > > Hari Bathini writes: > >> In kexec case, the kernel to be loaded uses the same memory layout as >> the running kernel. So, passing on the DT of the running kernel would >> be good e

Re: [PATCH v3 06/12] ppc64/kexec_file: restrict memory usage of kdump kernel

2020-07-16 Thread Hari Bathini
On 17/07/20 3:33 am, Thiago Jung Bauermann wrote: > > Hari Bathini writes: > >> On 16/07/20 4:22 am, Thiago Jung Bauermann wrote: >>> >>> Hari Bathini writes: >>> >>>> + * each representing a memory range. >>>> + */

Re: [PATCH v3 07/12] ppc64/kexec_file: add support to relocate purgatory

2020-07-16 Thread Hari Bathini
On 16/07/20 5:50 am, Thiago Jung Bauermann wrote: > > Hari Bathini writes: > >> Right now purgatory implementation is only minimal. But if purgatory >> code is to be enhanced to copy memory to the backup region and verify > > Can't the memcpy be done

Re: [PATCH v3 09/12] ppc64/kexec_file: setup backup region for kdump kernel

2020-07-16 Thread Hari Bathini
On 16/07/20 7:08 am, Thiago Jung Bauermann wrote: > > Hari Bathini writes: > >> @@ -968,7 +1040,7 @@ int setup_new_fdt_ppc64(const struct kimage *image, >> void *fdt, >> >> /* >> * Restrict memory usage for kdump kernel by set

Re: [PATCH v3 06/12] ppc64/kexec_file: restrict memory usage of kdump kernel

2020-07-16 Thread Hari Bathini
On 16/07/20 4:22 am, Thiago Jung Bauermann wrote: > > Hari Bathini writes: > >> +/** >> + * get_node_path - Get the full path of the given node. >> + * @dn:Node. >> + * @path: Updated with the full path of the node. >> + * >

Re: [PATCH v3 05/12] powerpc/drmem: make lmb walk a bit more flexible

2020-07-16 Thread Hari Bathini
On 15/07/20 9:20 am, Thiago Jung Bauermann wrote: > > Hari Bathini writes: > >> @@ -534,7 +537,7 @@ static int __init early_init_dt_scan_memory_ppc(unsigned >> long node, >> #ifdef CONFIG_PPC_PSERIES >> if (depth == 1 && >> st

Re: [PATCH v3 04/12] ppc64/kexec_file: avoid stomping memory used by special regions

2020-07-16 Thread Hari Bathini
On 15/07/20 8:09 am, Thiago Jung Bauermann wrote: > > Hari Bathini writes: > >> +/** >> + * __locate_mem_hole_top_down - Looks top down for a large enough memory >> hole >> + * in the memory regi

Re: [PATCH v3 03/12] powerpc/kexec_file: add helper functions for getting memory ranges

2020-07-16 Thread Hari Bathini
On 15/07/20 5:19 am, Thiago Jung Bauermann wrote: > > > >> +/** >> + * get_mem_rngs_size - Get the allocated size of mrngs based on >> + * max_nr_ranges and chunk size. >> + * @mrngs: Memory ranges. >> + * >> + * Returns the maximum no. of ranges. > > This

Re: [PATCH v3 10/12] ppc64/kexec_file: prepare elfcore header for crashing kernel

2020-07-16 Thread Hari Bathini
On 16/07/20 7:52 am, Thiago Jung Bauermann wrote: > > Hari Bathini writes: > >> /** >> + * get_crash_memory_ranges - Get crash memory ranges. This list includes >> + * first/crashing kernel's memory regions that >> + *

[PATCH v3 12/12] ppc64/kexec_file: fix kexec load failure with lack of memory hole

2020-07-13 Thread Hari Bathini
address isn't available while loading, are placed in an intermediate location till a flush to the actual destination address happens during kexec boot sequence. Signed-off-by: Hari Bathini Tested-by: Pingfan Liu --- v2 -> v3: * Unchanged. Added Tested-by tag from Pingfan. v1 -> v2: * N

[PATCH v3 11/12] ppc64/kexec_file: add appropriate regions for memory reserve map

2020-07-13 Thread Hari Bathini
While initrd, elfcorehdr and backup regions are already added to the reserve map, there are a few missing regions that need to be added to the memory reserve map. Add them here. And now that all the changes to load panic kernel are in place, claim likewise. Signed-off-by: Hari Bathini Tested-by

[PATCH v3 10/12] ppc64/kexec_file: prepare elfcore header for crashing kernel

2020-07-13 Thread Hari Bathini
ff-by: Hari Bathini Tested-by: Pingfan Liu --- v2 -> v3: * Unchanged. Added Tested-by tag from Pingfan. v1 -> v2: * Tried merging adjacent memory ranges on hitting maximum ranges limit to reduce reallocations for memory ranges and also, minimize PT_LOAD segments for elfcore

[PATCH v3 05/12] powerpc/drmem: make lmb walk a bit more flexible

2020-07-13 Thread Hari Bathini
n an error is encountered in the callback function. Signed-off-by: Hari Bathini Tested-by: Pingfan Liu --- Patch 05/12 v2 -> v3: * Unchanged. Added Tested-by tag from Pingfan. v1 -> v2: * No changes. arch/powerpc/include/asm/drmem.h |9 ++-- arch/powerpc/kernel/prom.c | 13 ++

[PATCH v3 09/12] ppc64/kexec_file: setup backup region for kdump kernel

2020-07-13 Thread Hari Bathini
ry to avoid kdump kernel from accidentially using that memory. Reported-by: kernel test robot [lkp: In v1, purgatory() declaration was missing] Signed-off-by: Hari Bathini --- v2 -> v3: * Dropped check for backup_start in trampoline_64.S as purgatory() takes care of it anyway. v1 -> v2:

[PATCH v3 04/12] ppc64/kexec_file: avoid stomping memory used by special regions

2020-07-13 Thread Hari Bathini
ride arch_kexec_locate_mem_hole() to locate a memory hole taking these ranges into account. Signed-off-by: Hari Bathini --- v2 -> v3: * If there are no exclude ranges, the right thing to do is fallbacking back to default kexec_locate_mem_hole() implementation instead of returning 0. Fixed that. v

[PATCH v3 08/12] ppc64/kexec_file: setup the stack for purgatory

2020-07-13 Thread Hari Bathini
To avoid any weird errors, the purgatory should run with its own stack. Set one up by adding the stack buffer to .data section of the purgatory. Also, setup opal base & entry values in r8 & r9 registers to help early OPAL debugging. Signed-off-by: Hari Bathini Tested-by: Pingfan Liu

[PATCH v3 07/12] ppc64/kexec_file: add support to relocate purgatory

2020-07-13 Thread Hari Bathini
pointer and applying RELA relocations as needed. Reported-by: kernel test robot [lkp: In v1, 'struct mem_sym' was declared in parameter list] Signed-off-by: Hari Bathini --- v2 -> v3: * Fixed get_toc_section() to return the section info that had relocations applied, to calculate th

[PATCH v3 02/12] powerpc/kexec_file: mark PPC64 specific code

2020-07-13 Thread Hari Bathini
Some of the kexec_file_load code isn't PPC64 specific. Move PPC64 specific code from kexec/file_load.c to kexec/file_load_64.c. Also, rename purgatory/trampoline.S to purgatory/trampoline_64.S in the same spirit. Signed-off-by: Hari Bathini Tested-by: Pingfan Liu --- v2 -> v3: * U

[PATCH v3 06/12] ppc64/kexec_file: restrict memory usage of kdump kernel

2020-07-13 Thread Hari Bathini
as applicable. Restrict kdump kernel memory to use only these regions by setting up usable-memory DT property. Also, tell the kdump kernel to run at the loaded address by setting the magic word at 0x5c. Signed-off-by: Hari Bathini Tested-by: Pingfan Liu --- v2 -> v3: * Unchanged. Added Tested

[PATCH v3 03/12] powerpc/kexec_file: add helper functions for getting memory ranges

2020-07-13 Thread Hari Bathini
erstanding the subsequent changes better and make it easy to setup the different memory ranges listed above, as and when appropriate. Signed-off-by: Hari Bathini Tested-by: Pingfan Liu --- v2 -> v3: * Unchanged. Added Tested-by tag from Pingfan. v1 -> v2: * Added an option to merge ranges

[PATCH v3 01/12] kexec_file: allow archs to handle special regions while locating memory hole

2020-07-13 Thread Hari Bathini
hole. Also, add the missing declarations for arch overridable functions and and drop the __weak descriptors in the declarations to avoid non-weak definitions from becoming weak. Reported-by: kernel test robot [lkp: In v1, arch_kimage_file_post_load_cleanup() declaration was missing] Signed-off-by:

[PATCH v3 00/12] ppc64: enable kdump support for kexec_file_load syscall

2020-07-13 Thread Hari Bathini
* Used the appropriate license header for the new files added. * Added an option to merge ranges to minimize reallocations while adding memory ranges. * Dropped within_crashkernel parameter for add_opal_mem_range() & add_rtas_mem_range() functions as it is not really needed. --- Hari Bat

[PATCH v3 00/12] ppc64: enable kdump support for kexec_file_load syscall

2020-07-13 Thread Hari Bathini
xec kernel and also claims kdump support for kdump as all the necessary changes are added. The last patch fixes a lookup issue for `kexec -l -s` case when memory is reserved for crashkernel. --- Hari Bathini (12): kexec_file: allow archs to handle special regions while locating memory h

[PATCH v2 12/12] ppc64/kexec_file: fix kexec load failure with lack of memory hole

2020-07-02 Thread Hari Bathini
address isn't available while loading, are placed in an intermediate location till a flush to the actual destination address happens during kexec boot sequence. Signed-off-by: Hari Bathini --- Changes in v2: * New patch to fix locating memory hole for kexec_file_load (kexec -s -l) when memo

[PATCH v2 11/12] ppc64/kexec_file: add appropriate regions for memory reserve map

2020-07-02 Thread Hari Bathini
While initrd, elfcorehdr and backup regions are already added to the reserve map, there are a few missing regions that need to be added to the memory reserve map. Add them here. And now that all the changes to load panic kernel are in place, claim likewise. Signed-off-by: Hari Bathini

[PATCH v2 10/12] ppc64/kexec_file: prepare elfcore header for crashing kernel

2020-07-02 Thread Hari Bathini
ff-by: Hari Bathini --- Changes in v2: * Tried merging adjacent memory ranges on hitting maximum ranges limit to reduce reallocations for memory ranges and also, minimize PT_LOAD segments for elfcore. * Updated add_rtas_mem_range() & add_opal_mem_range() callsites based on the new prototype

[PATCH v2 09/12] ppc64/kexec_file: setup backup region for kdump kernel

2020-07-02 Thread Hari Bathini
ry to avoid kdump kernel from accidentially using that memory. Reported-by: kernel test robot [lkp: In v1, purgatory() declaration was missing] Signed-off-by: Hari Bathini --- Changes in v2: * Check if backup region is available before branching out. This is to keep `kexec -l -s` flow as before as

[PATCH v2 08/12] ppc64/kexec_file: setup the stack for purgatory

2020-07-02 Thread Hari Bathini
To avoid any weird errors, the purgatory should run with its own stack. Set one up by adding the stack buffer to .data section of the purgatory. Also, setup opal base & entry values in r8 & r9 registers to help early OPAL debugging. Signed-off-by: Hari Bathini --- Changes in v2: * Se

[PATCH v2 07/12] ppc64/kexec_file: add support to relocate purgatory

2020-07-02 Thread Hari Bathini
pointer and applying RELA relocations as needed. Reported-by: kernel test robot [lkp: In v1, 'struct mem_sym' was declared in parameter list] Signed-off-by: Hari Bathini --- Changes in v2: * Fixed wrong use of 'struct mem_sym' in local_entry_offset() as reported by lkp. lkp

[PATCH v2 05/12] powerpc/drmem: make lmb walk a bit more flexible

2020-07-02 Thread Hari Bathini
n an error is encountered in the callback function. Signed-off-by: Hari Bathini --- Changes in v2: * No changes. arch/powerpc/include/asm/drmem.h |9 ++-- arch/powerpc/kernel/prom.c | 13 +++--- arch/powerpc/mm/drmem.c | 87 +- arch/powerp

[PATCH v2 06/12] ppc64/kexec_file: restrict memory usage of kdump kernel

2020-07-02 Thread Hari Bathini
as applicable. Restrict kdump kernel memory to use only these regions by setting up usable-memory DT property. Also, tell the kdump kernel to run at the loaded address by setting the magic word at 0x5c. Signed-off-by: Hari Bathini --- Changes in v2: * Fixed off-by-one error while setting up

[PATCH v2 04/12] ppc64/kexec_file: avoid stomping memory used by special regions

2020-07-02 Thread Hari Bathini
ride arch_kexec_locate_mem_hole() to locate a memory hole taking these ranges into account. Signed-off-by: Hari Bathini --- Changes in v2: * Did arch_kexec_locate_mem_hole() override to handle special regions. * Ensured holes in the memory are accounted for while locating mem hole. * Updated add_rtas_mem_r

[PATCH v2 03/12] powerpc/kexec_file: add helper functions for getting memory ranges

2020-07-02 Thread Hari Bathini
erstanding the subsequent changes better and make it easy to setup the different memory ranges listed above, as and when appropriate. Signed-off-by: Hari Bathini --- Changes in v2: * Added an option to merge ranges while sorting to minimize reallocations for memory ranges list.

[PATCH v2 02/12] powerpc/kexec_file: mark PPC64 specific code

2020-07-02 Thread Hari Bathini
Some of the kexec_file_load code isn't PPC64 specific. Move PPC64 specific code from kexec/file_load.c to kexec/file_load_64.c. Also, rename purgatory/trampoline.S to purgatory/trampoline_64.S in the same spirit. Signed-off-by: Hari Bathini --- Changes in v2: * No changes. arch/po

[PATCH v2 01/12] kexec_file: allow archs to handle special regions while locating memory hole

2020-07-02 Thread Hari Bathini
hole. Also, add the missing declarations for arch overridable functions and and drop the __weak descriptors in the declarations to avoid non-weak definitions from becoming weak. Reported-by: kernel test robot [lkp: In v1, arch_kimage_file_post_load_cleanup() declaration was missing] Signed-off-by:

[PATCH v2 00/12] ppc64: enable kdump support for kexec_file_load syscall

2020-07-02 Thread Hari Bathini
ed an option to merge ranges to minimize reallocations while adding memory ranges. * Dropped within_crashkernel parameter for add_opal_mem_range() & add_rtas_mem_range() functions as it is not really needed. --- Hari Bathini (12): kexec_file: allow archs to handle special regions while locating

Re: [PATCH 01/11] kexec_file: allow archs to handle special regions while locating memory hole

2020-07-01 Thread Hari Bathini
On 01/07/20 1:16 pm, Dave Young wrote: > On 06/29/20 at 05:26pm, Hari Bathini wrote: >> Hi Petr, >> >> On 29/06/20 5:09 pm, Petr Tesarik wrote: >>> Hi Hari, >>> >>> is there any good reason to add two more functions with a very similar >>&g

Re: [PATCH 04/11] ppc64/kexec_file: avoid stomping memory used by special regions

2020-07-01 Thread Hari Bathini
On 01/07/20 1:10 pm, Dave Young wrote: > Hi Hari, > On 06/27/20 at 12:35am, Hari Bathini wrote: >> crashkernel region could have an overlap with special memory regions >> like opal, rtas, tce-table & such. These regions are referred to as >> exclude memory rang

Re: [PATCH 04/11] ppc64/kexec_file: avoid stomping memory used by special regions

2020-06-29 Thread Hari Bathini
On 30/06/20 9:00 am, piliu wrote: > > > On 06/29/2020 01:55 PM, Hari Bathini wrote: >> >> >> On 28/06/20 7:44 am, piliu wrote: >>> Hi Hari, >> >> Hi Pingfan, >> >>> >>> After a quick through for this series, I have a fe

Re: [PATCH 01/11] kexec_file: allow archs to handle special regions while locating memory hole

2020-06-29 Thread Hari Bathini
Hi Petr, On 29/06/20 5:09 pm, Petr Tesarik wrote: > Hi Hari, > > is there any good reason to add two more functions with a very similar > name to an existing function? AFAICS all you need is a way to call a > PPC64-specific function from within kexec_add_buffer (PATCH 4/11), so > you could add so

Re: [PATCH 02/11] powerpc/kexec_file: mark PPC64 specific code

2020-06-28 Thread Hari Bathini
Hi Christophe Thanks for the review... On 27/06/20 12:12 pm, Christophe Leroy wrote: > > > Le 26/06/2020 à 21:04, Hari Bathini a écrit : >> Some of the kexec_file_load code isn't PPC64 specific. Move PPC64 >> specific code from kexec/file_load.c to kexec/file_

Re: [PATCH 01/11] kexec_file: allow archs to handle special regions while locating memory hole

2020-06-28 Thread Hari Bathini
add_buffer definition for archs to override & take >> care of special regions before trying to locate a memory hole. >> >> Signed-off-by: Hari Bathini Thanks Hari

Re: [PATCH 04/11] ppc64/kexec_file: avoid stomping memory used by special regions

2020-06-28 Thread Hari Bathini
On 28/06/20 7:44 am, piliu wrote: > Hi Hari, Hi Pingfan, > > After a quick through for this series, I have a few question/comment on > this patch for the time being. Pls see comment inline. > > On 06/27/2020 03:05 AM, Hari Bathini wrote: >> crashkernel region co

[PATCH 11/11] ppc64/kexec_file: add appropriate regions for memory reserve map

2020-06-26 Thread Hari Bathini
While initrd, elfcorehdr and backup regions are already added to the reserve map, there are a few missing regions that need to be added to the memory reserve map. Add them here. And now that all the changes to load panic kernel are in place, claim likewise. Signed-off-by: Hari Bathini --- arch

[PATCH 09/11] ppc64/kexec_file: setup backup region for kdump kernel

2020-06-26 Thread Hari Bathini
ry to avoid kdump kernel from accidentially using that memory. Signed-off-by: Hari Bathini --- arch/powerpc/include/asm/crashdump-ppc64.h |5 + arch/powerpc/include/asm/kexec.h |7 ++ arch/powerpc/kexec/elf_64.c|9 +++ arch/powerpc/kexec/file_load_64.c |

[PATCH 08/11] ppc64/kexec_file: setup the stack for purgatory

2020-06-26 Thread Hari Bathini
To avoid any weird errors, the purgatory should run with its own stack. Set one up by adding the stack buffer to .data section of the purgatory. Signed-off-by: Hari Bathini --- arch/powerpc/include/asm/kexec.h |4 arch/powerpc/kexec/file_load_64.c | 14 +- arch

[PATCH 07/11] ppc64/kexec_file: add support to relocate purgatory

2020-06-26 Thread Hari Bathini
pointer and applying RELA relocations as needed. Signed-off-by: Hari Bathini --- arch/powerpc/kexec/file_load_64.c | 338 arch/powerpc/purgatory/trampoline_64.S |8 + 2 files changed, 346 insertions(+) diff --git a/arch/powerpc/kexec/file_load_64.c b/arch

[PATCH 06/11] ppc64/kexec_file: restrict memory usage of kdump kernel

2020-06-26 Thread Hari Bathini
as applicable. Restrict kdump kernel memory to use only these regions by setting up usable-memory DT property. Also, tell the kdump kernel to run at the loaded address by setting the magic word at 0x5c. Signed-off-by: Hari Bathini --- arch/powerpc/kexec/file_load_64.c | 400

[PATCH 05/11] powerpc/drmem: make lmb walk a bit more flexible

2020-06-26 Thread Hari Bathini
n an error is encountered in the callback function. Signed-off-by: Hari Bathini --- arch/powerpc/include/asm/drmem.h |9 ++-- arch/powerpc/kernel/prom.c | 13 +++--- arch/powerpc/mm/drmem.c | 87 +- arch/powerpc/mm/numa.c |

[PATCH 00/11] ppc64: enable kdump support for kexec_file_load syscall

2020-06-26 Thread Hari Bathini
laims kdump support as all the necessary changes are added. Tested the changes successfully on P8, P9 lpars & an OpenPOWER box. --- Hari Bathini (11): kexec_file: allow archs to handle special regions while locating memory hole powerpc/kexec_file: mark PPC64 specific code

[PATCH] powerpc/fadump: account for memory_limit while reserving memory

2020-05-27 Thread Hari Bathini
test robot Fixes: 140777a3d8df ("powerpc/fadump: consider reserved ranges while reserving memory") Cc: sta...@vger.kernel.org Signed-off-by: Hari Bathini --- For reference: - https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-May/211136.html arch/powerpc/kernel/fadump.c |2 +

[PATCH v3 2/2] powerpc/fadump: consider reserved ranges while reserving memory

2020-04-20 Thread Hari Bathini
t failure, when memory reserved for FADump is less than 4096MB. Fixes: 579ca1a27675 ("powerpc/fadump: make use of memblock's bottom up allocation mode") Cc: sta...@vger.kernel.org Signed-off-by: Hari Bathini Reviewed-by: Mahesh Salgaonkar --- Changes in v3: * Updated fadump_locate

[PATCH v3 1/2] powerpc/fadump: use static allocation for reserved memory ranges

2020-04-20 Thread Hari Bathini
fails with memory corruption issues. So, extend memory ranges handling to support static allocation and populate reserved memory ranges during early boot. Fixes: dda9dbfeeb7a ("powerpc/fadump: consider reserved ranges while releasing memory") Cc: sta...@vger.kernel.org Signed-off-b

[PATCH v2 2/2] powerpc/fadump: consider reserved ranges while reserving memory

2020-04-20 Thread Hari Bathini
t failure, when memory reserved for FADump is less than 4096MB. Fixes: 579ca1a27675 ("powerpc/fadump: make use of memblock's bottom up allocation mode") Cc: sta...@vger.kernel.org Signed-off-by: Hari Bathini --- Changes in v2: * Add an out parameter 'found' for fadump_

[PATCH v2 1/2] powerpc/fadump: use static allocation for reserved memory ranges

2020-04-20 Thread Hari Bathini
fails with memory corruption issues. So, extend memory ranges handling to support static allocation and populate reserved memory ranges during early boot. Fixes: dda9dbfeeb7a ("powerpc/fadump: consider reserved ranges while releasing memory") Cc: sta...@vger.kernel.org Signed-off-b

Re: [PATCH 2/2] powerpc/fadump: consider reserved ranges while reserving memory

2020-04-20 Thread Hari Bathini
On 20/04/20 10:50 AM, Mahesh J Salgaonkar wrote: > On 2020-03-11 01:57:10 Wed, Hari Bathini wrote: >> Commit 0962e8004e97 ("powerpc/prom: Scan reserved-ranges node for >> memory reservations") enabled support to parse reserved-ranges DT >> node and reserve kernel

[PATCH v2 2/2] powerpc/fadump: consider reserved ranges while reserving memory

2020-04-20 Thread Hari Bathini
t failure, when memory reserved for FADump is less than 4096MB. Fixes: 579ca1a27675 ("powerpc/fadump: make use of memblock's bottom up allocation mode") Cc: sta...@vger.kernel.org Signed-off-by: Hari Bathini --- Changes in v2: * Add an out parameter 'found' for fadump_

[PATCH v2 1/2] powerpc/fadump: use static allocation for reserved memory ranges

2020-04-20 Thread Hari Bathini
fails with memory corruption issues. So, extend memory ranges handling to support static allocation and populate reserved memory ranges during early boot. Fixes: dda9dbfeeb7a ("powerpc/fadump: consider reserved ranges while releasing memory") Cc: sta...@vger.kernel.org Signed-off-b

Re: [PATCHv4] powerpc/crashkernel: take "mem=" option into account

2020-04-01 Thread Hari Bathini
*/ > limit = ALIGN(memory_limit ?: memblock_phys_mem_size(), PAGE_SIZE); > memblock_enforce_memory_limit(limit); > > While on other arches, the effect of "mem=" takes a higher priority and pass > through memblock_phys_mem_size() before calling reserve_crashkernel(). >> Signed-off

Re: [PATCHv3] powerpc/crashkernel: take "mem=" option into account

2020-03-26 Thread Hari Bathini
at total memory size is page-aligned. */ > limit = ALIGN(memory_limit ?: memblock_phys_mem_size(), PAGE_SIZE); > memblock_enforce_memory_limit(limit); > > While on other arches, the effect of "mem=" takes a higher priority and pass > through memblock_phys_mem_size() before calling re

[PATCH 2/2] powerpc/fadump: consider reserved ranges while reserving memory

2020-03-10 Thread Hari Bathini
t failure, when memory reserved for FADump is less than 4096MB. Fixes: 579ca1a27675 ("powerpc/fadump: make use of memblock's bottom up allocation mode") Cc: sta...@vger.kernel.org # v5.4+ Signed-off-by: Hari Bathini --- arch/powerpc/kernel/fadump.c | 76 +++

[PATCH 1/2] powerpc/fadump: use static allocation for reserved memory ranges

2020-03-10 Thread Hari Bathini
fails with memory corruption issues. So, extend memory ranges handling to support static allocation and populate reserved memory ranges during early boot. Fixes: dda9dbfeeb7a ("powerpc/fadump: consider reserved ranges while releasing memory") Cc: sta...@vger.kernel.org # v5.4+ Signed-off-b

Re: [PATCH 2/2] powerpc/pseries: update device tree before ejecting hotplug uevents

2020-03-02 Thread Hari Bathini
ot-add path. > > This will introduce extra dt updating payload for each involved lmb when > hotplug. > But it should be fine since drmem_update_dt() is memory based operation and > hotplug is not a hot path. > > Signed-off-by: Pingfan Liu > Cc: Michael Ellerman > Cc

Re: [PATCH v6 1/6] Documentation/ABI: add ABI documentation for /sys/kernel/fadump_*

2020-01-07 Thread Hari Bathini
nterfaces. Thanks for looking into this. For the series... Reviewed-by: Hari Bathini > --- > Documentation/ABI/testing/sysfs-kernel-fadump_enabled | 7 +++ > Documentation/ABI/testing/sysfs-kernel-fadump_registered | 8 > Documentation/ABI/testing/sysfs-kernel-f

Re: [PATCH v3] powerpc/fadump: when fadump is supported register the fadump sysfs files.

2019-11-08 Thread Hari Bathini
. Remove the duplicate message in > setup_fadump. Thanks for doing this, Michal. Exporting the node will be helpful in finding if FADump is supported, given FADump is now supported on two different platforms... Reviewed-by: Hari Bathini > > Signed-off-by: Michal Suchanek > --- > v2

Re: [PATCH v2 3/4] Documentation/ABI: mark /sys/kernel/fadump_* sysfs files deprecated

2019-11-05 Thread Hari Bathini
On 05/11/19 2:24 PM, Sourabh Jain wrote: > > > On 10/21/19 1:11 PM, Hari Bathini wrote: >> >> >> On 18/10/19 6:35 PM, Sourabh Jain wrote: >>> The /sys/kernel/fadump_* sysfs files are replicated under >> >> [...] >> >

Re: [PATCH] powerpc/fadump: Remove duplicate message.

2019-10-24 Thread Hari Bathini
Michal, thanks for looking into this. On 23/10/19 11:26 PM, Michal Suchanek wrote: > There is duplicate message about lack of support by firmware in > fadump_reserve_mem and setup_fadump. Due to different capitalization it > is clear that the one in setup_fadump is shown on boot. Remove the > du

Re: [PATCH v2 3/4] Documentation/ABI: mark /sys/kernel/fadump_* sysfs files deprecated

2019-10-21 Thread Hari Bathini
On 18/10/19 6:35 PM, Sourabh Jain wrote: > The /sys/kernel/fadump_* sysfs files are replicated under [...] > +Note: The following FADump sysfs files are deprecated. > + > +Deprecated Alternative > + > ---

[PATCH] powerpc: make syntax for FADump config options in kernel/Makefile readable

2019-10-09 Thread Hari Bathini
arch/powerpc/kernel/fadump.c file needs to be compiled in if 'config FA_DUMP' or 'config PRESERVE_FA_DUMP' is set. The current syntax achieves that but looks a bit odd. Fix it for better readability. Signed-off-by: Hari Bathini --- arch/powerpc/kernel/Makefile |5 ++--

[PATCH] powerpc/configs: add FADump awareness to skiroot_defconfig

2019-10-09 Thread Hari Bathini
FADump is supported on PowerNV platform. To fulfill this support, the petitboot kernel must be FADump aware. Enable config PRESERVE_FA_DUMP to make the petitboot kernel FADump aware. Signed-off-by: Hari Bathini --- arch/powerpc/configs/skiroot_defconfig |1 + 1 file changed, 1 insertion

[PATCH v6 36/36] powernv/fadump: support holes in kernel boot memory area

2019-09-11 Thread Hari Bathini
With support to copy multiple kernel boot memory regions owing to copy size limitation, also handle holes in the memory area to be preserved. Support as many as 128 kernel boot memory regions. This allows having an adequate FADump capture kernel size for different scenarios. Signed-off-by: Hari

[PATCH v6 35/36] powerpc/fadump: remove RMA_START and RMA_END macros

2019-09-11 Thread Hari Bathini
RMA_START is defined as '0' and there is even a BUILD_BUG_ON() to make sure it is never anything else. Remove this macro and use '0' instead as code change is needed anyway when it has to be something else. Also, remove unused RMA_END macro. Signed-off-by: Hari Bathini --- *

[PATCH v6 34/36] powernv/fadump: update documentation about option to release opalcore

2019-09-11 Thread Hari Bathini
With /sys/firmware/opal/core support available on OPAL based machines and an option to the release memory used by kernel in exporting this core file, update FADump documentation with these details. Signed-off-by: Hari Bathini --- * No changes in v6. Documentation/powerpc/firmware-assisted

[PATCH v6 33/36] powerpc/fadump: consider f/w load area

2019-09-11 Thread Hari Bathini
memory requirements on systems with 512M/1024M RMA size. Signed-off-by: Hari Bathini --- * No major changes in v6. arch/powerpc/include/asm/fadump-internal.h | 11 +- arch/powerpc/kernel/fadump.c | 16 ++ arch/powerpc/platforms/powern

[PATCH v6 32/36] powernv/opalcore: provide an option to invalidate /sys/firmware/opal/core file

2019-09-11 Thread Hari Bathini
Writing '1' to /sys/kernel/fadump_release_opalcore would release the memory held by kernel in exporting /sys/firmware/opal/core file. Signed-off-by: Hari Bathini --- * No changes in v6. arch/powerpc/platforms/powernv/opal-core.c | 38 1 file c

[PATCH v6 31/36] powernv/opalcore: export /sys/firmware/opal/core for analysing opal crashes

2019-09-11 Thread Hari Bathini
From: Hari Bathini Export /sys/firmware/opal/core file to analyze opal crashes. Since OPAL core can be generated independent of CONFIG_FA_DUMP support in kernel, add this support under a new kernel config option CONFIG_OPAL_CORE. Also, avoid code duplication by moving common code used while

<    1   2   3   4   5   6   7   8   9   >