Skip to content

Instantly share code, notes, and snippets.

Created December 28, 2012 07:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4395518 to your computer and use it in GitHub Desktop.
Save anonymous/4395518 to your computer and use it in GitHub Desktop.
exynos4-trustzone-fix.patch
Author: Saleem Abdulrasool <compnerd@compnerd.org>
Date: Thu Dec 27 23:34:32 2012 -0800
[exynos] fix build with TrustZone extensions enabled
The SMC (secure monitor call) instruction is a privileged instruction and
requires that the security extensions be enabled. Use the .arch_extension
directive to enable the security instruction set when using the SMC
instruction.
Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
--
--- arch/arm/mach-exynos/include/mach/smc.h
+++ arch/arm/mach-exynos/include/mach/smc.h
@@ -51,6 +51,7 @@
register u32 reg3 __asm__("r3") = arg3;
__asm__ volatile (
+ ".arch_extension sec\n"
"smc 0\n"
: "+r"(reg0), "+r"(reg1), "+r"(reg2), "+r"(reg3)
);
@@ -66,6 +67,7 @@
register u32 reg3 __asm__("r3") = 0;
__asm__ volatile (
+ ".arch_extension sec\n"
"smc 0\n"
: "+r"(reg0), "+r"(reg1), "+r"(reg2), "+r"(reg3)
);
--- arch/arm/mach-exynos/sleep-exynos4.S
+++ arch/arm/mach-exynos/sleep-exynos4.S
@@ -41,6 +41,9 @@
*/
ENTRY(s3c_cpu_save)
+#ifdef CONFIG_ARM_TRUSTZONE
+ .arch_extension sec
+#endif
stmfd sp!, { r3 - r12, lr }
--- arch/arm/mach-exynos/idle-exynos4.S
+++ arch/arm/mach-exynos/idle-exynos4.S
@@ -45,6 +45,9 @@
*/
ENTRY(exynos4_enter_lp)
+#ifdef CONFIG_ARM_TRUSTZONE
+ .arch_extension sec
+#endif
stmfd sp!, { r3 - r12, lr }
adr r0, sleep_save_misc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment