From: Peter Maydell Date: Mon, 4 Aug 2014 13:41:53 +0000 (+0100) Subject: hw/arm/boot: Set PC correctly when loading AArch64 ELF files X-Git-Tag: qemu-xen-4.5.0-rc1^2~11 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e0efb023c0409b80e703e18352f7ad1c6268ce0c;p=qemu-upstream-4.6-testing.git hw/arm/boot: Set PC correctly when loading AArch64 ELF files The code in do_cpu_reset() correctly handled AArch64 CPUs when running Linux kernels, but was missing code in the branch of the if() that deals with loading ELF files. Correctly jump to the ELF entry point on reset rather than leaving the reset PC at zero. Reported-by: Christopher Covington Signed-off-by: Peter Maydell Tested-by: Christopher Covington Cc: qemu-stable@nongnu.org (cherry picked from commit a9047ec3f6ab56295cba5b07e0d46cded9e2a7ff) Signed-off-by: Michael Roth --- diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 3d1f4a255..12417617a 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -417,8 +417,12 @@ static void do_cpu_reset(void *opaque) if (info) { if (!info->is_linux) { /* Jump to the entry point. */ - env->regs[15] = info->entry & 0xfffffffe; - env->thumb = info->entry & 1; + if (env->aarch64) { + env->pc = info->entry; + } else { + env->regs[15] = info->entry & 0xfffffffe; + env->thumb = info->entry & 1; + } } else { if (CPU(cpu) == first_cpu) { if (env->aarch64) {