Ting Shen has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31122
Change subject: WIP: selfload: check target memory type in selfload ......................................................................
WIP: selfload: check target memory type in selfload
Change-Id: Iecdeedd9e8da67f73ac47d2a82e85b306469a626 Signed-off-by: Ting Shen phoenixshen@google.com --- M src/arch/arm64/arm_tf.c M src/include/bootmem.h M src/include/program_loading.h M src/lib/bootmem.c M src/lib/prog_loaders.c M src/lib/selfboot.c 6 files changed, 29 insertions(+), 18 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/31122/1
diff --git a/src/arch/arm64/arm_tf.c b/src/arch/arm64/arm_tf.c index eaf8739..b74f7be 100644 --- a/src/arch/arm64/arm_tf.c +++ b/src/arch/arm64/arm_tf.c @@ -19,6 +19,7 @@ #include <arch/transition.h> #include <arm_tf.h> #include <assert.h> +#include <bootmem.h> #include <cbfs.h> #include <program_loading.h>
@@ -49,7 +50,7 @@ if (prog_locate(&bl31)) die("BL31 not found");
- if (!selfload(&bl31)) + if (!selfload_check(&bl31, BM_MEM_RESERVED)) die("BL31 load failed"); bl31_entry = prog_entry(&bl31);
diff --git a/src/include/bootmem.h b/src/include/bootmem.h index 0a960c9..bfb7074 100644 --- a/src/include/bootmem.h +++ b/src/include/bootmem.h @@ -42,6 +42,7 @@ BM_MEM_OS_CUTOFF = BM_MEM_TABLE, BM_MEM_RAMSTAGE, BM_MEM_PAYLOAD, + BM_MEM_BL31, /* Reserved for BL31. */ BM_MEM_LAST, /* Last entry in this list */ };
@@ -95,7 +96,8 @@ bool bootmem_walk(range_action_t action, void *arg);
/* Return 1 if region targets usable RAM, 0 otherwise. */ -int bootmem_region_targets_usable_ram(uint64_t start, uint64_t size); +int bootmem_region_targets_usable_ram(uint64_t start, uint64_t size, + enum bootmem_type dest_type);
/* Allocate a temporary buffer from the unused RAM areas. */ void *bootmem_allocate_buffer(size_t size); diff --git a/src/include/program_loading.h b/src/include/program_loading.h index 468f0b3..7be59e2 100644 --- a/src/include/program_loading.h +++ b/src/include/program_loading.h @@ -16,6 +16,7 @@ #ifndef PROGRAM_LOADING_H #define PROGRAM_LOADING_H
+#include <bootmem.h> #include <commonlib/region.h> #include <stdint.h> #include <stddef.h> @@ -206,7 +207,7 @@ * * Defined in src/lib/selfboot.c */ -bool selfload_check(struct prog *payload); +bool selfload_check(struct prog *payload, enum bootmem_type dest_type); bool selfload(struct prog *payload);
#endif /* PROGRAM_LOADING_H */ diff --git a/src/lib/bootmem.c b/src/lib/bootmem.c index 2f9b5dc..5a0f66f 100644 --- a/src/lib/bootmem.c +++ b/src/lib/bootmem.c @@ -202,7 +202,8 @@ }
static int bootmem_region_targets_ram(uint64_t start, uint64_t end, - struct memranges *bm) + struct memranges *bm, + enum bootmem_type dest_type) { const struct range_entry *r;
@@ -212,7 +213,7 @@ break;
if (start >= range_entry_base(r) && end <= range_entry_end(r)) { - if (range_entry_tag(r) == BM_MEM_RAM) + if (range_entry_tag(r) == dest_type) return 1; } } @@ -223,9 +224,11 @@ * Returns 1 if the requested memory range is all tagged as type BM_MEM_RAM. * Otherwise returns 0. */ -int bootmem_region_targets_usable_ram(uint64_t start, uint64_t size) +int bootmem_region_targets_usable_ram(uint64_t start, uint64_t size, + enum bootmem_type dest_type) { - return bootmem_region_targets_ram(start, start + size, &bootmem); + return bootmem_region_targets_ram(start, start + size, &bootmem, + dest_type); }
void *bootmem_allocate_buffer(size_t size) diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c index ac80a62..70ea7ef 100644 --- a/src/lib/prog_loaders.c +++ b/src/lib/prog_loaders.c @@ -182,7 +182,7 @@
switch (prog_cbfs_type(payload)) { case CBFS_TYPE_SELF: /* Simple ELF */ - selfload_check(payload); + selfload_check(payload, BM_MEM_RAM); break; case CBFS_TYPE_FIT: /* Flattened image tree */ if (IS_ENABLED(CONFIG_PAYLOAD_FIT_SUPPORT)) { diff --git a/src/lib/selfboot.c b/src/lib/selfboot.c index 9c52cd6..fcdfa0f 100644 --- a/src/lib/selfboot.c +++ b/src/lib/selfboot.c @@ -30,7 +30,7 @@ #include <cbmem.h>
/* The type syntax for C is essentially unparsable. -- Rob Pike */ -typedef int (*checker_t)(struct cbfs_payload_segment *cbfssegs); +typedef int (*checker_t)(struct cbfs_payload_segment *cbfssegs, void *args);
/* Decode a serialized cbfs payload segment * from memory into native endianness. @@ -46,10 +46,11 @@ segment->mem_len = read_be32(&src->mem_len); }
-static int segment_targets_usable_ram(void *dest, unsigned long memsz) +static int segment_targets_usable_ram(void *dest, unsigned long memsz, + enum bootmem_type dest_type) { uintptr_t d = (uintptr_t) dest; - if (bootmem_region_targets_usable_ram(d, memsz)) + if (bootmem_region_targets_usable_ram(d, memsz, dest_type)) return 1;
if (payload_arch_usable_ram_quirk(d, memsz)) @@ -140,11 +141,13 @@ return read_be32(&(seg + 1)->type) == PAYLOAD_SEGMENT_ENTRY; }
-static int check_payload_segments(struct cbfs_payload_segment *cbfssegs) +static int check_payload_segments(struct cbfs_payload_segment *cbfssegs, + void *args) { uint8_t *dest; size_t memsz; struct cbfs_payload_segment *first_segment, *seg, segment; + enum bootmem_type dest_type = *(enum bootmem_type *)args;
for (first_segment = seg = cbfssegs;; ++seg) { printk(BIOS_DEBUG, "Checking segment from ROM address 0x%p\n", seg); @@ -153,7 +156,7 @@ memsz = segment.mem_len; if (segment.type == PAYLOAD_SEGMENT_ENTRY) break; - if (!segment_targets_usable_ram(dest, memsz)) + if (!segment_targets_usable_ram(dest, memsz, dest_type)) return -1; } return 0; @@ -244,7 +247,8 @@ return data; }
-static bool _selfload(struct prog *payload, checker_t f) +static bool _selfload(struct prog *payload, checker_t f, + enum bootmem_type dest_type) { uintptr_t entry = 0; struct cbfs_payload_segment *cbfssegs; @@ -256,7 +260,7 @@
cbfssegs = &((struct cbfs_payload *)data)->segments;
- if (f && f(cbfssegs)) + if (f && f(cbfssegs, &dest_type)) goto out;
if (load_payload_segments(cbfssegs, &entry)) @@ -275,12 +279,12 @@ return false; }
-bool selfload_check(struct prog *payload) +bool selfload_check(struct prog *payload, enum bootmem_type dest_type) { - return _selfload(payload, check_payload_segments); + return _selfload(payload, check_payload_segments, dest_type); }
bool selfload(struct prog *payload) { - return _selfload(payload, NULL); + return _selfload(payload, NULL, 0); }
Hello Julius Werner, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31122
to look at the new patch set (#2).
Change subject: WIP: selfload: check target memory type in selfload_check ......................................................................
WIP: selfload: check target memory type in selfload_check
Modify selfload_check to accept a memory type argument, to verify that the image is loaded to an area of given memory type.
Change-Id: Iecdeedd9e8da67f73ac47d2a82e85b306469a626 Signed-off-by: Ting Shen phoenixshen@google.com --- M src/arch/arm64/arm_tf.c M src/include/bootmem.h M src/include/program_loading.h M src/lib/bootmem.c M src/lib/prog_loaders.c M src/lib/selfboot.c 6 files changed, 28 insertions(+), 27 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/31122/2
Hello Julius Werner, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31122
to look at the new patch set (#3).
Change subject: WIP: selfload: check target memory type in selfload_check ......................................................................
WIP: selfload: check target memory type in selfload_check
Modify selfload_check to accept a memory type argument, to verify that the image is loaded to an area of given memory type.
Change-Id: Iecdeedd9e8da67f73ac47d2a82e85b306469a626 Signed-off-by: Ting Shen phoenixshen@google.com --- M src/arch/arm64/arm_tf.c M src/include/bootmem.h M src/include/program_loading.h M src/lib/bootmem.c M src/lib/prog_loaders.c M src/lib/selfboot.c 6 files changed, 29 insertions(+), 28 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/31122/3
Hello Julius Werner, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31122
to look at the new patch set (#4).
Change subject: selfload: check target memory type in selfload_check ......................................................................
selfload: check target memory type in selfload_check
Modify selfload_check to accept a memory type argument, to verify that the image is loaded to an area of given memory type.
Change-Id: Iecdeedd9e8da67f73ac47d2a82e85b306469a626 Signed-off-by: Ting Shen phoenixshen@google.com --- M src/arch/arm64/arm_tf.c M src/include/bootmem.h M src/include/program_loading.h M src/lib/bootmem.c M src/lib/prog_loaders.c M src/lib/selfboot.c 6 files changed, 29 insertions(+), 28 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/31122/4
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31122 )
Change subject: selfload: check target memory type in selfload_check ......................................................................
Patch Set 4: Code-Review+1
(1 comment)
@jwerner, does this look good?
https://review.coreboot.org/#/c/31122/4/src/arch/arm64/arm_tf.c File src/arch/arm64/arm_tf.c:
https://review.coreboot.org/#/c/31122/4/src/arch/arm64/arm_tf.c@53 PS4, Line 53: BM_MEM_RESERVED Maybe not in this CL, but I think we'll want to create a new BM_MEM_BL31 ?
Ting Shen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31122 )
Change subject: selfload: check target memory type in selfload_check ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/#/c/31122/4/src/arch/arm64/arm_tf.c File src/arch/arm64/arm_tf.c:
https://review.coreboot.org/#/c/31122/4/src/arch/arm64/arm_tf.c@53 PS4, Line 53: BM_MEM_RESERVED
Maybe not in this CL, but I think we'll want to create a new BM_MEM_BL31 ?
Yes, new bootmem type will be in another CL.
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31122 )
Change subject: selfload: check target memory type in selfload_check ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/#/c/31122/4//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/31122/4//COMMIT_MSG@11 PS4, Line 11: Why is that needed? Please add the motivation to the commit message.
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31122 )
Change subject: selfload: check target memory type in selfload_check ......................................................................
Patch Set 4:
(3 comments)
https://review.coreboot.org/#/c/31122/4/src/include/bootmem.h File src/include/bootmem.h:
https://review.coreboot.org/#/c/31122/4/src/include/bootmem.h@100 PS4, Line 100: bootmem_region_targets_ram Should probably rename this to bootmem_region_targets_type()
https://review.coreboot.org/#/c/31122/4/src/lib/selfboot.c File src/lib/selfboot.c:
https://review.coreboot.org/#/c/31122/4/src/lib/selfboot.c@49 PS4, Line 49: segment_targets_usable_ram Should also be renamed (e.g. segment_targets_type()).
https://review.coreboot.org/#/c/31122/4/src/lib/selfboot.c@251 PS4, Line 251: enum bootmem_type dest_type If you want to treat the checker_t argument as a void*, you should do that here already (or don't do it at all).
Hello Julius Werner, Hung-Te Lin, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31122
to look at the new patch set (#5).
Change subject: selfload: check target memory type in selfload_check ......................................................................
selfload: check target memory type in selfload_check
Currently, selflock_check() verifies that the binary is loaded in an usable RAM area.
Extend its functionality so we can also check that BL31 is loaded in a manually reserved area, and fail early if the range is not protected.
Change-Id: Iecdeedd9e8da67f73ac47d2a82e85b306469a626 Signed-off-by: Ting Shen phoenixshen@google.com --- M src/arch/arm64/arm_tf.c M src/include/bootmem.h M src/include/program_loading.h M src/lib/bootmem.c M src/lib/prog_loaders.c M src/lib/selfboot.c 6 files changed, 27 insertions(+), 27 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/31122/5
Hello Julius Werner, Hung-Te Lin, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31122
to look at the new patch set (#6).
Change subject: selfload: check target memory type in selfload_check ......................................................................
selfload: check target memory type in selfload_check
Currently, selflock_check() verifies that the binary is loaded in an usable RAM area.
Extend its functionality so we can also check that BL31 is loaded in a manually reserved area, and fail early if the range is not protected.
Change-Id: Iecdeedd9e8da67f73ac47d2a82e85b306469a626 Signed-off-by: Ting Shen phoenixshen@google.com --- M src/arch/arm64/arm_tf.c M src/include/bootmem.h M src/include/program_loading.h M src/lib/bootmem.c M src/lib/prog_loaders.c M src/lib/selfboot.c 6 files changed, 27 insertions(+), 27 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/31122/6
Ting Shen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31122 )
Change subject: selfload: check target memory type in selfload_check ......................................................................
Patch Set 6:
(5 comments)
https://review.coreboot.org/#/c/31122/4//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/31122/4//COMMIT_MSG@11 PS4, Line 11:
Why is that needed? Please add the motivation to the commit message.
Done
https://review.coreboot.org/#/c/31122/4/src/arch/arm64/arm_tf.c File src/arch/arm64/arm_tf.c:
https://review.coreboot.org/#/c/31122/4/src/arch/arm64/arm_tf.c@53 PS4, Line 53: BM_MEM_RESERVED
Yes, new bootmem type will be in another CL.
reverted this line to prevent things broken before next CL landed.
https://review.coreboot.org/#/c/31122/4/src/include/bootmem.h File src/include/bootmem.h:
https://review.coreboot.org/#/c/31122/4/src/include/bootmem.h@100 PS4, Line 100: bootmem_region_targets_ram
Should probably rename this to bootmem_region_targets_type()
Done
https://review.coreboot.org/#/c/31122/4/src/lib/selfboot.c File src/lib/selfboot.c:
https://review.coreboot.org/#/c/31122/4/src/lib/selfboot.c@49 PS4, Line 49: segment_targets_usable_ram
Should also be renamed (e.g. segment_targets_type()).
Done
https://review.coreboot.org/#/c/31122/4/src/lib/selfboot.c@251 PS4, Line 251: enum bootmem_type dest_type
If you want to treat the checker_t argument as a void*, you should do that here already (or don't do […]
Done
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31122 )
Change subject: selfload: check target memory type in selfload_check ......................................................................
Patch Set 6: Code-Review+2
(1 comment)
https://review.coreboot.org/#/c/31122/6/src/lib/selfboot.c File src/lib/selfboot.c:
https://review.coreboot.org/#/c/31122/6/src/lib/selfboot.c@53 PS6, Line 53: memsz I'm confused... was this just always a bug that nobody noticed?
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31122 )
Change subject: selfload: check target memory type in selfload_check ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/#/c/31122/6/src/lib/selfboot.c File src/lib/selfboot.c:
https://review.coreboot.org/#/c/31122/6/src/lib/selfboot.c@53 PS6, Line 53: memsz
I'm confused... […]
Oh, I missed the one extra thing you took out in bootmem.c that convered from size to end. Nevermind.
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/31122 )
Change subject: selfload: check target memory type in selfload_check ......................................................................
selfload: check target memory type in selfload_check
Currently, selflock_check() verifies that the binary is loaded in an usable RAM area.
Extend its functionality so we can also check that BL31 is loaded in a manually reserved area, and fail early if the range is not protected.
Change-Id: Iecdeedd9e8da67f73ac47d2a82e85b306469a626 Signed-off-by: Ting Shen phoenixshen@google.com Reviewed-on: https://review.coreboot.org/c/31122 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Julius Werner jwerner@chromium.org --- M src/arch/arm64/arm_tf.c M src/include/bootmem.h M src/include/program_loading.h M src/lib/bootmem.c M src/lib/prog_loaders.c M src/lib/selfboot.c 6 files changed, 27 insertions(+), 27 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved
diff --git a/src/arch/arm64/arm_tf.c b/src/arch/arm64/arm_tf.c index eaf8739..c0526e0 100644 --- a/src/arch/arm64/arm_tf.c +++ b/src/arch/arm64/arm_tf.c @@ -19,6 +19,7 @@ #include <arch/transition.h> #include <arm_tf.h> #include <assert.h> +#include <bootmem.h> #include <cbfs.h> #include <program_loading.h>
diff --git a/src/include/bootmem.h b/src/include/bootmem.h index 0a960c9..4652d08 100644 --- a/src/include/bootmem.h +++ b/src/include/bootmem.h @@ -94,8 +94,11 @@ */ bool bootmem_walk(range_action_t action, void *arg);
-/* Return 1 if region targets usable RAM, 0 otherwise. */ -int bootmem_region_targets_usable_ram(uint64_t start, uint64_t size); +/* Returns 1 if the requested memory range is all tagged as type dest_type. + * Otherwise returns 0. + */ +int bootmem_region_targets_type(uint64_t start, uint64_t size, + enum bootmem_type dest_type);
/* Allocate a temporary buffer from the unused RAM areas. */ void *bootmem_allocate_buffer(size_t size); diff --git a/src/include/program_loading.h b/src/include/program_loading.h index 468f0b3..7be59e2 100644 --- a/src/include/program_loading.h +++ b/src/include/program_loading.h @@ -16,6 +16,7 @@ #ifndef PROGRAM_LOADING_H #define PROGRAM_LOADING_H
+#include <bootmem.h> #include <commonlib/region.h> #include <stdint.h> #include <stddef.h> @@ -206,7 +207,7 @@ * * Defined in src/lib/selfboot.c */ -bool selfload_check(struct prog *payload); +bool selfload_check(struct prog *payload, enum bootmem_type dest_type); bool selfload(struct prog *payload);
#endif /* PROGRAM_LOADING_H */ diff --git a/src/lib/bootmem.c b/src/lib/bootmem.c index 2f9b5dc..c804df5 100644 --- a/src/lib/bootmem.c +++ b/src/lib/bootmem.c @@ -201,33 +201,25 @@ return false; }
-static int bootmem_region_targets_ram(uint64_t start, uint64_t end, - struct memranges *bm) +int bootmem_region_targets_type(uint64_t start, uint64_t size, + enum bootmem_type dest_type) { const struct range_entry *r; + uint64_t end = start + size;
- memranges_each_entry(r, bm) { + memranges_each_entry(r, &bootmem) { /* All further bootmem entries are beyond this range. */ if (end <= range_entry_base(r)) break;
if (start >= range_entry_base(r) && end <= range_entry_end(r)) { - if (range_entry_tag(r) == BM_MEM_RAM) + if (range_entry_tag(r) == dest_type) return 1; } } return 0; }
-/* Common testcase for loading any segments to bootmem. - * Returns 1 if the requested memory range is all tagged as type BM_MEM_RAM. - * Otherwise returns 0. - */ -int bootmem_region_targets_usable_ram(uint64_t start, uint64_t size) -{ - return bootmem_region_targets_ram(start, start + size, &bootmem); -} - void *bootmem_allocate_buffer(size_t size) { const struct range_entry *r; diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c index ac80a62..70ea7ef 100644 --- a/src/lib/prog_loaders.c +++ b/src/lib/prog_loaders.c @@ -182,7 +182,7 @@
switch (prog_cbfs_type(payload)) { case CBFS_TYPE_SELF: /* Simple ELF */ - selfload_check(payload); + selfload_check(payload, BM_MEM_RAM); break; case CBFS_TYPE_FIT: /* Flattened image tree */ if (IS_ENABLED(CONFIG_PAYLOAD_FIT_SUPPORT)) { diff --git a/src/lib/selfboot.c b/src/lib/selfboot.c index 9c52cd6..9aa4741 100644 --- a/src/lib/selfboot.c +++ b/src/lib/selfboot.c @@ -30,7 +30,7 @@ #include <cbmem.h>
/* The type syntax for C is essentially unparsable. -- Rob Pike */ -typedef int (*checker_t)(struct cbfs_payload_segment *cbfssegs); +typedef int (*checker_t)(struct cbfs_payload_segment *cbfssegs, void *args);
/* Decode a serialized cbfs payload segment * from memory into native endianness. @@ -46,10 +46,11 @@ segment->mem_len = read_be32(&src->mem_len); }
-static int segment_targets_usable_ram(void *dest, unsigned long memsz) +static int segment_targets_type(void *dest, unsigned long memsz, + enum bootmem_type dest_type) { uintptr_t d = (uintptr_t) dest; - if (bootmem_region_targets_usable_ram(d, memsz)) + if (bootmem_region_targets_type(d, memsz, dest_type)) return 1;
if (payload_arch_usable_ram_quirk(d, memsz)) @@ -140,11 +141,13 @@ return read_be32(&(seg + 1)->type) == PAYLOAD_SEGMENT_ENTRY; }
-static int check_payload_segments(struct cbfs_payload_segment *cbfssegs) +static int check_payload_segments(struct cbfs_payload_segment *cbfssegs, + void *args) { uint8_t *dest; size_t memsz; struct cbfs_payload_segment *first_segment, *seg, segment; + enum bootmem_type dest_type = *(enum bootmem_type *)args;
for (first_segment = seg = cbfssegs;; ++seg) { printk(BIOS_DEBUG, "Checking segment from ROM address 0x%p\n", seg); @@ -153,7 +156,7 @@ memsz = segment.mem_len; if (segment.type == PAYLOAD_SEGMENT_ENTRY) break; - if (!segment_targets_usable_ram(dest, memsz)) + if (!segment_targets_type(dest, memsz, dest_type)) return -1; } return 0; @@ -244,7 +247,7 @@ return data; }
-static bool _selfload(struct prog *payload, checker_t f) +static bool _selfload(struct prog *payload, checker_t f, void *args) { uintptr_t entry = 0; struct cbfs_payload_segment *cbfssegs; @@ -256,7 +259,7 @@
cbfssegs = &((struct cbfs_payload *)data)->segments;
- if (f && f(cbfssegs)) + if (f && f(cbfssegs, args)) goto out;
if (load_payload_segments(cbfssegs, &entry)) @@ -275,12 +278,12 @@ return false; }
-bool selfload_check(struct prog *payload) +bool selfload_check(struct prog *payload, enum bootmem_type dest_type) { - return _selfload(payload, check_payload_segments); + return _selfload(payload, check_payload_segments, &dest_type); }
bool selfload(struct prog *payload) { - return _selfload(payload, NULL); + return _selfload(payload, NULL, 0); }