Thread (20 messages) flat view 20 messages, 3 authors, 2016-06-20

Re: [PATCH v2 2/9] kexec_file: Generalize kexec_add_buffer.

From: Dave Young <hidden>
Date: 2016-06-20 02:26:21
Also in: kexec, lkml

On 06/17/16 at 05:51pm, Thiago Jung Bauermann wrote:
quoted hunk ↗ jump to hunk
Am Freitag, 17 Juni 2016, 15:35:23 schrieb Dave Young:
quoted
On 06/16/16 at 05:39pm, Thiago Jung Bauermann wrote:
quoted
Am Donnerstag, 16 Juni 2016, 09:58:53 schrieb Dave Young:
quoted
On 06/15/16 at 01:21pm, Thiago Jung Bauermann wrote:
quoted
+int __weak arch_kexec_walk_mem(unsigned int image_type, bool
top_down,
+			       void *data, int (*func)(u64, u64, void *))
+{
top_down is also not used?
It's unused in the default implementation, but the powerpc implementation
in patch 8 uses it:
Well, arch_kexec_walk_mem use kbuf as "data", you can even drop
"image_type" since kbuf has all you want kbuf->image->type, and
kbuf->top_down

int __weak arch_kexec_walk_mem(struct kexec_buf *kbuf,
			       int (*func)(u64, u64, void *))
Sounds good to me, but I had to move struct kexec_buf from
kernel/kexec_internal.h to include/linux/kexec.h.

Here's the updated patch. What do you think?

[]'s
Thiago Jung Bauermann
IBM Linux Technology Center


    kexec_file: Generalize kexec_add_buffer.
    
    Allow architectures to specify different memory walking functions for
    kexec_add_buffer. Intel uses iomem to track reserved memory ranges,
    but PowerPC uses the memblock subsystem.
    
    Signed-off-by: Thiago Jung Bauermann [off-list ref]
    Cc: Eric Biederman [off-list ref]
    Cc: Dave Young [off-list ref]
    Cc: kexec@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index e8acb2b43dd9..d8df01107ae2 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -201,6 +201,20 @@ struct kimage {
 #endif
 };
 
+/*
+ * Keeps track of buffer parameters as provided by caller for requesting
+ * memory placement of buffer.
+ */
+struct kexec_buf {
+	struct kimage *image;
+	unsigned long mem;
+	unsigned long memsz;
+	unsigned long buf_align;
+	unsigned long buf_min;
+	unsigned long buf_max;
+	bool top_down;		/* allocate from top of memory hole */
+};
+
kexec_buf should go within #ifdef for kexec file like struct purgatory_info

Other than that it looks good.

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