Created
December 28, 2012 07:39
-
-
Save anonymous/4395518 to your computer and use it in GitHub Desktop.
exynos4-trustzone-fix.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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