From: Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com>
To: Hari Bathini <hbathini@linux.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@linux.ibm.com>,
Mahesh J Salgaonkar <mahesh@linux.ibm.com>,
Vasant Hegde <hegdevasant@linux.ibm.com>,
linuxppc-dev <linuxppc-dev@ozlabs.org>, Oliver <oohall@gmail.com>,
Nicholas Piggin <npiggin@gmail.com>,
Stewart Smith <stewart@linux.ibm.com>,
Daniel Axtens <dja@axtens.net>
Subject: Re: [PATCH v4 11/25] powernv/fadump: register kernel metadata address with opal
Date: Wed, 14 Aug 2019 15:51:52 +0530 [thread overview]
Message-ID: <8d91f41e-c9c1-2397-1570-62de7a775093@linux.vnet.ibm.com> (raw)
In-Reply-To: <6d34b5d7-5183-6222-1bdb-5b1b7291fc0a@linux.ibm.com>
On 8/14/19 12:36 PM, Hari Bathini wrote:
>
>
> On 13/08/19 4:11 PM, Mahesh J Salgaonkar wrote:
>> On 2019-07-16 17:03:15 Tue, Hari Bathini wrote:
>>> 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 <hbathini@linux.ibm.com>
>>> ---
>>> arch/powerpc/kernel/fadump-common.h | 4 +
>>> arch/powerpc/kernel/fadump.c | 65 ++++++++++++++---------
>>> arch/powerpc/platforms/powernv/opal-fadump.c | 73 ++++++++++++++++++++++++++
>>> arch/powerpc/platforms/powernv/opal-fadump.h | 37 +++++++++++++
>>> arch/powerpc/platforms/pseries/rtas-fadump.c | 32 +++++++++--
>>> 5 files changed, 177 insertions(+), 34 deletions(-)
>>> create mode 100644 arch/powerpc/platforms/powernv/opal-fadump.h
>>>
>> [...]
>>> @@ -346,30 +349,42 @@ int __init fadump_reserve_mem(void)
>>> * use memblock_find_in_range() here since it doesn't allocate
>>> * from bottom to top.
>>> */
>>> - for (base = fw_dump.boot_memory_size;
>>> - base <= (memory_boundary - size);
>>> - base += size) {
>>> + while (base <= (memory_boundary - size)) {
>>> if (memblock_is_region_memory(base, size) &&
>>> !memblock_is_region_reserved(base, size))
>>> break;
>>> +
>>> + base += size;
>>> }
>>> - if ((base > (memory_boundary - size)) ||
>>> - memblock_reserve(base, size)) {
>>> +
>>> + if (base > (memory_boundary - size)) {
>>> + pr_err("Failed to find memory chunk for reservation\n");
>>> + goto error_out;
>>> + }
>>> + fw_dump.reserve_dump_area_start = base;
>>> +
>>> + /*
>>> + * Calculate the kernel metadata address and register it with
>>> + * f/w if the platform supports.
>>> + */
>>> + if (fw_dump.ops->setup_kernel_metadata(&fw_dump) < 0)
>>> + goto error_out;
>>
>> I see setup_kernel_metadata() registers the metadata address with opal without
>> having any minimum data initialized in it. Secondaly, why can't this wait until> registration ? I think we should defer this until fadump registration.
>
> If setting up metadata address fails (it should ideally not fail, but..), everything else
> is useless.
That's less likely.. so is true with opal_mpipl_update() as well.
> So, we might as well try that early and fall back to KDump in case of an error..
ok. Yeah but not uninitialized metadata.
>
>> What if kernel crashes before metadata area is initialized ?
>
> registered_regions would be '0'. So, it is treated as fadump is not registered case.
> Let me
> initialize metadata explicitly before registering the address with f/w to avoid any assumption...
Do you want to do that before memblock reservation ? Should we move this
to setup_fadump() ?
Thanks,
-Mahesh.
>
>>
>>> +
>>> + if (memblock_reserve(base, size)) {
>>> pr_err("Failed to reserve memory\n");
>>> - return 0;
>>> + goto error_out;
>>> }
>> [...]
>>> -
>>> static struct fadump_ops rtas_fadump_ops = {
>>> - .init_fadump_mem_struct = rtas_fadump_init_mem_struct,
>>> - .register_fadump = rtas_fadump_register_fadump,
>>> - .unregister_fadump = rtas_fadump_unregister_fadump,
>>> - .invalidate_fadump = rtas_fadump_invalidate_fadump,
>>> - .process_fadump = rtas_fadump_process_fadump,
>>> - .fadump_region_show = rtas_fadump_region_show,
>>> - .fadump_trigger = rtas_fadump_trigger,
>>> + .init_fadump_mem_struct = rtas_fadump_init_mem_struct,
>>> + .get_kernel_metadata_size = rtas_fadump_get_kernel_metadata_size,
>>> + .setup_kernel_metadata = rtas_fadump_setup_kernel_metadata,
>>> + .register_fadump = rtas_fadump_register_fadump,
>>> + .unregister_fadump = rtas_fadump_unregister_fadump,
>>> + .invalidate_fadump = rtas_fadump_invalidate_fadump,
>>> + .process_fadump = rtas_fadump_process_fadump,
>>> + .fadump_region_show = rtas_fadump_region_show,
>>> + .fadump_trigger = rtas_fadump_trigger,
>>
>> Can you make the tab space changes in your previous patch where these
>> were initially introduced ? So that this patch can only show new members
>> that are added.
>
> done.
>
> Thanks
> Hari
>
next prev parent reply other threads:[~2019-08-14 10:23 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-16 11:31 [PATCH v4 00/25] Add FADump support on PowerNV platform Hari Bathini
2019-07-16 11:32 ` [PATCH v4 01/25] powerpc/fadump: move internal macros/definitions to a new header Hari Bathini
2019-07-16 11:32 ` [PATCH v4 02/25] powerpc/fadump: move internal code to a new file Hari Bathini
2019-07-16 11:32 ` [PATCH v4 03/25] powerpc/fadump: Improve fadump documentation Hari Bathini
2019-08-12 6:55 ` Mahesh Jagannath Salgaonkar
2019-07-16 11:32 ` [PATCH v4 04/25] pseries/fadump: move rtas specific definitions to platform code Hari Bathini
2019-07-16 11:32 ` [PATCH v4 05/25] pseries/fadump: introduce callbacks for platform specific operations Hari Bathini
2019-08-12 9:42 ` Mahesh J Salgaonkar
2019-08-14 6:39 ` Hari Bathini
2019-07-16 11:32 ` [PATCH v4 06/25] pseries/fadump: define register/un-register callback functions Hari Bathini
2019-08-12 16:01 ` Mahesh J Salgaonkar
2019-08-14 6:41 ` Hari Bathini
2019-07-16 11:32 ` [PATCH v4 07/25] pseries/fadump: move out platform specific support from generic code Hari Bathini
2019-08-13 5:16 ` Mahesh J Salgaonkar
2019-07-16 11:32 ` [PATCH v4 08/25] powerpc/fadump: use FADump instead of fadump for how it is pronounced Hari Bathini
2019-07-16 11:33 ` [PATCH v4 09/25] opal: add MPIPL interface definitions Hari Bathini
2019-07-16 11:33 ` [PATCH v4 10/25] powernv/fadump: add fadump support on powernv Hari Bathini
2019-07-16 11:33 ` [PATCH v4 11/25] powernv/fadump: register kernel metadata address with opal Hari Bathini
2019-08-13 10:41 ` Mahesh J Salgaonkar
2019-08-14 7:06 ` Hari Bathini
2019-08-14 10:21 ` Mahesh Jagannath Salgaonkar [this message]
2019-08-19 15:49 ` Hari Bathini
2019-07-16 11:33 ` [PATCH v4 12/25] powernv/fadump: define register/un-register callback functions Hari Bathini
2019-08-13 14:34 ` Mahesh J Salgaonkar
2019-08-14 7:11 ` Hari Bathini
2019-07-16 11:33 ` [PATCH v4 13/25] powernv/fadump: support copying multiple kernel memory regions Hari Bathini
2019-08-13 15:03 ` Mahesh J Salgaonkar
2019-08-14 7:14 ` Hari Bathini
2019-07-16 11:33 ` [PATCH v4 14/25] powernv/fadump: process the crashdump by exporting it as /proc/vmcore Hari Bathini
2019-08-14 10:18 ` Mahesh J Salgaonkar
2019-08-14 11:11 ` Hari Bathini
2019-07-16 11:33 ` [PATCH v4 15/25] powerpc/fadump: Update documentation about OPAL platform support Hari Bathini
2019-07-16 11:33 ` [PATCH v4 16/25] powerpc/fadump: consider reserved ranges while reserving memory Hari Bathini
2019-07-16 11:34 ` [PATCH v4 17/25] powerpc/fadump: consider reserved ranges while releasing memory Hari Bathini
2019-07-16 11:34 ` [PATCH v4 18/25] powernv/fadump: process architected register state data provided by firmware Hari Bathini
2019-08-14 17:15 ` Mahesh J Salgaonkar
2019-08-16 2:38 ` Hari Bathini
2019-07-16 11:34 ` [PATCH v4 19/25] powernv/fadump: add support to preserve crash data on FADUMP disabled kernel Hari Bathini
2019-08-16 5:01 ` Mahesh J Salgaonkar
2019-07-16 11:34 ` [PATCH v4 20/25] powerpc/fadump: update documentation about CONFIG_PRESERVE_FA_DUMP Hari Bathini
2019-07-16 11:34 ` [PATCH v4 21/25] powernv/opalcore: export /sys/firmware/opal/core for analysing opal crashes Hari Bathini
2019-07-16 11:34 ` [PATCH v4 22/25] powernv/fadump: Warn before processing partial crashdump Hari Bathini
2019-08-16 5:59 ` Mahesh J Salgaonkar
2019-07-16 11:34 ` [PATCH v4 23/25] powernv/opalcore: provide an option to invalidate /sys/firmware/opal/core file Hari Bathini
2019-07-16 11:34 ` [PATCH v4 24/25] powernv/fadump: consider f/w load area Hari Bathini
2019-07-16 11:35 ` [PATCH v4 25/25] powernv/fadump: update documentation about option to release opalcore Hari Bathini
2019-07-19 6:19 ` [PATCH v4 00/25] Add FADump support on PowerNV platform Hari Bathini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d91f41e-c9c1-2397-1570-62de7a775093@linux.vnet.ibm.com \
--to=mahesh@linux.vnet.ibm.com \
--cc=ananth@linux.ibm.com \
--cc=dja@axtens.net \
--cc=hbathini@linux.ibm.com \
--cc=hegdevasant@linux.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=mahesh@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=oohall@gmail.com \
--cc=stewart@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).