[PATCH v5 17/31] powernv/fadump: Warn before processing partial crashdump

2019-08-20 Thread Hari Bathini
If all kernel boot memory regions are not registered for MPIPL before system crashes, try processing the partial crashdump but warn the user before proceeding. Signed-off-by: Hari Bathini --- arch/powerpc/platforms/powernv/opal-fadump.c | 24 1 file changed, 24

[PATCH v5 18/31] powernv/fadump: handle invalidation of crashdump and re-registraion

2019-08-20 Thread Hari Bathini
Make OPAL call to indicate that the dump is processed and the metadata area in OPAL can be cleared/released. Also, setup/initialize FADump for re-registration. Signed-off-by: Hari Bathini --- arch/powerpc/kernel/fadump.c |7 ++- arch/powerpc/platforms/powernv/opal

[PATCH v5 19/31] powerpc/fadump: Update documentation about OPAL platform support

2019-08-20 Thread Hari Bathini
With FADump support now available on both pseries and OPAL platforms, update FADump documentation with these details. Signed-off-by: Hari Bathini --- Documentation/powerpc/firmware-assisted-dump.rst | 104 +- 1 file changed, 63 insertions(+), 41 deletions(-) diff --git a

[PATCH v5 20/31] powerpc/fadump: use smaller offset while finding memory for reservation

2019-08-20 Thread Hari Bathini
failure. Signed-off-by: Hari Bathini --- arch/powerpc/kernel/fadump-common.h |8 arch/powerpc/kernel/fadump.c|2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/fadump-common.h b/arch/powerpc/kernel/fadump-common.h index d2dd117

[PATCH v5 21/31] powernv/fadump: process architected register state data provided by firmware

2019-08-20 Thread Hari Bathini
From: Hari Bathini Firmware provides architected register state data at the time of crash. Process this data and build CPU notes to append to ELF core. Signed-off-by: Hari Bathini Signed-off-by: Vasant Hegde --- arch/powerpc/kernel/fadump-common.h |4 + arch/powerpc/platforms

[PATCH v5 22/31] powerpc/fadump: make crash memory ranges array allocation generic

2019-08-20 Thread Hari Bathini
Make allocate_crash_memory_ranges() and free_crash_memory_ranges() functions generic to reuse them for memory management of all types of dynamic memory range arrays. This change helps in memory management of reserved ranges array to be added later. Signed-off-by: Hari Bathini --- arch/powerpc

[PATCH v5 23/31] powerpc/fadump: consider reserved ranges while releasing memory

2019-08-20 Thread Hari Bathini
served ranges is not overlapped with memory released by capture kernel aftering saving vmcore. Also, fix the off-by-one error in fadump_release_reserved_area function while releasing memory. Signed-off-by: Hari Bathini --- arch/powerpc/kernel/fadump.c | 150 +++---

[PATCH v5 24/31] powerpc/fadump: improve how crashed kernel's memory is reserved

2019-08-20 Thread Hari Bathini
The size parameter to fadump_reserve_crash_area() function is not needed as all the memory above boot memory size must be preserved anyway. Update the function by dropping this redundant parameter. Signed-off-by: Hari Bathini --- arch/powerpc/kernel/fadump.c | 53

[PATCH v5 26/31] powerpc/fadump: update documentation about CONFIG_PRESERVE_FA_DUMP

2019-08-20 Thread Hari Bathini
Kernel config option CONFIG_PRESERVE_FA_DUMP is introduced to ensure crash data, from previously crash'ed kernel, is preserved. Update documentation with this details. Signed-off-by: Hari Bathini --- Documentation/powerpc/firmware-assisted-dump.rst |9 + 1 file changed, 9 inser

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

2019-08-20 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

[PATCH v5 25/31] powernv/fadump: add support to preserve crash data on FADUMP disabled kernel

2019-08-20 Thread Hari Bathini
Move arch_reserved_kernel_pages() function as it is needed for both FA_DUMP and PRESERVE_FA_DUMP configurations. Signed-off-by: Hari Bathini --- arch/powerpc/Kconfig |9 +++ arch/powerpc/include/asm/fadump.h|9 ++- arch/powerpc/kernel/Makefile |6 ++

[PATCH v5 28/31] powernv/opalcore: provide an option to invalidate /sys/firmware/opal/core file

2019-08-20 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 --- arch/powerpc/platforms/powernv/opal-core.c | 38 1 file changed, 38 insertions(+) di

[PATCH v5 29/31] powerpc/fadump: consider f/w load area

