linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li Zhijian <lizhijian@fujitsu.com>
To: x86@kernel.org, nvdimm@lists.linux.dev, kexec@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, y-goto@fujitsu.com,
	yangx.jy@fujitsu.com, ruansy.fnst@fujitsu.com,
	Li Zhijian <lizhijian@fujitsu.com>, Baoquan He <bhe@redhat.com>,
	Vivek Goyal <vgoyal@redhat.com>, Dave Young <dyoung@redhat.com>
Subject: [RFC PATCH v2 kexec-tools] kexec: Add and mark pmem region into PT_LOADs
Date: Thu, 27 Apr 2023 18:18:35 +0800	[thread overview]
Message-ID: <20230427101838.12267-5-lizhijian@fujitsu.com> (raw)
In-Reply-To: <20230427101838.12267-1-lizhijian@fujitsu.com>

It does:
1. Add pmem region into PT_LOADs of vmcore
2. Mark pmem region's p_flags as PF_DEV

CC: Baoquan He <bhe@redhat.com>
CC: Vivek Goyal <vgoyal@redhat.com>
CC: Dave Young <dyoung@redhat.com>
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
 kexec/crashdump-elf.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/kexec/crashdump-elf.c b/kexec/crashdump-elf.c
index b8bb686a17ca..ab257e825187 100644
--- a/kexec/crashdump-elf.c
+++ b/kexec/crashdump-elf.c
@@ -25,6 +25,8 @@ do {									\
 } while(0)
 #endif
 
+#define PF_DEV (1 << 4)
+
 /* Prepares the crash memory headers and stores in supplied buffer. */
 int FUNC(struct kexec_info *info,
 	 struct crash_elf_info *elf_info,
@@ -199,7 +201,7 @@ int FUNC(struct kexec_info *info,
 	 * A seprate program header for Backup Region*/
 	for (i = 0; i < ranges; i++, range++) {
 		unsigned long long mstart, mend;
-		if (range->type != RANGE_RAM)
+		if (range->type != RANGE_RAM && range->type != RANGE_PMEM)
 			continue;
 		mstart = range->start;
 		mend = range->end;
@@ -209,6 +211,8 @@ int FUNC(struct kexec_info *info,
 		bufp += sizeof(PHDR);
 		phdr->p_type	= PT_LOAD;
 		phdr->p_flags	= PF_R|PF_W|PF_X;
+		if (range->type == RANGE_PMEM)
+			phdr->p_flags |= PF_DEV;
 		phdr->p_offset	= mstart;
 
 		if (mstart == info->backup_src_start
-- 
2.29.2


  parent reply	other threads:[~2023-04-27 10:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 10:18 [RFC PATCH v2 0/3] pmem memmap dump support Li Zhijian
2023-04-27 10:18 ` [RFC PATCH v2 1/3] crash: export dev memmap header to vmcoreinfo Li Zhijian
2023-04-27 10:18 ` [RFC PATCH v2 2/3] drivers/nvdimm: export memmap of namespace " Li Zhijian
2023-04-27 22:50   ` Ira Weiny
2023-04-28  7:01     ` Zhijian Li (Fujitsu)
2023-04-27 10:18 ` [RFC PATCH v2 3/3] resource, crash: Make kexec_file_load support pmem Li Zhijian
2023-04-27 11:39   ` Greg Kroah-Hartman
2023-04-28  7:36     ` Zhijian Li (Fujitsu)
2023-04-27 20:41   ` Jane Chu
2023-04-28  7:10     ` Zhijian Li (Fujitsu)
2023-04-27 10:18 ` Li Zhijian [this message]
2023-04-27 10:18 ` [RFC PATCH v2 makedumpfile 1/3] elf_info.c: Introduce is_pmem_pt_load_range Li Zhijian
2023-04-27 10:18 ` [RFC PATCH v2 makedumpfile 2/3] makedumpfile.c: Exclude all pmem pages Li Zhijian
2023-04-27 10:18 ` [RFC PATCH v2 makedumpfile 3/3] makedumpfile.c: Allow excluding metadata of pmem region Li Zhijian
2023-04-28 18:59 ` [RFC PATCH v2 0/3] pmem memmap dump support Dan Williams
2023-05-08  9:45   ` Zhijian Li (Fujitsu)
2023-05-10 10:41     ` Zhijian Li (Fujitsu)
2023-05-25  5:36       ` Li, Zhijian

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=20230427101838.12267-5-lizhijian@fujitsu.com \
    --to=lizhijian@fujitsu.com \
    --cc=bhe@redhat.com \
    --cc=dyoung@redhat.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=ruansy.fnst@fujitsu.com \
    --cc=vgoyal@redhat.com \
    --cc=x86@kernel.org \
    --cc=y-goto@fujitsu.com \
    --cc=yangx.jy@fujitsu.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).