From 6c0ef35cdc3164fda9c7ddd15db58793b1bd3263 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 27 Mar 2020 04:33:17 +0000 Subject: cmd: efidebug: fix int to pointer cast On 32 bit systems fix warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Fixes: a415d61eac26 ("cmd: map addresses to sysmem in efidebug memmap") Signed-off-by: Heinrich Schuchardt --- cmd/efidebug.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/efidebug.c b/cmd/efidebug.c index bb7c13d6a1c..c1bb76477a6 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -489,10 +489,12 @@ static int do_efi_show_memmap(cmd_tbl_t *cmdtp, int flag, printf("%-16s %.*llx-%.*llx", type, EFI_PHYS_ADDR_WIDTH, - (u64)map_to_sysmem((void *)map->physical_start), + (u64)map_to_sysmem((void *)(uintptr_t) + map->physical_start), EFI_PHYS_ADDR_WIDTH, - (u64)map_to_sysmem((void *)map->physical_start + - map->num_pages * EFI_PAGE_SIZE)); + (u64)map_to_sysmem((void *)(uintptr_t) + (map->physical_start + + map->num_pages * EFI_PAGE_SIZE))); print_memory_attributes(map->attribute); putc('\n'); -- cgit v1.3.1 From 4ef2b0d5512857c1af1110a0b23744c00a585cb2 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 24 Mar 2020 07:37:52 +0100 Subject: efi_loader: only reserve memory if fdt node enabled Sub-nodes of /reserved-memory may be disabled. In this case we should not reserve memory in the memory map. Reported-by: Patrick DELAUNAY Fixes: fef907b2e440 ("efi_loader: create reservations after ft_board_setup") Signed-off-by: Heinrich Schuchardt Reviewed-by: Atish Patra --- cmd/bootefi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/bootefi.c b/cmd/bootefi.c index 3bbe2d6a1a4..aaed5755059 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -199,7 +199,8 @@ static void efi_carve_out_dt_rsv(void *fdt) * The /reserved-memory node may have children with * a size instead of a reg property. */ - if (addr != FDT_ADDR_T_NONE) + if (addr != FDT_ADDR_T_NONE && + fdtdec_get_is_enabled(fdt, subnode)) efi_reserve_memory(addr, size); subnode = fdt_next_subnode(fdt, subnode); } -- cgit v1.3.1