2019-08-20 Thread Hari Bathini
memory requirements on systems with 512M/1024M RMA size. Signed-off-by: Hari Bathini --- arch/powerpc/kernel/fadump-common.h | 11 +- arch/powerpc/kernel/fadump.c | 11 +- arch/powerpc/platforms/powernv/opal-fadump.c | 29 ++

[PATCH v5 30/31] powernv/fadump: update documentation about option to release opalcore

2019-08-20 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 --- Documentation/powerpc/firmware-assisted-dump.rst | 19

[PATCH v5 31/31] powernv/fadump: support holes in kernel boot memory area

2019-08-20 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

Re: [PATCH v3] powerpc/fadump: sysfs for fadump memory reservation

2019-08-26 Thread Hari Bathini
On 10/08/19 11:29 PM, Sourabh Jain wrote: > Add a sys interface to allow querying the memory reserved by > fadump for saving the crash dump. > > Add an ABI doc entry for new sysfs interface. >- /sys/kernel/fadump_mem_reserved > > Signed-off-by: Sourabh Jain > --- > Changelog: > v1 -> v2:

Re: [PATCH v3] powerpc/fadump: sysfs for fadump memory reservation

2019-08-26 Thread Hari Bathini
On 26/08/19 4:14 PM, Sourabh Jain wrote: > > > On 8/26/19 3:46 PM, Sourabh Jain wrote: >> >> >> On 8/26/19 3:29 PM, Hari Bathini wrote: >>> >>> >>> On 10/08/19 11:29 PM, Sourabh Jain wrote: >>>> Add a sys interface to allow que

Re: [PATCH v3] powerpc/fadump: sysfs for fadump memory reservation

2019-08-26 Thread Hari Bathini
On 27/08/19 8:49 AM, Michael Ellerman wrote: > Hari Bathini writes: >> On 26/08/19 4:14 PM, Sourabh Jain wrote: >>> On 8/26/19 3:46 PM, Sourabh Jain wrote: >>>> On 8/26/19 3:29 PM, Hari Bathini wrote: >>>>> On 10/08/19 11:29 PM, Sourabh Jain wrote:

[RESEND PATCH v5 13/31] powernv/fadump: reset metadata address during clean up

2019-08-27 Thread Hari Bathini
During kexec boot, metadata address needs to be reset to avoid running into errors interpreting stale metadata address, in case the kexec'ed kernel crashes before metadata address could be setup again. Signed-off-by: Hari Bathini --- * Added check in fadump_cleanup() function for whether F

Re: [PATCH v5 13/31] powernv/fadump: reset metadata address during clean up

2019-08-27 Thread Hari Bathini
On 20/08/19 5:35 PM, Hari Bathini wrote: > During kexec boot, metadata address needs to be reset to avoid running > into errors interpreting stale metadata address, in case the kexec'ed > kernel crashes before metadata address could be setup again. > > Signed-

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

2019-08-27 Thread Hari Bathini
Hi Michal, Thanks for the patch. On 20/08/19 11:42 PM, Michal Suchanek wrote: > Currently it is not possible to distinguish the case when fadump is > supported by firmware and disabled in kernel and completely unsupported > using the kernel sysfs interface. User can investigate the devicetree

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

2019-08-28 Thread Hari Bathini
On 28/08/19 10:37 PM, Michal Suchánek wrote: > On Tue, 27 Aug 2019 17:57:31 +0530 > Hari Bathini wrote: > [...] >> Also, get rid of the error message when fadump is >> not supported as it is already taken care of in fadump_reserve_mem() >> function. > >

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

2019-08-28 Thread Hari Bathini
age already logged during early boot in fadump_reserve_mem() function. I am not strongly against this though. So... Acked-by: Hari Bathini

Re: [PATCH v5 02/31] powerpc/fadump: move internal code to a new file

2019-09-03 Thread Hari Bathini
On 03/09/19 4:39 PM, Michael Ellerman wrote: > Hari Bathini writes: >> Make way for refactoring platform specific FADump code by moving code >> that could be referenced from multiple places to fadump-common.c file. >> >> Signed-off-by: Hari Bathini >> ---

Re: [PATCH v5 01/31] powerpc/fadump: move internal macros/definitions to a new header

2019-09-03 Thread Hari Bathini
On 03/09/19 4:39 PM, Michael Ellerman wrote: > Hari Bathini writes: >> Though asm/fadump.h is meant to be used by other components dealing >> with FADump, it also has macros/definitions internal to FADump code. >> Move them to a new header file used within FADump code. T

Re: [PATCH v5 05/31] pseries/fadump: introduce callbacks for platform specific operations

2019-09-03 Thread Hari Bathini
On 03/09/19 4:40 PM, Michael Ellerman wrote: > Hari Bathini writes: >> Introduce callback functions for platform specific operations like >> register, unregister, invalidate & such. Also, define place-holders >> for the same on pSeries platform. > > We al

