Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1460852

[PATCH v2 1/2] kexec: add dtb info to struct kimage

From Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH v2 1/2] kexec: add dtb info to struct kimage
Date 2016-08-12 01:10 +0200
Message-ID <s57gS-25e-11@gated-at.bofh.it> (permalink)
References <s57gS-25e-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: AKASHI Takahiro <takahiro.akashi@linaro.org>

Device tree blob must be passed to a second kernel on DTB-capable
archs, like powerpc and arm64, but the current kernel interface
lacks this support.

This patch adds dtb buffer information to struct kimage.
When users don't specify dtb explicitly and the one used for the current
kernel can be re-used, this change will be good enough for implementing
kexec_file_load feature.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 include/linux/kexec.h | 3 +++
 kernel/kexec_file.c   | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index d7437777baaa..4f85d284ed0b 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -192,6 +192,9 @@ struct kimage {
 	char *cmdline_buf;
 	unsigned long cmdline_buf_len;
 
+	void *dtb_buf;
+	unsigned long dtb_buf_len;
+
 	/* File operations provided by image loader */
 	struct kexec_file_ops *fops;
 
diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
index 503bc2d348e5..113af2f219b9 100644
--- a/kernel/kexec_file.c
+++ b/kernel/kexec_file.c
@@ -92,6 +92,9 @@ void kimage_file_post_load_cleanup(struct kimage *image)
 	vfree(image->initrd_buf);
 	image->initrd_buf = NULL;
 
+	vfree(image->dtb_buf);
+	image->dtb_buf = NULL;
+
 	kfree(image->cmdline_buf);
 	image->cmdline_buf = NULL;
 
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/2] extend kexec_file_load system call Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> - 2016-08-12 01:10 +0200
  [PATCH v2 1/2] kexec: add dtb info to struct kimage Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> - 2016-08-12 01:10 +0200
    Re: [PATCH v2 1/2] kexec: add dtb info to struct kimage Dave Young <dyoung@redhat.com> - 2016-08-18 10:40 +0200
  [PATCH v2 2/2] kexec: extend kexec_file_load system call Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> - 2016-08-12 01:10 +0200
    Re: [PATCH v2 2/2] kexec: extend kexec_file_load system call Balbir Singh <bsingharora@gmail.com> - 2016-08-12 10:30 +0200
      Re: [PATCH v2 2/2] kexec: extend kexec_file_load system call Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> - 2016-08-12 23:50 +0200
        [PATCH v2 2/2] kexec: extend kexec_file_load system call Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> - 2016-08-16 02:20 +0200
    Re: [PATCH v2 2/2] kexec: extend kexec_file_load system call Dave Young <dyoung@redhat.com> - 2016-08-18 10:30 +0200
  Re: [PATCH v2 0/2] extend kexec_file_load system call Mark Rutland <mark.rutland@arm.com> - 2016-08-18 12:40 +0200

csiph-web