From: Pingfan Liu <kernelfans@gmail.com>
To: kexec@lists.infradead.org
Cc: Pingfan Liu <piliu@redhat.com>, Jiri Bohac <jbohac@suse.cz>,
Michal Hocko <mhocko@suse.com>, Philipp Rudo <prudo@redhat.com>,
Baoquan He <bhe@redhat.com>, Dave Young <dyoung@redhat.com>
Subject: [RFC 2/3] of: kexec: Set up properties for reusing CMA in kdump
Date: Mon, 18 Dec 2023 13:23:24 +0800 [thread overview]
Message-ID: <20231218052325.20982-3-kernelfans@gmail.com> (raw)
In-Reply-To: <20231218052325.20982-1-kernelfans@gmail.com>
From: Pingfan Liu <piliu@redhat.com>
Signed-off-by: Pingfan Liu <piliu@redhat.com>
Cc: Jiri Bohac <jbohac@suse.cz>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Philipp Rudo <prudo@redhat.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
To: kexec@lists.infradead.org
---
drivers/of/kexec.c | 14 ++++++++++++++
include/linux/kexec.h | 4 ++++
2 files changed, 18 insertions(+)
diff --git a/drivers/of/kexec.c b/drivers/of/kexec.c
index 68278340cecf..471b6cdf34ff 100644
--- a/drivers/of/kexec.c
+++ b/drivers/of/kexec.c
@@ -410,6 +410,20 @@ void *of_kexec_alloc_and_setup_fdt(const struct kimage *image,
if (ret)
goto out;
}
+
+ ret = fdt_appendprop_u64(fdt, chosen_node,
+ "kdump,cma_pfn", kdump_cma_pfn);
+ if (ret)
+ goto out;
+ ret = fdt_appendprop_u64(fdt, chosen_node,
+ "kdump,cma_pg_cnt", kdump_cma_pg_cnt);
+ if (ret)
+ goto out;
+ ret = fdt_appendprop_u64(fdt, chosen_node,
+ "kdump,cma_pg_paddr", kdump_cma_pg_paddr);
+ if (ret)
+ goto out;
+
}
/* add bootargs */
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 95e19c814c93..bf2d8b9d8c07 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -408,6 +408,10 @@ bool kexec_load_permitted(int kexec_image_type);
/* flag to track if kexec reboot is in progress */
extern bool kexec_in_progress;
+extern u64 kdump_cma_pfn;
+extern u64 kdump_cma_pg_cnt;
+extern u64 kdump_cma_pg_paddr;
+
int crash_shrink_memory(unsigned long new_size);
ssize_t crash_get_memory_size(void);
void kdump_kernel_reuse_mem(void);
--
2.31.1
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2023-12-18 5:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-18 5:23 [RFC 0/3] kdump: Check mem_map of CMA area in kdump Pingfan Liu
2023-12-18 5:23 ` [RFC 1/3] crash_dump: Parse the CMA's mem_map " Pingfan Liu
2023-12-18 5:23 ` Pingfan Liu [this message]
2023-12-18 5:23 ` [RFC 3/3] of: fdt: Parse properties of reusing CMA " Pingfan Liu
2023-12-18 15:19 ` [RFC 0/3] kdump: Check mem_map of CMA area " Michal Hocko
2023-12-19 15:20 ` Philipp Rudo
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=20231218052325.20982-3-kernelfans@gmail.com \
--to=kernelfans@gmail.com \
--cc=bhe@redhat.com \
--cc=dyoung@redhat.com \
--cc=jbohac@suse.cz \
--cc=kexec@lists.infradead.org \
--cc=mhocko@suse.com \
--cc=piliu@redhat.com \
--cc=prudo@redhat.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