Re: [PATCH v5 07/31] powerpc/fadump: release all the memory above boot memory size

2019-09-03 Thread Hari Bathini
On 03/09/19 4:40 PM, Michael Ellerman wrote: > Hari Bathini writes: > >> Except for reserve dump area which is permanent reserved, all memory > permanently > >> above boot memory size is released when the dump is invalidated.

Re: [PATCH v5 10/31] opal: add MPIPL interface definitions

2019-09-03 Thread Hari Bathini
On 03/09/19 4:40 PM, Michael Ellerman wrote: > Hari Bathini writes: >> diff --git a/arch/powerpc/include/asm/opal-api.h >> b/arch/powerpc/include/asm/opal-api.h >> index 383242e..c8a5665 100644 >> --- a/arch/powerpc/include/asm/opal-api.h >> +++ b/ar

Re: [PATCH v5 11/31] powernv/fadump: add fadump support on powernv

2019-09-03 Thread Hari Bathini
On 03/09/19 4:40 PM, Michael Ellerman wrote: > Hari Bathini writes: >> Add basic callback functions for FADump on PowerNV platform. > > I assume this doesn't actually work yet? > > Does something block it from appearing to work at runtime? With this patch, "

Re: [PATCH v5 06/31] pseries/fadump: define register/un-register callback functions

2019-09-03 Thread Hari Bathini
On 03/09/19 4:40 PM, Michael Ellerman wrote: > Hari Bathini writes: >> Make RTAS calls to register and un-register for FADump. Also, update >> how fadump_region contents are diplayed to provide more information. > > That sounds like two independent changes, so can t

Re: [PATCH v5 11/31] powernv/fadump: add fadump support on powernv

2019-09-04 Thread Hari Bathini
On 03/09/19 10:01 PM, Hari Bathini wrote: > [...] >>> diff --git a/arch/powerpc/kernel/fadump-common.h >>> b/arch/powerpc/kernel/fadump-common.h >>> index d2c5b16..f6c52d3 100644 >>> --- a/arch/powerpc/kernel/fadump-common.h >>> +++ b/arch/powe

Re: [PATCH v5 02/31] powerpc/fadump: move internal code to a new file

2019-09-04 Thread Hari Bathini
On 04/09/19 2:32 PM, Mahesh Jagannath Salgaonkar wrote: > On 9/3/19 9:35 PM, Hari Bathini wrote: >> >> >> On 03/09/19 4:39 PM, Michael Ellerman wrote: >>> Hari Bathini writes: >>>> Make way for refactoring platform specific FADump code by moving code &

Re: [PATCH v5 15/31] powernv/fadump: support copying multiple kernel boot memory regions

2019-09-04 Thread Hari Bathini
On 04/09/19 5:00 PM, Michael Ellerman wrote: > Hari Bathini writes: >> Firmware uses 32-bit field for region size while copying/backing-up > > Which firmware exactly is imposing that limit? I think the MDST/MDRT tables in the f/w. Vasant, which co

Re: [PATCH v5 16/31] powernv/fadump: process the crashdump by exporting it as /proc/vmcore

2019-09-04 Thread Hari Bathini
On 04/09/19 5:12 PM, Michael Ellerman wrote: > Hari Bathini writes: >> diff --git a/arch/powerpc/platforms/powernv/opal-fadump.c >> b/arch/powerpc/platforms/powernv/opal-fadump.c >> index a755705..10f6086 100644 >> --- a/arch/powerpc/platforms/powernv/opal-fad

Re: [PATCH v5 14/31] powernv/fadump: define register/un-register callback functions

2019-09-05 Thread Hari Bathini
On 05/09/19 12:53 PM, Michael Ellerman wrote: > Hari Bathini writes: >> diff --git a/arch/powerpc/platforms/powernv/opal-fadump.c >> b/arch/powerpc/platforms/powernv/opal-fadump.c >> index e466f7e..91fb909 100644 >> --- a/arch/powerpc/platforms/powernv/opal-fad

Re: [PATCH v5 05/31] pseries/fadump: introduce callbacks for platform specific operations

2019-09-05 Thread Hari Bathini
On 03/09/19 9:36 PM, Hari Bathini wrote: > > > On 03/09/19 4:40 PM, Michael Ellerman wrote: >> Hari Bathini writes: >>> Introduce callback functions for platform specific operations like >>> register, unregister, invalidate & such. Also, define plac

Re: [PATCH v5 21/31] powernv/fadump: process architected register state data provided by firmware

