]> xenbits.xensource.com Git - qemu-upstream-4.5-testing.git/commitdiff
hw/arm/boot: Set PC correctly when loading AArch64 ELF files
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 4 Aug 2014 13:41:53 +0000 (14:41 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 6 Aug 2014 20:09:41 +0000 (15:09 -0500)
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 <cov@codeaurora.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Christopher Covington <cov@codeaurora.org>
Cc: qemu-stable@nongnu.org
(cherry picked from commit a9047ec3f6ab56295cba5b07e0d46cded9e2a7ff)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/arm/boot.c

index 3d1f4a255b485eb52864e3fefb16c5da9cef37e1..12417617a3cccca4ecd23261b23a25523e11966d 100644 (file)
@@ -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) {