From ea7d0e304775e81c07269e22b4412d328c3fb2fa Mon Sep 17 00:00:00 2001 From: Yang Zhong Date: Thu, 30 Mar 2017 18:20:50 +0800 Subject: qboot: modified the malloc for fseg and high momory. The fseg and high memory malloc all use the up align mode in do_alloc(),which will result in qboot hang issue.The high memory use the down align mode and fseg memory use the up align mode. With those changes,the qemu can boot up the image with qboot. Signed-off-by: Yang Zhong Message-Id: <1490869250-4357-1-git-send-email-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini --- tables.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'tables.c') diff --git a/tables.c b/tables.c index bb533b6..32b2406 100644 --- a/tables.c +++ b/tables.c @@ -57,15 +57,13 @@ static void do_alloc(char *file, uint32_t align, uint8_t zone) if (id == -1) panic(); - if (align > 16) - n += align - 16; + if (align < 16) + align = 16; if (zone == ALLOC_FSEG) - p = malloc_fseg(n); + p = malloc_fseg_align(n, align); else - p = malloc(n); - - p = (char *)((uintptr_t)(p + align - 1) & -align); + p = malloc_align(n, align); set_file_addr(id, p); fw_cfg_read_file(id, p, n); -- cgit v1.1