arm64/kexec: Use consistent convention of initializing 'kxec_buf.mem' with KEXEC_BUF_MEM_UNKNOWN
PATCH 1/1 arm64/kexec: Use consistent convention of initializing 'kxec_buf.mem' with KEXEC_BUF_MEM_UNKNOWN
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.
--- arch/arm64/kernel/kexec_image.c | 2 +- arch/arm64/kernel/machine_kexec_file.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm64/kernel/kexec_image.c +1 -1
@@ -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 ;
arch/arm64/kernel/machine_kexec_file.c +2 -2
@@ -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 ;
Signature · 1 line
2.7.4
Quoted 9 lines · Bhupesh Sharma
With commit
b6664ba42f14("s390,kexec_file: droparch_kexec_mem_walk()"), we introduced theKEXEC_BUF_MEM_UNKNOWNmacro. 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_64already use this macro to initialize kexec_buf.mem with, arm64 uses an equivalent value of 0. Replace it withKEXEC_BUF_MEM_UNKNOWN, to keep the convention of initializing 'kxec_buf.mem' consistent across various archs.
Quoted 6 lines
Signed-off-by Bhupesh Sharma <[email protected]>---
Quoted 40 lines
arch/arm64/kernel/kexec_image.c | 2 +- arch/arm64/kernel/machine_kexec_file.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)arch/arm64/kernel/kexec_image.c +1
-1@@ -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 ;arch/arm64/kernel/machine_kexec_file.c +2
-2@@ -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 ;
Hi Bhupesh,
Quoted 8 lines · Bhupesh Sharma
With commit
b6664ba42f14("s390,kexec_file: droparch_kexec_mem_walk()"), we introduced theKEXEC_BUF_MEM_UNKNOWNmacro. 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_64already use this macro to initialize kexec_buf.mem with, arm64 uses an equivalent value of 0. Replace it withKEXEC_BUF_MEM_UNKNOWN, to keep the convention of initializing 'kxec_buf.mem' consistent across various archs.
Thanks,
James