BL2: Sanity check value in x0 in the entry point code
authorSandrine Bailleux <sandrine.bailleux@arm.com>
Mon, 2 Dec 2013 15:45:07 +0000 (15:45 +0000)
committerDan Handley <dan.handley@arm.com>
Thu, 12 Dec 2013 16:06:48 +0000 (16:06 +0000)
Change-Id: Icef68e314e6ba0f3694189b57f4b1dbbea5ba255

bl2/aarch64/bl2_entrypoint.S

index 75970f7457c8435ac6374f54cc54e5d41921954d..03d08480789d21f2a5f6b9695211f28deb276361 100644 (file)
@@ -77,6 +77,14 @@ bl2_entrypoint:; .type bl2_entrypoint, %function
 
        isb
 
+       /* ---------------------------------------------
+        * Check the opcodes out of paranoia.
+        * ---------------------------------------------
+        */
+       mov     x0, #RUN_IMAGE
+       cmp     x0, x20
+       b.ne    _panic
+
        /* ---------------------------------------------
         * Zero out NOBITS sections. There are 2 of them:
         *   - the .bss section;