* [PATCH] arm64/kexec: Use consistent convention of initializing 'kxec_buf.mem' with KEXEC_BUF_MEM_UNKNOWN
@ 2019-07-11 11:57 ` Bhupesh Sharma
0 siblings, 0 replies; 6+ messages in thread
From: Bhupesh Sharma @ 2019-07-11 11:57 UTC (permalink / raw)
To: linux-arm-kernel
Cc: linux-kernel, bhupesh.linux, Bhupesh Sharma, takahiro.akashi,
james.morse, will.deacon
With commit b6664ba42f14 ("s390, kexec_file: drop arch_kexec_mem_walk()"),
we introduced the KEXEC_BUF_MEM_UNKNOWN macro. If kexec_buf.mem is set
to this value, kexec_locate_mem_hole() will try to allocate free memory.
While other arch(s) like s390 and x86_64 already use this macro to
initialize kexec_buf.mem with, arm64 uses an equivalent value of 0.
Replace it with KEXEC_BUF_MEM_UNKNOWN, to keep the convention of
initializing 'kxec_buf.mem' consistent across various archs.
Cc: takahiro.akashi@linaro.org
Cc: james.morse@arm.com
Cc: will.deacon@arm.com
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
---
arch/arm64/kernel/kexec_image.c | 2 +-
arch/arm64/kernel/machine_kexec_file.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/kernel/kexec_image.c b/arch/arm64/kernel/kexec_image.c
index 2514fd6f12cb..29a9428486a5 100644
--- a/arch/arm64/kernel/kexec_image.c
+++ b/arch/arm64/kernel/kexec_image.c
@@ -84,7 +84,7 @@ static void *image_load(struct kimage *image,
kbuf.buffer = kernel;
kbuf.bufsz = kernel_len;
- kbuf.mem = 0;
+ kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
kbuf.memsz = le64_to_cpu(h->image_size);
text_offset = le64_to_cpu(h->text_offset);
kbuf.buf_align = MIN_KIMG_ALIGN;
diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c
index 58871333737a..ba78ee7ca990 100644
--- a/arch/arm64/kernel/machine_kexec_file.c
+++ b/arch/arm64/kernel/machine_kexec_file.c
@@ -177,7 +177,7 @@ int load_other_segments(struct kimage *image,
if (initrd) {
kbuf.buffer = initrd;
kbuf.bufsz = initrd_len;
- kbuf.mem = 0;
+ kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
kbuf.memsz = initrd_len;
kbuf.buf_align = 0;
/* within 1GB-aligned window of up to 32GB in size */
@@ -204,7 +204,7 @@ int load_other_segments(struct kimage *image,
dtb_len = fdt_totalsize(dtb);
kbuf.buffer = dtb;
kbuf.bufsz = dtb_len;
- kbuf.mem = 0;
+ kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
kbuf.memsz = dtb_len;
/* not across 2MB boundary */
kbuf.buf_align = SZ_2M;
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] arm64/kexec: Use consistent convention of initializing 'kxec_buf.mem' with KEXEC_BUF_MEM_UNKNOWN
@ 2019-07-11 11:57 ` Bhupesh Sharma
0 siblings, 0 replies; 6+ messages in thread
From: Bhupesh Sharma @ 2019-07-11 11:57 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Bhupesh Sharma, will.deacon, linux-kernel, takahiro.akashi,
james.morse, bhupesh.linux
With commit b6664ba42f14 ("s390, kexec_file: drop arch_kexec_mem_walk()"),
we introduced the KEXEC_BUF_MEM_UNKNOWN macro. If kexec_buf.mem is set
to this value, kexec_locate_mem_hole() will try to allocate free memory.
While other arch(s) like s390 and x86_64 already use this macro to
initialize kexec_buf.mem with, arm64 uses an equivalent value of 0.
Replace it with KEXEC_BUF_MEM_UNKNOWN, to keep the convention of
initializing 'kxec_buf.mem' consistent across various archs.
Cc: takahiro.akashi@linaro.org
Cc: james.morse@arm.com
Cc: will.deacon@arm.com
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
---
arch/arm64/kernel/kexec_image.c | 2 +-
arch/arm64/kernel/machine_kexec_file.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/kernel/kexec_image.c b/arch/arm64/kernel/kexec_image.c
index 2514fd6f12cb..29a9428486a5 100644
--- a/arch/arm64/kernel/kexec_image.c
+++ b/arch/arm64/kernel/kexec_image.c
@@ -84,7 +84,7 @@ static void *image_load(struct kimage *image,
kbuf.buffer = kernel;
kbuf.bufsz = kernel_len;
- kbuf.mem = 0;
+ kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
kbuf.memsz = le64_to_cpu(h->image_size);
text_offset = le64_to_cpu(h->text_offset);
kbuf.buf_align = MIN_KIMG_ALIGN;
diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c
index 58871333737a..ba78ee7ca990 100644
--- a/arch/arm64/kernel/machine_kexec_file.c
+++ b/arch/arm64/kernel/machine_kexec_file.c
@@ -177,7 +177,7 @@ int load_other_segments(struct kimage *image,
if (initrd) {
kbuf.buffer = initrd;
kbuf.bufsz = initrd_len;
- kbuf.mem = 0;
+ kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
kbuf.memsz = initrd_len;
kbuf.buf_align = 0;
/* within 1GB-aligned window of up to 32GB in size */
@@ -204,7 +204,7 @@ int load_other_segments(struct kimage *image,
dtb_len = fdt_totalsize(dtb);
kbuf.buffer = dtb;
kbuf.bufsz = dtb_len;
- kbuf.mem = 0;
+ kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
kbuf.memsz = dtb_len;
/* not across 2MB boundary */
kbuf.buf_align = SZ_2M;
--
2.7.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] arm64/kexec: Use consistent convention of initializing 'kxec_buf.mem' with KEXEC_BUF_MEM_UNKNOWN
2019-07-11 11:57 ` Bhupesh Sharma
@ 2019-07-11 14:52 ` Matthias Brugger
-1 siblings, 0 replies; 6+ messages in thread
From: Matthias Brugger @ 2019-07-11 14:52 UTC (permalink / raw)
To: Bhupesh Sharma, linux-arm-kernel
Cc: will.deacon, linux-kernel, takahiro.akashi, james.morse, bhupesh.linux
On 11/07/2019 13:57, Bhupesh Sharma wrote:
> With commit b6664ba42f14 ("s390, kexec_file: drop arch_kexec_mem_walk()"),
> we introduced the KEXEC_BUF_MEM_UNKNOWN macro. If kexec_buf.mem is set
> to this value, kexec_locate_mem_hole() will try to allocate free memory.
>
> While other arch(s) like s390 and x86_64 already use this macro to
> initialize kexec_buf.mem with, arm64 uses an equivalent value of 0.
> Replace it with KEXEC_BUF_MEM_UNKNOWN, to keep the convention of
> initializing 'kxec_buf.mem' consistent across various archs.
>
> Cc: takahiro.akashi@linaro.org
> Cc: james.morse@arm.com
> Cc: will.deacon@arm.com
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
> ---
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
> arch/arm64/kernel/kexec_image.c | 2 +-
> arch/arm64/kernel/machine_kexec_file.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm64/kernel/kexec_image.c b/arch/arm64/kernel/kexec_image.c
> index 2514fd6f12cb..29a9428486a5 100644
> --- a/arch/arm64/kernel/kexec_image.c
> +++ b/arch/arm64/kernel/kexec_image.c
> @@ -84,7 +84,7 @@ static void *image_load(struct kimage *image,
>
> kbuf.buffer = kernel;
> kbuf.bufsz = kernel_len;
> - kbuf.mem = 0;
> + kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
> kbuf.memsz = le64_to_cpu(h->image_size);
> text_offset = le64_to_cpu(h->text_offset);
> kbuf.buf_align = MIN_KIMG_ALIGN;
> diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c
> index 58871333737a..ba78ee7ca990 100644
> --- a/arch/arm64/kernel/machine_kexec_file.c
> +++ b/arch/arm64/kernel/machine_kexec_file.c
> @@ -177,7 +177,7 @@ int load_other_segments(struct kimage *image,
> if (initrd) {
> kbuf.buffer = initrd;
> kbuf.bufsz = initrd_len;
> - kbuf.mem = 0;
> + kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
> kbuf.memsz = initrd_len;
> kbuf.buf_align = 0;
> /* within 1GB-aligned window of up to 32GB in size */
> @@ -204,7 +204,7 @@ int load_other_segments(struct kimage *image,
> dtb_len = fdt_totalsize(dtb);
> kbuf.buffer = dtb;
> kbuf.bufsz = dtb_len;
> - kbuf.mem = 0;
> + kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
> kbuf.memsz = dtb_len;
> /* not across 2MB boundary */
> kbuf.buf_align = SZ_2M;
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] arm64/kexec: Use consistent convention of initializing 'kxec_buf.mem' with KEXEC_BUF_MEM_UNKNOWN
@ 2019-07-11 14:52 ` Matthias Brugger
0 siblings, 0 replies; 6+ messages in thread
From: Matthias Brugger @ 2019-07-11 14:52 UTC (permalink / raw)
To: Bhupesh Sharma, linux-arm-kernel
Cc: takahiro.akashi, bhupesh.linux, will.deacon, linux-kernel, james.morse
On 11/07/2019 13:57, Bhupesh Sharma wrote:
> With commit b6664ba42f14 ("s390, kexec_file: drop arch_kexec_mem_walk()"),
> we introduced the KEXEC_BUF_MEM_UNKNOWN macro. If kexec_buf.mem is set
> to this value, kexec_locate_mem_hole() will try to allocate free memory.
>
> While other arch(s) like s390 and x86_64 already use this macro to
> initialize kexec_buf.mem with, arm64 uses an equivalent value of 0.
> Replace it with KEXEC_BUF_MEM_UNKNOWN, to keep the convention of
> initializing 'kxec_buf.mem' consistent across various archs.
>
> Cc: takahiro.akashi@linaro.org
> Cc: james.morse@arm.com
> Cc: will.deacon@arm.com
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
> ---
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
> arch/arm64/kernel/kexec_image.c | 2 +-
> arch/arm64/kernel/machine_kexec_file.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm64/kernel/kexec_image.c b/arch/arm64/kernel/kexec_image.c
> index 2514fd6f12cb..29a9428486a5 100644
> --- a/arch/arm64/kernel/kexec_image.c
> +++ b/arch/arm64/kernel/kexec_image.c
> @@ -84,7 +84,7 @@ static void *image_load(struct kimage *image,
>
> kbuf.buffer = kernel;
> kbuf.bufsz = kernel_len;
> - kbuf.mem = 0;
> + kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
> kbuf.memsz = le64_to_cpu(h->image_size);
> text_offset = le64_to_cpu(h->text_offset);
> kbuf.buf_align = MIN_KIMG_ALIGN;
> diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c
> index 58871333737a..ba78ee7ca990 100644
> --- a/arch/arm64/kernel/machine_kexec_file.c
> +++ b/arch/arm64/kernel/machine_kexec_file.c
> @@ -177,7 +177,7 @@ int load_other_segments(struct kimage *image,
> if (initrd) {
> kbuf.buffer = initrd;
> kbuf.bufsz = initrd_len;
> - kbuf.mem = 0;
> + kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
> kbuf.memsz = initrd_len;
> kbuf.buf_align = 0;
> /* within 1GB-aligned window of up to 32GB in size */
> @@ -204,7 +204,7 @@ int load_other_segments(struct kimage *image,
> dtb_len = fdt_totalsize(dtb);
> kbuf.buffer = dtb;
> kbuf.bufsz = dtb_len;
> - kbuf.mem = 0;
> + kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
> kbuf.memsz = dtb_len;
> /* not across 2MB boundary */
> kbuf.buf_align = SZ_2M;
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] arm64/kexec: Use consistent convention of initializing 'kxec_buf.mem' with KEXEC_BUF_MEM_UNKNOWN
2019-07-11 11:57 ` Bhupesh Sharma
@ 2019-07-26 16:49 ` James Morse
-1 siblings, 0 replies; 6+ messages in thread
From: James Morse @ 2019-07-26 16:49 UTC (permalink / raw)
To: Bhupesh Sharma
Cc: linux-arm-kernel, linux-kernel, bhupesh.linux, takahiro.akashi,
will.deacon
Hi Bhupesh,
On 11/07/2019 12:57, Bhupesh Sharma wrote:
> With commit b6664ba42f14 ("s390, kexec_file: drop arch_kexec_mem_walk()"),
> we introduced the KEXEC_BUF_MEM_UNKNOWN macro. If kexec_buf.mem is set
> to this value, kexec_locate_mem_hole() will try to allocate free memory.
>
> While other arch(s) like s390 and x86_64 already use this macro to
> initialize kexec_buf.mem with, arm64 uses an equivalent value of 0.
> Replace it with KEXEC_BUF_MEM_UNKNOWN, to keep the convention of
> initializing 'kxec_buf.mem' consistent across various archs.
Reviewed-by: James Morse <james.morse@arm.com>
Thanks,
James
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] arm64/kexec: Use consistent convention of initializing 'kxec_buf.mem' with KEXEC_BUF_MEM_UNKNOWN
@ 2019-07-26 16:49 ` James Morse
0 siblings, 0 replies; 6+ messages in thread
From: James Morse @ 2019-07-26 16:49 UTC (permalink / raw)
To: Bhupesh Sharma
Cc: takahiro.akashi, bhupesh.linux, will.deacon, linux-kernel,
linux-arm-kernel
Hi Bhupesh,
On 11/07/2019 12:57, Bhupesh Sharma wrote:
> With commit b6664ba42f14 ("s390, kexec_file: drop arch_kexec_mem_walk()"),
> we introduced the KEXEC_BUF_MEM_UNKNOWN macro. If kexec_buf.mem is set
> to this value, kexec_locate_mem_hole() will try to allocate free memory.
>
> While other arch(s) like s390 and x86_64 already use this macro to
> initialize kexec_buf.mem with, arm64 uses an equivalent value of 0.
> Replace it with KEXEC_BUF_MEM_UNKNOWN, to keep the convention of
> initializing 'kxec_buf.mem' consistent across various archs.
Reviewed-by: James Morse <james.morse@arm.com>
Thanks,
James
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-07-26 16:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11 11:57 [PATCH] arm64/kexec: Use consistent convention of initializing 'kxec_buf.mem' with KEXEC_BUF_MEM_UNKNOWN Bhupesh Sharma
2019-07-11 11:57 ` Bhupesh Sharma
2019-07-11 14:52 ` Matthias Brugger
2019-07-11 14:52 ` Matthias Brugger
2019-07-26 16:49 ` James Morse
2019-07-26 16:49 ` James Morse
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.