<div dir="ltr"><div dir="ltr">On Wed, Aug 24, 2022 at 4:58 PM Xianting Tian <<a href="mailto:xianting.tian@linux.alibaba.com">xianting.tian@linux.alibaba.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Li Jiang<br>
<br>
I just saw this reply from Yixun,<br>
<br></blockquote><div><br></div><div>Thank you for sharing the information, Xianting and Yixun. I will try it later.</div><div>If I run into any issues, I will let you know.</div><div><br></div><div>Thanks.</div><div>Lianbo</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
there is some bug for kexec when use initrd, I used a temporary solution <br>
to fix the issue. And recently, Yixun fixed the issue, it is a better <br>
fix, you can use it to test on QEMU.<br>
<br>
Fot the test on Xuantie 910 RISC-V SoC platform, I didn't use initrd, <br>
the kexec command I used as below:<br>
         cmdline=$(cat /proc/cmdline)<br>
         kexec -p vmlinux --append="$cmdline"<br>
<br>
And with the additional patches:<br>
<br>
diff --git a/kexec/arch/riscv/crashdump-riscv.c <br>
b/kexec/arch/riscv/crashdump-riscv.c<br>
index 4f3ecd6..be73e34 100644<br>
--- a/kexec/arch/riscv/crashdump-riscv.c<br>
+++ b/kexec/arch/riscv/crashdump-riscv.c<br>
@@ -84,7 +84,7 @@ int load_elfcorehdr(struct kexec_info *info)<br>
         for (i = 0; i < info->memory_ranges; i++) {<br>
                 ret = mem_regions_alloc_and_add(&crash_mem_ranges,<br>
                                                 ranges[i].start,<br>
-                                               ranges[i].end - <br>
ranges[i].start,<br>
+                                               ranges[i].end - <br>
ranges[i].start + 1,<br>
                                                 ranges[i].type);<br>
                 if (ret ) {<br>
                         fprintf(stderr, "Could not create <br>
crash_mem_ranges\n");<br>
diff --git a/kexec/arch/riscv/kexec-riscv.c b/kexec/arch/riscv/kexec-riscv.c<br>
index c7bbe5f..1a047de 100644<br>
--- a/kexec/arch/riscv/kexec-riscv.c<br>
+++ b/kexec/arch/riscv/kexec-riscv.c<br>
@@ -455,10 +455,13 @@ static int add_memory_region(struct memory_ranges <br>
*mem_ranges,<br>
         entry_size = (addr_cells + size_cells) * sizeof(uint32_t);<br>
         reg = fdt_getprop(fdt->buf, node_offset, "reg", &prop_size);<br>
         if (!reg) {<br>
-               fprintf(stderr, "Warning: Malformed memory region with no "<br>
-                               "reg property (%s) !\n",<br>
-                               fdt_get_name(fdt->buf, node_offset, NULL));<br>
-               return -EINVAL;<br>
+               reg = fdt_getprop(fdt->buf, node_offset, "alloc-ranges", <br>
&prop_size);<br>
+               if (!reg) {<br>
+                       fprintf(stderr, "Warning: Malformed memory <br>
region with no "<br>
+                                       "reg property (%s) !\n",<br>
+                                       fdt_get_name(fdt->buf, <br>
node_offset, NULL));<br>
+                       return -EINVAL;<br>
+               }<br>
         }<br>
<br>
         num_entries = prop_size / entry_size;<br>
diff --git a/kexec/mem_regions.c b/kexec/mem_regions.c<br>
index ad7d3f1..f650bcd 100644<br>
--- a/kexec/mem_regions.c<br>
+++ b/kexec/mem_regions.c<br>
@@ -126,7 +126,7 @@ int mem_regions_exclude(struct memory_ranges *ranges,<br>
         return 0;<br>
  }<br>
<br>
-#define KEXEC_MEMORY_RANGES 16<br>
+#define KEXEC_MEMORY_RANGES 32<br>
<br>
<br>
<br>
><br>
> Yixun<br>
<br>
</blockquote></div></div>