Re: [PATCH v3 3/5] powerpc/numa: Use cpu node map of first sibling thread

2019-09-11 Thread Srikar Dronamraju
Hi Nathan, Thanks for your reviews. > > - if ((nid = numa_cpu_lookup_table[lcpu]) >= 0) { > > + nid = numa_cpu_lookup_table[fcpu]; > > + if (nid >= 0) { > > map_cpu_to_node(lcpu, nid); > > return nid; > > } > > Yes, we need to something like this to prevent a

[PATCH v3 1/3] powerpc: Don't add -mabi= flags when building with Clang

2019-09-11 Thread Nathan Chancellor
When building pseries_defconfig, building vdso32 errors out: error: unknown target ABI 'elfv1' This happens because -m32 in clang changes the target to 32-bit, which does not allow the ABI to be changed, as the setABI virtual function is not overridden:

[Bug 204819] New: KASAN still got problems loading some modules at boot

2019-09-11 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204819 Bug ID: 204819 Summary: KASAN still got problems loading some modules at boot Product: Platform Specific/Hardware Version: 2.5 Kernel Version: 5.3-rc8 Hardware: PPC-32 OS:

[PATCH v3 2/3] powerpc: Avoid clang warnings around setjmp and longjmp

2019-09-11 Thread Nathan Chancellor
Commit aea447141c7e ("powerpc: Disable -Wbuiltin-requires-header when setjmp is used") disabled -Wbuiltin-requires-header because of a warning about the setjmp and longjmp declarations. r367387 in clang added another diagnostic around this, complaining that there is no jmp_buf declaration. In

[PATCH] KVM: PPC: Remove superfluous check for non-zero return value

2019-09-11 Thread Thomas Huth
After the kfree()s haven been removed in the previous commit 9798f4ea71ea ("fix rollback when kvmppc_xive_create fails"), the code can be simplified even more to simply always "return ret" now. Signed-off-by: Thomas Huth --- arch/powerpc/kvm/book3s_xive.c| 5 +

Re: [Bug 204789] New: Boot failure with more than 256G of memory

2019-09-11 Thread Cameron Berkenpas
Hello, Regression set to "yes". Not sure how I missed that. :) Will report future PPC issues to that I come across to this list as well. Thanks! -Cameron On 9/11/19 7:31 AM, Andrew Morton wrote: (switched to email. Please respond via emailed reply-to-all, not via the bugzilla web

[PATCH v3 0/3] LLVM/Clang fixes for pseries_defconfig

2019-09-11 Thread Nathan Chancellor
Hi all, This series includes a set of fixes for LLVM/Clang when building pseries_defconfig. These have been floating around as standalone patches so I decided to gather them up as a series so it was easier to review/apply them. The versioning is a bit wonky because of this reason, I have included

[PATCH v3 3/3] powerpc/prom_init: Use -ffreestanding to avoid a reference to bcmp

2019-09-11 Thread Nathan Chancellor
r370454 gives LLVM the ability to convert certain loops into a reference to bcmp as an optimization; this breaks prom_init_check.sh: CALLarch/powerpc/kernel/prom_init_check.sh Error: External symbol 'bcmp' referenced from prom_init.c make[2]: *** [arch/powerpc/kernel/Makefile:196:

[Bug 204819] KASAN still got problems loading some modules at boot

2019-09-11 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204819 --- Comment #1 from Erhard F. (erhar...@mailbox.org) --- Created attachment 284933 --> https://bugzilla.kernel.org/attachment.cgi?id=284933=edit kernel .config (5.3-rc8, PowerMac G4 DP) -- You are receiving this mail because: You are watching

[PATCH v2] KVM: PPC: Book3S HV: use smp_mb() when setting/clearing host_ipi flag

2019-09-11 Thread Michael Roth
On a 2-socket Power9 system with 32 cores/128 threads (SMT4) and 1TB of memory running the following guest configs: guest A: - 224GB of memory - 56 VCPUs (sockets=1,cores=28,threads=2), where: VCPUs 0-1 are pinned to CPUs 0-3, VCPUs 2-3 are pinned to CPUs 4-7, ...

[PATCH 1/3] powernv/pci: Use pnv_phb as the private data for debugfs entries

2019-09-11 Thread Oliver O'Halloran
Use the pnv_phb structure as the private data pointer for the debugfs files. This lets us delete some code and an open-coded use of hose->private_data. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 11 ++- 1 file changed, 2 insertions(+), 9

[PATCH] powerpc/crashkernel: take mem option into account

2019-09-11 Thread Pingfan Liu
'mem=" option is an easy way to put high pressure on memory during some test. Hence in stead of total mem, the effective usable memory size should be considered when reserving mem for crashkernel. Otherwise the boot up may experience oom issue. E.g passing

Re: [PATCH] powerpc/crashkernel: take mem option into account

2019-09-11 Thread Pingfan Liu
NACK it. Due to a miss the updating of printk info. I will send out V2 On Mon, Sep 9, 2019 at 12:05 PM Pingfan Liu wrote: > > 'mem=" option is an easy way to put high pressure on memory during some > test. Hence in stead of total mem, the effective usable memory size should > be considered when

[Bug 204819] KASAN still got problems loading some modules at boot

2019-09-11 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204819 Christophe Leroy (christophe.le...@c-s.fr) changed: What|Removed |Added CC|

[PATCH 2/3] powernv/pci: Allow any write trigger the diag dump

2019-09-11 Thread Oliver O'Halloran
Make the dump trigger off any input rather than just '1'. This allows you to write "echo 1> dump_diag_data" and it'll do what you want rather than erroring out pointlessly. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 3 --- 1 file changed, 3 deletions(-)

Re: [PATCH v3 3/3] powerpc/prom_init: Use -ffreestanding to avoid a reference to bcmp

2019-09-11 Thread Nathan Chancellor
On Wed, Sep 11, 2019 at 02:01:59PM -0700, Nick Desaulniers wrote: > On Wed, Sep 11, 2019 at 11:21 AM Nathan Chancellor > wrote: > > > > r370454 gives LLVM the ability to convert certain loops into a reference > > to bcmp as an optimization; this breaks prom_init_check.sh: > > > > CALL

Re: [PATCH] powerpc/prom_init: Undo relocation before entering secure mode

2019-09-11 Thread Thiago Jung Bauermann
Thiago Jung Bauermann writes: > The ultravisor will do an integrity check of the kernel image but we > relocated it so the check will fail. Restore the original image by > relocating it back to the kernel virtual base address. > > This works because during build vmlinux is linked with an

[PATCH 3/3] powernv/pci: Add a debugfs entry to dump PHB's IODA PE state

2019-09-11 Thread Oliver O'Halloran
Add a debugfs entry to dump the state of the active IODA PEs. The IODA PE state reflects how the PHB's internal concept of a PE is configured. This is separate to the EEH PE state and is managed power the PowerNV PCI backend rather than the EEH core. Signed-off-by: Oliver O'Halloran ---

Re: [PATCH v7 0/5] kasan: support backing vmalloc space with real shadow memory

2019-09-11 Thread Christophe Leroy
Hi Daniel, Are any other patches required prior to this series ? I have tried to apply it on later powerpc/merge branch without success: [root@localhost linux-powerpc]# git am /root/Downloads/kasan-support-backing-vmalloc-space-with-real-shadow-memory\(1\).patch Applying: kasan: support

Re: [mainline][BUG][PPC][btrfs][bisected 00801a] kernel BUG at fs/btrfs/locking.c:71!

2019-09-11 Thread Nikolay Borisov
On 11.09.19 г. 11:00 ч., Abdul Haleem wrote: > On Tue, 2019-09-03 at 13:39 +0300, Nikolay Borisov wrote: >> >> corresponds to? > > btrfs_search_slot+0x8e8/0xb80 maps to fs/btrfs/ctree.c:2751 > write_lock_level = BTRFS_MAX_LEVEL; That doesn't make sense, presumably

Re: [PATCH 1/2] ASoC: fsl_mqs: add DT binding documentation

2019-09-11 Thread Christophe Leroy
Hi Shengjiu, Your mail is dated in the future, its time is 16:42 (GMT+2) whereas it is still the morning. Please fix your clock or timezone for future mails. Thanks Christophe Le 11/09/2019 à 16:42, Shengjiu Wang a écrit : Add the DT binding documentation for NXP MQS driver Signed-off-by:

Re: [mainline][BUG][PPC][btrfs][bisected 00801a] kernel BUG at fs/btrfs/locking.c:71!

2019-09-11 Thread Abdul Haleem
On Tue, 2019-09-03 at 13:39 +0300, Nikolay Borisov wrote: > > On 3.09.19 г. 11:55 ч., Abdul Haleem wrote: > > Greeting's > > > > Mainline kernel panics with LTP/fs_fill-dir tests for btrfs file system on > > my P9 box running mainline kernel 5.3.0-rc5 > > > > BUG_ON was first introduced by

Re: [PATCH] KVM: PPC: Book3S HV: Tunable to configure maximum # of vCPUs per VM

2019-09-11 Thread Greg Kurz
On Wed, 11 Sep 2019 12:30:48 +1000 David Gibson wrote: > On Tue, Sep 10, 2019 at 06:49:34PM +0200, Greg Kurz wrote: > > Each vCPU of a VM allocates a XIVE VP in OPAL which is associated with > > 8 event queue (EQ) descriptors, one for each priority. A POWER9 socket > > can handle a maximum of 1M

Re: [PATCH 3/3] ASoC: fsl_asrc: Fix error with S24_3LE format bitstream in i.MX8

2019-09-11 Thread Mark Brown
On Mon, Sep 09, 2019 at 06:52:13PM -0700, Nicolin Chen wrote: > And a quick feeling is that below code is mostly identical to what > is in the soc-generic-dmaengine-pcm.c file. So I'm wondering if we > could abstract a helper function somewhere in the ASoC core: Mark? That's roughly what

Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-11 Thread Aleksa Sarai
On 2019-09-05, Peter Zijlstra wrote: > On Thu, Sep 05, 2019 at 11:43:05AM +0200, Peter Zijlstra wrote: > > On Thu, Sep 05, 2019 at 07:26:22PM +1000, Aleksa Sarai wrote: > > > On 2019-09-05, Peter Zijlstra wrote: > > > > On Thu, Sep 05, 2019 at 06:19:22AM +1000, Aleksa Sarai wrote: > > > > > +/**

Re: [mainline][BUG][PPC][btrfs][bisected 00801a] kernel BUG at fs/btrfs/locking.c:71!

2019-09-11 Thread Abdul Haleem
On Wed, 2019-09-11 at 11:09 +0300, Nikolay Borisov wrote: > > On 11.09.19 г. 11:00 ч., Abdul Haleem wrote: > > On Tue, 2019-09-03 at 13:39 +0300, Nikolay Borisov wrote: > >> > > > > >> corresponds to? > > > > btrfs_search_slot+0x8e8/0xb80 maps to fs/btrfs/ctree.c:2751 > >

Re: [PATCH 1/2] ASoC: fsl_mqs: add DT binding documentation

2019-09-11 Thread Mark Brown
On Wed, Sep 11, 2019 at 10:42:38AM -0400, Shengjiu Wang wrote: > + - gpr : The gpr node. What is a gpr node? signature.asc Description: PGP signature

Re: [PATCH 2/2] ASoC: fsl_mqs: Add MQS component driver

2019-09-11 Thread Mark Brown
On Wed, Sep 11, 2019 at 10:42:39AM -0400, Shengjiu Wang wrote: This looks good, a few minor comments below but nothing major - it's mostly nits with the DT binding. > --- /dev/null > +++ b/sound/soc/fsl/fsl_mqs.c > @@ -0,0 +1,336 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * ALSA SoC IMX

[PATCH 3/4] powerpc/kvm: Explicitly mark kvm guest code as __init

2019-09-11 Thread Michael Ellerman
All the code in kvm.c can be marked __init. Most of it is already inlined into the initcall, but not all. So instead of relying on the inlining, mark it all as __init. This saves ~280 bytes of text for my configuration. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/kvm.c | 34

Re: [PATCH v7 0/5] kasan: support backing vmalloc space with real shadow memory

2019-09-11 Thread Daniel Axtens
Hi Christophe, > Are any other patches required prior to this series ? I have tried to > apply it on later powerpc/merge branch without success: It applies on the latest linux-next. I didn't base it on powerpc/* because it's generic. Regards, Daniel

[PATCH 1/4] powerpc/kvm: Move kvm_tmp into .text, shrink to 64K

2019-09-11 Thread Michael Ellerman
In some configurations of KVM, guests binary patch themselves to avoid/reduce trapping into the hypervisor. For some instructions this requires replacing one instruction with a sequence of instructions. For those cases we need to write the sequence of instructions somewhere and then patch the

[PATCH 4/4] powerpc/kvm: Add ifdefs around template code

2019-09-11 Thread Michael Ellerman
Some of the templates used for KVM patching are only used on certain platforms, but currently they are always built-in, fix that. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/kvm_emul.S | 8 1 file changed, 8 insertions(+) diff --git a/arch/powerpc/kernel/kvm_emul.S

Re: [PATCH 1/2] libnvdimm/altmap: Track namespace boundaries in altmap

2019-09-11 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE Software Solutions Germany GmbH Maxfeldstr. 5 90409 Nürnberg Germany (HRB 247165, AG München) Key

Re: [PATCH v7 0/5] kasan: support backing vmalloc space with real shadow memory

2019-09-11 Thread Christophe Leroy
Le 11/09/2019 à 13:20, Daniel Axtens a écrit : Hi Christophe, Are any other patches required prior to this series ? I have tried to apply it on later powerpc/merge branch without success: It applies on the latest linux-next. I didn't base it on powerpc/* because it's generic. Ok,

[PATCH 2/4] powerpc/64s: Remove overlaps_kvm_tmp()

2019-09-11 Thread Michael Ellerman
kvm_tmp is now in .text and so doesn't need a special overlap check. Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/sections.h | 11 --- arch/powerpc/mm/book3s64/hash_utils.c | 4 2 files changed, 15 deletions(-) diff --git a/arch/powerpc/include/asm/sections.h

Re: [PATCH] powerpc/xive: Fix bogus error code returned by OPAL

2019-09-11 Thread Michael Ellerman
Hi Greg, Couple of comments ... Greg Kurz writes: > There's a bug in skiboot that causes the OPAL_XIVE_ALLOCATE_IRQ call > to return the 32-bit value 0x when OPAL has run out of IRQs. > Unfortunatelty, OPAL return values are signed 64-bit entities and > errors are supposed to be

Re: [Bug 204789] New: Boot failure with more than 256G of memory

2019-09-11 Thread Andrew Morton
(switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface). On Sun, 08 Sep 2019 00:04:26 + bugzilla-dae...@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=204789 > > Bug ID: 204789 >Summary: Boot failure

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

2019-09-11 Thread Hari Bathini
Add helper functions to setup & free CPU notes buffer and to find if a given memory area is contiguous. Also, use boolean as return type for the function that finds if boot memory area is contiguous. While at it, save the virtual address of CPU notes buffer instead of physical address as virtual

[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.

[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] powerpc/32: add support of KASAN_VMALLOC

2019-09-11 Thread Christophe Leroy
Add support of KASAN_VMALLOC on PPC32. To allow this, the early shadow covering the VMALLOC space need to be removed once high_memory var is set and before freeing memblock. And the VMALLOC area need to be aligned such that boundaries are covered by a full shadow page. Signed-off-by: Christophe

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

2019-09-11 Thread Hari Bathini
Firmware-Assisted Dump (FADump) is currently supported only on pSeries platform. This patch series adds support for PowerNV platform too. The first few patches refactor the FADump code to make use of common code across multiple platforms. Then basic FADump support is added for PowerNV platform.

[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 function.

[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 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 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.

Re: [PATCH v3 3/5] powerpc/numa: Use cpu node map of first sibling thread

2019-09-11 Thread Nathan Lynch
Hi Srikar, Srikar Dronamraju writes: > @@ -467,15 +467,20 @@ static int of_drconf_to_nid_single(struct drmem_lmb > *lmb) > */ > static int numa_setup_cpu(unsigned long lcpu) > { > - int nid = NUMA_NO_NODE; > struct device_node *cpu; > + int fcpu =

[PATCH v2] powerpc/xive: Fix bogus error code returned by OPAL

2019-09-11 Thread Greg Kurz
There's a bug in skiboot that causes the OPAL_XIVE_ALLOCATE_IRQ call to return the 32-bit value 0x when OPAL has run out of IRQs. Unfortunatelty, OPAL return values are signed 64-bit entities and errors are supposed to be negative. If that happens, the linux code confusingly treats

Re: [PATCH] powerpc/xive: Fix bogus error code returned by OPAL

2019-09-11 Thread Greg Kurz
On Thu, 12 Sep 2019 00:26:19 +1000 Michael Ellerman wrote: > Hi Greg, > Bom dia ! :) > Couple of comments ... > > Greg Kurz writes: > > There's a bug in skiboot that causes the OPAL_XIVE_ALLOCATE_IRQ call > > to return the 32-bit value 0x when OPAL has run out of IRQs. > >

Re: [PATCH v2] powerpc/xive: Fix bogus error code returned by OPAL

2019-09-11 Thread Cédric Le Goater
On 11/09/2019 17:52, Greg Kurz wrote: > There's a bug in skiboot that causes the OPAL_XIVE_ALLOCATE_IRQ call > to return the 32-bit value 0x when OPAL has run out of IRQs. > Unfortunatelty, OPAL return values are signed 64-bit entities and > errors are supposed to be negative. If that

[PATCH] powerpc/prom_init: Undo relocation before entering secure mode

2019-09-11 Thread Thiago Jung Bauermann
The ultravisor will do an integrity check of the kernel image but we relocated it so the check will fail. Restore the original image by relocating it back to the kernel virtual base address. This works because during build vmlinux is linked with an expected virtual runtime address of KERNELBASE.

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

2019-09-11 Thread Hari Bathini
Except for Reserved dump area (see Documentation/powerpc/firmware- assisted-dump.rst) which is permanent reserved, all memory above boot memory size, where boot memory size is the memory required for the kernel to boot successfully when booted with restricted memory (memory for capture kernel), is

[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 +-

[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 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_cleanup()

[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

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

2019-09-11 Thread Hari Bathini
Firmware uses a 32-bit field for size while copying/backing-up memory during MPIPL. So, the maximum value that could be represented with a PAGE_SIZE aligned 32-bit field will be the maximum copy size for a region but FADump capture kernel usually needs more memory than that to be preserved to

[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 patch

[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 +++-

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

2019-09-11 Thread Hari Bathini
Earlier, memblock_find_in_range() was not used to find the memory to be reserved for FADump as bottom up allocation mode was not supported. But since commit 79442ed189acb8b ("mm/memblock.c: introduce bottom-up allocation mode") bottom up allocation mode is supported for memblock. So, use it to

[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 in the

[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
Commit 0962e8004e97 ("powerpc/prom: Scan reserved-ranges node for memory reservations") enabled support to parse 'reserved-ranges' DT node to reserve kernel memory falling in these ranges for firmware purposes. Along with the preserved area memory, ensure memory in reserved ranges is not

[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 changed, 38

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

2019-09-11 Thread Hari Bathini
OPAL loads kernel & initrd at 512MB offset (256MB size), also exported as ibm,opal/dump/fw-load-area. So, if boot memory size of FADump is less than 768MB, kernel memory to be exported as '/proc/vmcore' would be overwritten by f/w while loading kernel & initrd. To avoid such a scenario, enforce a

[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.

[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 --- * New patch to remove

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

2019-09-11 Thread Hari Bathini
MPIPL is Memory Preserving IPL supported from POWER9. This enables the kernel to reset the system with memory 'preserved'. Also, it supports copying memory from a source address to some destination address during MPIPL boot. Add MPIPL interface definitions here to leverage these f/w features in

[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/fadump.c | 48

[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 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
Add a new kernel config option, CONFIG_PRESERVE_FA_DUMP that ensures that crash data, from previously crash'ed kernel, is preserved. This helps in cases where FADump is not enabled but the subsequent memory preserving kernel boot is likely to process this crash data. One typical usecase for this

[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 + 1

[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