From: Hari Bathini <hbathini@linux.ibm.com>
To: lkml <linux-kernel@vger.kernel.org>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
Kexec-ml <kexec@lists.infradead.org>
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>,
Dave Young <dyoung@redhat.com>,
Mahesh J Salgaonkar <mahesh@linux.ibm.com>,
Baoquan He <bhe@redhat.com>
Subject: [PATCH v2 1/3] powerpc/fadump: make is_fadump_active() visible for exporting vmcore
Date: Wed, 6 Sep 2023 00:06:02 +0530 [thread overview]
Message-ID: <20230905183604.568996-1-hbathini@linux.ibm.com> (raw)
Include asm/fadump.h in asm/kexec.h to make it visible while exporting
vmcore. Also, update is_fadump_active() to return boolean instead of
integer for better readability. The change will be used in the next
patch to ensure vmcore is exported when fadump is active.
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
---
Changes in v2:
* New patch based on Baoquan's suggestion to use is_fadump_active()
instead of introducing new function is_crashdump_kernel().
arch/powerpc/include/asm/fadump.h | 4 ++--
arch/powerpc/include/asm/kexec.h | 8 ++++++--
arch/powerpc/kernel/fadump.c | 4 ++--
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/include/asm/fadump.h b/arch/powerpc/include/asm/fadump.h
index 526a6a647312..27b74a7e2162 100644
--- a/arch/powerpc/include/asm/fadump.h
+++ b/arch/powerpc/include/asm/fadump.h
@@ -15,13 +15,13 @@ extern int crashing_cpu;
extern int is_fadump_memory_area(u64 addr, ulong size);
extern int setup_fadump(void);
-extern int is_fadump_active(void);
+extern bool is_fadump_active(void);
extern int should_fadump_crash(void);
extern void crash_fadump(struct pt_regs *, const char *);
extern void fadump_cleanup(void);
#else /* CONFIG_FA_DUMP */
-static inline int is_fadump_active(void) { return 0; }
+static inline bool is_fadump_active(void) { return false; }
static inline int should_fadump_crash(void) { return 0; }
static inline void crash_fadump(struct pt_regs *regs, const char *str) { }
static inline void fadump_cleanup(void) { }
diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h
index a1ddba01e7d1..b760ef459234 100644
--- a/arch/powerpc/include/asm/kexec.h
+++ b/arch/powerpc/include/asm/kexec.h
@@ -51,6 +51,7 @@
#ifndef __ASSEMBLY__
#include <asm/reg.h>
+#include <asm/fadump.h>
typedef void (*crash_shutdown_t)(void);
@@ -99,10 +100,13 @@ void relocate_new_kernel(unsigned long indirection_page, unsigned long reboot_co
void kexec_copy_flush(struct kimage *image);
-#if defined(CONFIG_CRASH_DUMP) && defined(CONFIG_PPC_RTAS)
+#if defined(CONFIG_CRASH_DUMP)
+#define is_fadump_active is_fadump_active
+#if defined(CONFIG_PPC_RTAS)
void crash_free_reserved_phys_range(unsigned long begin, unsigned long end);
#define crash_free_reserved_phys_range crash_free_reserved_phys_range
-#endif
+#endif /* CONFIG_PPC_RTAS */
+#endif /* CONFIG_CRASH_DUMP */
#ifdef CONFIG_KEXEC_FILE
extern const struct kexec_file_ops kexec_elf64_ops;
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 3ff2da7b120b..5682a65e8326 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -187,9 +187,9 @@ int should_fadump_crash(void)
return 1;
}
-int is_fadump_active(void)
+bool is_fadump_active(void)
{
- return fw_dump.dump_active;
+ return !!fw_dump.dump_active;
}
/*
--
2.41.0
next reply other threads:[~2023-09-05 19:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-05 18:36 Hari Bathini [this message]
2023-09-05 18:36 ` [PATCH v2 2/3] vmcore: allow fadump to export vmcore even if is_kdump_kernel() is false Hari Bathini
2023-09-11 7:13 ` Michael Ellerman
2023-09-11 10:31 ` Baoquan He
2023-09-12 8:31 ` Hari Bathini
2023-09-05 18:36 ` [PATCH v2 3/3] powerpc/fadump: make is_kdump_kernel() return false when fadump is active Hari Bathini
2023-09-07 5:42 ` [PATCH v2 1/3] powerpc/fadump: make is_fadump_active() visible for exporting vmcore Baoquan He
2023-09-08 5:49 ` 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=20230905183604.568996-1-hbathini@linux.ibm.com \
--to=hbathini@linux.ibm.com \
--cc=bhe@redhat.com \
--cc=dyoung@redhat.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.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).