From: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
To: Sourabh Jain <sourabhjain@linux.ibm.com>, linuxppc-dev@ozlabs.org
Cc: Aditya Gupta <adityag@linux.ibm.com>,
Mahesh Salgaonkar <mahesh@linux.ibm.com>,
Hari Bathini <hbathini@linux.ibm.com>
Subject: Re: [PATCH v5 1/3] powerpc: make fadump resilient with memory add/remove events
Date: Wed, 15 Nov 2023 10:14:00 +0530 [thread overview]
Message-ID: <871qcr1v8v.fsf@linux.ibm.com> (raw)
In-Reply-To: <20231029124548.12198-2-sourabhjain@linux.ibm.com>
Sourabh Jain <sourabhjain@linux.ibm.com> writes:
....
> diff --git a/arch/powerpc/include/asm/fadump-internal.h b/arch/powerpc/include/asm/fadump-internal.h
> index 27f9e11eda28..7be3d8894520 100644
> --- a/arch/powerpc/include/asm/fadump-internal.h
> +++ b/arch/powerpc/include/asm/fadump-internal.h
> @@ -42,7 +42,25 @@ static inline u64 fadump_str_to_u64(const char *str)
>
> #define FADUMP_CPU_UNKNOWN (~((u32)0))
>
> -#define FADUMP_CRASH_INFO_MAGIC fadump_str_to_u64("FADMPINF")
> +/*
> + * The introduction of new fields in the fadump crash info header has
> + * led to a change in the magic key, from `FADMPINF` to `FADMPSIG`.
> + * This alteration ensures backward compatibility, enabling the kernel
> + * with the updated fadump crash info to handle kernel dumps from older
> + * kernels.
> + *
> + * To prevent the need for further changes to the magic number in the
> + * event of future modifications to the fadump header, a version field
> + * has been introduced to track the fadump crash info header version.
> + *
> + * Historically, there was no connection between the magic number and
> + * the fadump crash info header version. However, moving forward, the
> + * `FADMPINF` magic number in header will be treated as version 0, while
> + * the `FADMPSIG` magic number in header will include a version field to
> + * determine its version.
> + */
> +#define FADUMP_CRASH_INFO_MAGIC fadump_str_to_u64("FADMPSIG")
> +#define FADUMP_VERSION 1
>
Can we keep the old magic details as
#define FADUMP_CRASH_INFO_MAGIC_OLD fadump_str_to_u64("FADMPINF")
#define FADUMP_CRASH_INFO_MAGIC fadump_str_to_u64("FADMPSIG")
Also considering the struct need not be backward compatible, can we just
do
struct fadump_crash_info_header {
u64 magic_number;
u32 crashing_cpu;
u64 elfcorehdr_addr;
u64 elfcorehdr_size;
u64 vmcoreinfo_raddr;
u64 vmcoreinfo_size;
struct pt_regs regs;
struct cpumask cpu_mask;
};
static inline bool fadump_compatible(struct fadump_crash_info_header
*fdh)
{
return (fdh->magic_number == FADUMP_CRASH_INFO_MAGIC)
}
and fail fadump if we find it not compatible?
-aneesh
next prev parent reply other threads:[~2023-11-15 4:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-29 12:45 [PATCH v5 0/3] powerpc: make fadump resilient with memory add/remove events Sourabh Jain
2023-10-29 12:45 ` [PATCH v5 1/3] " Sourabh Jain
2023-11-09 12:14 ` Michael Ellerman
2023-11-13 6:42 ` Sourabh Jain
2023-11-15 4:44 ` Aneesh Kumar K.V [this message]
2023-11-17 4:33 ` Sourabh Jain
2023-11-17 5:31 ` Aneesh Kumar K V
2023-11-17 6:14 ` Hari Bathini
2023-11-22 5:17 ` Michael Ellerman
2023-11-22 10:35 ` Sourabh Jain
2023-11-22 12:20 ` Aneesh Kumar K V
2023-11-24 5:20 ` Sourabh Jain
2023-11-22 12:52 ` Michael Ellerman
2023-11-24 7:21 ` Sourabh Jain
2023-10-29 12:45 ` [PATCH v5 2/3] powerpc/fadump: add hotplug_ready sysfs interface Sourabh Jain
2023-10-29 12:45 ` [PATCH v5 3/3] Documentation/powerpc: update fadump implementation details Sourabh Jain
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=871qcr1v8v.fsf@linux.ibm.com \
--to=aneesh.kumar@linux.ibm.com \
--cc=adityag@linux.ibm.com \
--cc=hbathini@linux.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=mahesh@linux.ibm.com \
--cc=sourabhjain@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).