Thread (16 messages) flat view 16 messages, 3 authors, 2025-01-09

Re: [PATCH RESEND v1 5/5] crash: option to let arch decide mem range is usable

From: Sourabh Jain <hidden>
Date: 2025-01-08 12:03:33
Also in: kexec, lkml



On 08/01/25 17:08, Baoquan he wrote:
On 01/08/25 at 03:44pm, Sourabh Jain wrote:
...snip...
quoted
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index f0e9f8eda7a3..407f8b0346aa 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -205,6 +205,15 @@ static inline int arch_kimage_file_post_load_cleanup(struct kimage *image)
  }
  #endif
  
+#ifndef arch_check_excluded_range
+static inline int arch_check_excluded_range(struct kimage *image,
+					    unsigned long start,
+					    unsigned long end)
+{
+	return 0;
+}
+#endif
+
  #ifdef CONFIG_KEXEC_SIG
  #ifdef CONFIG_SIGNED_PE_FILE_VERIFICATION
  int kexec_kernel_verify_pe_sig(const char *kernel, unsigned long kernel_len);
diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
index 3eedb8c226ad..52e1480dbfa1 100644
--- a/kernel/kexec_file.c
+++ b/kernel/kexec_file.c
@@ -464,6 +464,12 @@ static int locate_mem_hole_top_down(unsigned long start, unsigned long end,
  			continue;
  		}
  
+		/* Make sure this does not conflict exclude range */
                                                    ^
                 Make sure this doesn't conflict with excluded range?
quoted
+		if (arch_check_excluded_range(image, temp_start, temp_end)) {
+			temp_start = temp_start - PAGE_SIZE;
+			continue;
+		}
+
  		/* We found a suitable memory range */
  		break;
  	} while (1);
@@ -498,6 +504,12 @@ static int locate_mem_hole_bottom_up(unsigned long start, unsigned long end,
  			continue;
  		}
  
+		/* Make sure this does not conflict exclude range */
                                                    ^
                                                  Ditto.
I will update both comments.

Thanks,
Sourabh Jain

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help