2019-09-09 Thread Hari Bathini
On 04/09/19 5:50 PM, Michael Ellerman wrote: > Hari Bathini writes: > [...] >> +/* >> + * CPU state data is provided by f/w. Below are the definitions >> + * provided in HDAT spec. Refer to latest HDAT specification for >> + * any update to this format. >>

Re: [PATCH v5 21/31] powernv/fadump: process architected register state data provided by firmware

2019-09-10 Thread Hari Bathini
On 09/09/19 9:03 PM, Oliver O'Halloran wrote: > On Mon, Sep 9, 2019 at 11:23 PM Hari Bathini wrote: >> >> On 04/09/19 5:50 PM, Michael Ellerman wrote: >>> Hari Bathini writes: >>> >> >> [...] >> >>>> +/* >>>> +

Re: [PATCH v5 21/31] powernv/fadump: process architected register state data provided by firmware

2019-09-10 Thread Hari Bathini
On 10/09/19 7:35 PM, Michael Ellerman wrote: > Hari Bathini writes: >> On 09/09/19 9:03 PM, Oliver O'Halloran wrote: >>> On Mon, Sep 9, 2019 at 11:23 PM Hari Bathini wrote: >>>> On 04/09/19 5:50 PM, Michael Ellerman wrote: >>>>> Hari Bathini

[PATCH v6 00/36] Add FADump support on PowerNV platform

2019-09-11 Thread Hari Bathini
patches based on discussions with mahesh on V4. --- Hari Bathini (36): powerpc/fadump: move internal macros/definitions to a new header powerpc/fadump: add helper functions powerpc/fadump: declare helper functions in internal header file powerpc/fadump: Improve fadump

[PATCH v6 01/36] powerpc/fadump: move internal macros/definitions to a new header

2019-09-11 Thread Hari Bathini
Though asm/fadump.h is meant to be used by other components dealing with FADump, it also has macros/definitions internal to FADump code. Move them to a new header file used within FADump code. This also makes way for refactoring platform specific FADump code. Signed-off-by: Hari Bathini

[PATCH v6 02/36] powerpc/fadump: add helper functions

2019-09-11 Thread Hari Bathini
tual address is used often. Signed-off-by: Hari Bathini --- * New patch to add a few helper functions. Also, save vaddr for CPU notes buffer in fw_dump structure. arch/powerpc/include/asm/fadump-internal.h |2 arch/powerpc/kernel/fadump.c | 127 +++

[PATCH v6 03/36] powerpc/fadump: declare helper functions in internal header file

2019-09-11 Thread Hari Bathini
Declare helper functions, that can be reused by multiple platforms, in the internal header file. Signed-off-by: Hari Bathini --- Changes in v6: * Declare helper functions in internal header while keeping the definitions in arch/powerpc/kernel/fadump.c itself. arch/powerpc/include/asm

[PATCH v6 04/36] powerpc/fadump: Improve fadump documentation

2019-09-11 Thread Hari Bathini
The figures depicting FADump's (Firmware-Assisted Dump) memory layout are missing some finer details like different memory regions and what they represent. Improve the documentation by updating those details. Signed-off-by: Hari Bathini --- * No changes in v6. Documentation/powerpc/fir

[PATCH v6 05/36] powerpc/fadump: use helper functions to reserve/release cpu notes buffer

2019-09-11 Thread Hari Bathini
Use helper functions to simplify memory allocation, pinning down and freeing the memory used for CPU notes buffer. Signed-off-by: Hari Bathini --- * New patch to improve CPU notes buffer allocation. arch/powerpc/kernel/fadump.c | 21 ++--- 1 file changed, 6 insertions

[PATCH v6 06/36] pseries/fadump: move rtas specific definitions to platform code

2019-09-11 Thread Hari Bathini
Currently, FADump is only supported on pSeries but that is going to change soon with FADump support being added on PowerNV platform. So, move rtas specific definitions to platform code to allow FADump to have multiple platforms support. Signed-off-by: Hari Bathini --- Changes in v6: * Use

[PATCH v6 07/36] pseries/fadump: introduce callbacks for platform specific operations

2019-09-11 Thread Hari Bathini
Introduce callback functions for platform specific operations like register, unregister, invalidate & such. Also, define place-holders for the same on pSeries platform. Signed-off-by: Hari Bathini --- Changes in v6: * Drop using unnecessary return type for platform specific DT scan func

[PATCH v6 08/36] pseries/fadump: define RTAS register/un-register callback functions

2019-09-11 Thread Hari Bathini
Move platform specific register/un-register code, the RTAS calls, to register/un-register callback functions. This would also mean moving code that initializes and prints the platform specific FADump data. Signed-off-by: Hari Bathini Reviewed-by: Mahesh Salgaonkar --- Changes in v6: * Split

[PATCH v6 09/36] pseries/fadump: add source info while displaying region contents

2019-09-11 Thread Hari Bathini
Improve how fadump_region contents are displayed by adding source information of memory regions that are to be dumped by f/w. Signed-off-by: Hari Bathini --- * New patch to update how fadump region contents are displayed. arch/powerpc/platforms/pseries/rtas-fadump.c |8 1 file

[PATCH v6 10/36] powerpc/fadump: release all the memory above boot memory size

2019-09-11 Thread Hari Bathini
released when the dump is invalidated. Make this a bit more explicit in the code. Signed-off-by: Hari Bathini --- Changes in v6: * Changelog update. arch/powerpc/kernel/fadump.c | 34 ++ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/arch

[PATCH v6 11/36] pseries/fadump: move out platform specific support from generic code

2019-09-11 Thread Hari Bathini
Move code that supports processing the crash'ed kernel's memory preserved by firmware to platform specific callback functions. Signed-off-by: Hari Bathini --- * No major changes in v6. arch/powerpc/kernel/fadump.c | 329 +- arch/powerpc

[PATCH v6 12/36] powerpc/fadump: use FADump instead of fadump for how it is pronounced

2019-09-11 Thread Hari Bathini
fadump is pronounced f-a-dump. Update documentation accordingly. Also, update how fadump_region contents look like with recent changes. Signed-off-by: Hari Bathini --- * No changes in v6. Documentation/powerpc/firmware-assisted-dump.rst | 55 -- 1 file changed, 30

[PATCH v6 13/36] opal: add MPIPL interface definitions

2019-09-11 Thread Hari Bathini
eatures in adding FADump support for PowerNV platform. Signed-off-by: Hari Bathini --- Changes in v6: * Changelog update. * Make sure asm/opal-api.h stays consistent with skiboot's opal-api.h arch/powerpc/include/asm/opal-api.h| 44 +++- arch/powerpc/inc

[PATCH v6 15/36] powerpc/fadump: improve fadump_reserve_mem()

2019-09-11 Thread Hari Bathini
Some code clean-up like using minimal assignments and updating printk messages. Also, add an 'error_out' label for handling error cleanup at one place. Signed-off-by: Hari Bathini --- * New patch for code clean-up. arch/powerpc/kernel/fadum

[PATCH v6 14/36] powernv/fadump: add fadump support on powernv

2019-09-11 Thread Hari Bathini
Add basic callback functions for FADump on PowerNV platform. Signed-off-by: Hari Bathini --- Changes in v6: * Drop using unnecessary return type for platform specific DT scan function. arch/powerpc/Kconfig |5 + arch/powerpc/include/asm/fadump-internal.h

[PATCH v6 16/36] powernv/fadump: register kernel metadata address with opal

2019-09-11 Thread Hari Bathini
OPAL allows registering address with it in the first kernel and retrieving it after MPIPL. Setup kernel metadata and register its address with OPAL to use it for processing the crash dump. Signed-off-by: Hari Bathini --- Changes in v6: * Use kernel types instead of ulong and such * Drop

[PATCH v6 17/36] powernv/fadump: reset metadata address during clean up

2019-09-11 Thread Hari Bathini
During kexec boot, metadata address needs to be reset to avoid running into errors interpreting stale metadata address, in case the kexec'ed kernel crashes before metadata address could be setup again. Signed-off-by: Hari Bathini --- Changes in v6: * Drop shallow rtas_fadump_cl

[PATCH v6 18/36] powernv/fadump: define OPAL register/un-register callback functions

2019-09-11 Thread Hari Bathini
Make OPAL calls to register and un-register with firmware for MPIPL. Signed-off-by: Hari Bathini --- Changes in v6: * Fix compiler warnings. arch/powerpc/platforms/powernv/opal-fadump.c | 79 +- 1 file changed, 77 insertions(+), 2 deletions(-) diff --git a/arch

[PATCH v6 19/36] powernv/fadump: support copying multiple kernel boot memory regions

2019-09-11 Thread Hari Bathini
avoid running into out of memory errors. So, request firmware to copy multiple kernel boot memory regions instead of just one (which worked fine for pseries as 64-bit field was used for size there). Signed-off-by: Hari Bathini --- * No major changes in v6. arch/powerpc/platforms/powernv/opal

[PATCH v6 20/36] powernv/fadump: process the crashdump by exporting it as /proc/vmcore

2019-09-11 Thread Hari Bathini
Add support in the kernel to process the crash'ed kernel's memory preserved during MPIPL and export it as /proc/vmcore file for the userland scripts to filter and analyze it later. Signed-off-by: Hari Bathini --- Changes in v6: * Drop the TODO that is anyway removed later in this pa

[PATCH v6 21/36] powernv/fadump: Warn before processing partial crashdump

2019-09-11 Thread Hari Bathini
If all kernel boot memory regions are not registered for MPIPL before system crashes, try processing the partial crashdump but warn the user before proceeding. Signed-off-by: Hari Bathini --- Changes in v6: * Use prints suggested by mpe. arch/powerpc/platforms/powernv/opal-fadump.c | 24

[PATCH v6 22/36] powernv/fadump: handle invalidation of crashdump and re-registraion

2019-09-11 Thread Hari Bathini
Make OPAL call to indicate that the dump is processed and the metadata area in OPAL can be cleared/released. Also, setup/initialize FADump for re-registration. Signed-off-by: Hari Bathini --- * No major changes in v6. arch/powerpc/kernel/fadump.c |8 +++- arch/powerpc

[PATCH v6 23/36] powerpc/fadump: Update documentation about OPAL platform support

2019-09-11 Thread Hari Bathini
With FADump support now available on both pseries and OPAL platforms, update FADump documentation with these details. Signed-off-by: Hari Bathini --- Changes in v6: * Specific the firmware release versions that support MPIPL. Documentation/powerpc/firmware-assisted-dump.rst | 122

[PATCH v6 24/36] powerpc/fadump: make use of memblock's bottom up allocation mode

2019-09-11 Thread Hari Bathini
use it to find the memory to be reserved for FADump. Signed-off-by: Hari Bathini --- Changes in v6: * Avoid hacky code and use memblock_find_in_range with bottom up allocation mode supported now. arch/powerpc/kernel/fadump.c | 26 -- 1 file changed, 12 inserti

[PATCH v6 25/36] powernv/fadump: process architected register state data provided by firmware

2019-09-11 Thread Hari Bathini
From: Hari Bathini Firmware provides architected register state data at the time of crash. Process this data and build CPU notes to append to ELF core. In case this data is missing or in unsupported format, at least append crashing CPU's register data, to have something to work with i

[PATCH v6 26/36] powerpc/fadump: make crash memory ranges array allocation generic

2019-09-11 Thread Hari Bathini
Make allocate_crash_memory_ranges() and free_crash_memory_ranges() functions generic to reuse them for memory management of all types of dynamic memory range arrays. This change helps in memory management of reserved ranges array to be added later. Signed-off-by: Hari Bathini --- Changes in v6

[PATCH v6 27/36] powerpc/fadump: consider reserved ranges while releasing memory

2019-09-11 Thread Hari Bathini
served ranges is not overlapped with memory released by capture kernel aftering saving vmcore. Also, fix the off-by-one error in fadump_release_reserved_area function while releasing memory. Signed-off-by: Hari Bathini --- Changes in v6: * Use kernel types where possible. arch/powerpc/ke

[PATCH v6 28/36] powerpc/fadump: improve how crashed kernel's memory is reserved

2019-09-11 Thread Hari Bathini
The size parameter to fadump_reserve_crash_area() function is not needed as all the memory above boot memory size must be preserved anyway. Update the function by dropping this redundant parameter. Signed-off-by: Hari Bathini --- * No major changes in v6. arch/powerpc/kernel/fadump.c | 53

[PATCH v6 29/36] powernv/fadump: add support to preserve crash data on FADUMP disabled kernel

2019-09-11 Thread Hari Bathini
Move arch_reserved_kernel_pages() function as it is needed for both FA_DUMP and PRESERVE_FA_DUMP configurations. Signed-off-by: Hari Bathini --- Changes in v6: * Make mpipl-boot node processing code unindented & use kernel types where possible. arch/powerpc/Kconfig |9 +++ arc

[PATCH v6 30/36] powerpc/fadump: update documentation about CONFIG_PRESERVE_FA_DUMP

2019-09-11 Thread Hari Bathini
Kernel config option CONFIG_PRESERVE_FA_DUMP is introduced to ensure crash data, from previously crash'ed kernel, is preserved. Update documentation with this details. Signed-off-by: Hari Bathini --- * No changes in v6. Documentation/powerpc/firmware-assisted-dump.rst |9 +++

[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

[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 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 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 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 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] 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] 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 v4 4/5] powerpc/code-patching: introduce patch_instructions()

2023-09-08 Thread Hari Bathini
, clears the pte and flushes the tlb only once per page range of instructions to be patched. This adds a slight overhead to patch_instruction() call while improving the patching time for scenarios where more than one instruction needs to be patched. Signed-off-by: Hari Bathini --- arch/powerpc

[PATCH v4 5/5] powerpc/bpf: use patch_instructions()

2023-09-08 Thread Hari Bathini
.160s # With this patch (on a POWER9 lpar): # time modprobe test_bpf real0m5.013s user0m0.000s sys 0m4.216s # Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp.c | 34 ++--- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a

[PATCH v3 1/2] vmcore: remove dependency with is_kdump_kernel() for exporting vmcore

2023-09-12 Thread Hari Bathini
://docs.kernel.org/powerpc/firmware-assisted-dump.html Suggested-by: Michael Ellerman Signed-off-by: Hari Bathini --- Changes in v3: * Decoupled is_vmcore_usable() & vmcore_unusable() from is_kdump_kernel() as suggested here: https://lore.kernel.org/linuxppc-dev/ZP7si3UMVpPfYV+w@MiWiFi-R3L-s

[PATCH v3 2/2] powerpc/fadump: make is_kdump_kernel() return false when fadump is active

2023-09-12 Thread Hari Bathini
not desirable for fadump - eg. IO queues restriction in device drivers. So, define is_kdump_kernel() to return false when f/w assisted dump is active. Signed-off-by: Hari Bathini --- arch/powerpc/include/asm/kexec.h | 8 ++-- arch/powerpc/kernel/crash_dump.c | 12 2 files

Re: [PATCH v2 2/3] vmcore: allow fadump to export vmcore even if is_kdump_kernel() is false

2023-09-12 Thread Hari Bathini
On 11/09/23 4:01 pm, Baoquan He wrote: On 09/11/23 at 05:13pm, Michael Ellerman wrote: Hari Bathini writes: Currently, is_kdump_kernel() returns true when elfcorehdr_addr is set. While elfcorehdr_addr is set for kexec based kernel dump mechanism, alternate dump capturing methods like

Re: [PATCH v4 8/8] bpf ppc32: Access only if addr is kernel address

2023-09-14 Thread Hari Bathini
On 14/09/23 11:48 am, Christophe Leroy wrote: Hi, Hi Christophe, Le 29/09/2021 à 13:18, Hari Bathini a écrit : With KUAP enabled, any kernel code which wants to access userspace needs to be surrounded by disable-enable KUAP. But that is not happening for BPF_PROBE_MEM load instruction

Re: [PATCH] powerpc: add `cur_cpu_spec` symbol to vmcoreinfo

2023-09-14 Thread Hari Bathini
On 14/09/23 6:52 pm, Michael Ellerman wrote: Aditya Gupta writes: Presently, while reading a vmcore, makedumpfile uses `cur_cpu_spec.mmu_features` to decide whether the crashed system had RADIX MMU or not. Currently, makedumpfile fails to get the `cur_cpu_spec` symbol (unless a vmlinux is p

Re: [PATCH v4 0/5] powerpc/bpf: use BPF prog pack allocator

2023-09-24 Thread Hari Bathini
Ping! Comments, please.. On 08/09/23 6:57 pm, Hari Bathini wrote: Most BPF programs are small, but they consume a page each. For systems with busy traffic and many BPF programs, this may also add significant pressure on instruction TLB. High iTLB pressure usually slows down the whole system

[PATCH v5 0/5] powerpc/bpf: use BPF prog pack allocator

2023-09-28 Thread Hari Bathini
prove code readability. Hari Bathini (5): powerpc/code-patching: introduce patch_instructions() powerpc/bpf: implement bpf_arch_text_copy powerpc/bpf: implement bpf_arch_text_invalidate for bpf_prog_pack powerpc/bpf: rename powerpc64_jit_data to powerpc_jit_data powerpc/bpf: use bpf_

[PATCH v5 1/5] powerpc/code-patching: introduce patch_instructions()

2023-09-28 Thread Hari Bathini
, clears the pte and flushes the tlb only once per page range of instructions to be patched. This adds a slight overhead to patch_instruction() call while improving the patching time for scenarios where more than one instruction needs to be patched. Signed-off-by: Hari Bathini --- arch/powerpc

[PATCH v5 2/5] powerpc/bpf: implement bpf_arch_text_copy

2023-09-28 Thread Hari Bathini
bpf_arch_text_copy is used to dump JITed binary to RX page, allowing multiple BPF programs to share the same page. Use the newly introduced patch_instructions() to implement it. Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp.c | 20 +++- 1 file changed, 19

[PATCH v5 3/5] powerpc/bpf: implement bpf_arch_text_invalidate for bpf_prog_pack

2023-09-28 Thread Hari Bathini
Implement bpf_arch_text_invalidate and use it to fill unused part of the bpf_prog_pack with trap instructions when a BPF program is freed. Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/arch/powerpc/net

[PATCH v5 4/5] powerpc/bpf: rename powerpc64_jit_data to powerpc_jit_data

2023-09-28 Thread Hari Bathini
powerpc64_jit_data is a misnomer as it is meant for both ppc32 and ppc64. Rename it to powerpc_jit_data. Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net

[PATCH v5 5/5] powerpc/bpf: use bpf_jit_binary_pack_[alloc|finalize|free]

2023-09-28 Thread Hari Bathini
t got bpf_jit_binary_pack_finalize() yet. Implement custom bpf_jit_free() like in commit 1d5f82d9dd47 ("bpf, x86: fix freeing of not-finalized bpf_prog_pack") to call bpf_jit_binary_pack_finalize(), if necessary. As bpf_flush_icache() is not needed anymore, remove it. Signed-off-by: Hari Bat

Re: [PATCH v4 4/5] powerpc/code-patching: introduce patch_instructions()

2023-09-28 Thread Hari Bathini
On 26/09/23 12:21 pm, Christophe Leroy wrote: Le 26/09/2023 à 00:50, Song Liu a écrit : On Fri, Sep 8, 2023 at 6:28 AM Hari Bathini wrote: patch_instruction() entails setting up pte, patching the instruction, clearing the pte and flushing the tlb. If multiple instructions need to be

Re: [PATCH v5 1/5] powerpc/code-patching: introduce patch_instructions()

2023-10-06 Thread Hari Bathini
Hi Christophe, On 29/09/23 2:09 pm, Christophe Leroy wrote: Le 28/09/2023 à 21:48, Hari Bathini a écrit : patch_instruction() entails setting up pte, patching the instruction, clearing the pte and flushing the tlb. If multiple instructions need to be patched, every instruction would have to

Re: [PATCH v5 1/5] powerpc/code-patching: introduce patch_instructions()

2023-10-06 Thread Hari Bathini
Thanks for the review, Song. On 29/09/23 2:38 am, Song Liu wrote: On Thu, Sep 28, 2023 at 12:48 PM Hari Bathini wrote: patch_instruction() entails setting up pte, patching the instruction, clearing the pte and flushing the tlb. If multiple instructions need to be patched, every instruction

Re: [PATCHv8 3/5] powerpc/setup: Handle the case when boot_cpuid greater than nr_cpus

2023-10-10 Thread Hari Bathini
On 09/10/23 5:00 pm, Pingfan Liu wrote: If the boot_cpuid is smaller than nr_cpus, it requires extra effort to ensure the boot_cpu is in cpu_present_mask. This can be achieved by reserving the last quota for the boot cpu. Note: the restriction on nr_cpus will be lifted with more effort in the

Re: [PATCHv8 2/5] powerpc/setup: Loosen the mapping between cpu logical id and its seq in dt

2023-10-10 Thread Hari Bathini
On 09/10/23 5:00 pm, Pingfan Liu wrote: *** Idea *** For kexec -p, the boot cpu can be not the cpu0, this causes the problem of allocating memory for paca_ptrs[]. However, in theory, there is no requirement to assign cpu's logical id as its present sequence in the device tree. But there is som

Re: [PATCHv8 3/5] powerpc/setup: Handle the case when boot_cpuid greater than nr_cpus

2023-10-11 Thread Hari Bathini
On 11/10/23 8:35 am, Pingfan Liu wrote: On Tue, Oct 10, 2023 at 01:56:13PM +0530, Hari Bathini wrote: On 09/10/23 5:00 pm, Pingfan Liu wrote: If the boot_cpuid is smaller than nr_cpus, it requires extra effort to ensure the boot_cpu is in cpu_present_mask. This can be achieved by

[PATCH v6 0/5] powerpc/bpf: use BPF prog pack allocator

2023-10-12 Thread Hari Bathini
ns() to help with patching bpf programs. Hari Bathini (5): powerpc/code-patching: introduce patch_instructions() powerpc/bpf: implement bpf_arch_text_copy powerpc/bpf: implement bpf_arch_text_invalidate for bpf_prog_pack powerpc/bpf: rename powerpc64_jit_data to powerpc_j

[PATCH v6 1/5] powerpc/code-patching: introduce patch_instructions()

2023-10-12 Thread Hari Bathini
, clears the pte and flushes the tlb only once per page range of instructions to be patched. This duplicates most of the code patching logic, instead of merging with it, to avoid performance degradation observed for single instruction patching on ppc32 with the code path merged. Signed-off-by: Hari

<    1   2   3   4   5   6   7   8   9   >