diff options
author | Mark Rutland <mark.rutland@arm.com> | 2016-09-07 06:07:09 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2016-09-12 05:46:07 -0400 |
commit | 6ba3b554f5b9b53cb99c0edb93f0ea855fbc712a (patch) | |
tree | e9dc583beb65d3deb66fa72184afe4ed8550f9af /arch/arm64/kernel/entry.S | |
parent | 792d47379f4d4c76692f1795f33d38582f8907fa (diff) |
arm64: use alternative auto-nop
Make use of the new alternative_if and alternative_else_nop_endif and
get rid of our homebew NOP sleds, making the code simpler to read.
Note that for cpu_do_switch_mm the ret has been moved out of the
alternative sequence, and in the default case there will be three
additional NOPs executed.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/kernel/entry.S')
-rw-r--r-- | arch/arm64/kernel/entry.S | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 6880dcc3b465..223d54a4d66b 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S | |||
@@ -150,13 +150,7 @@ | |||
150 | ldr x23, [sp, #S_SP] // load return stack pointer | 150 | ldr x23, [sp, #S_SP] // load return stack pointer |
151 | msr sp_el0, x23 | 151 | msr sp_el0, x23 |
152 | #ifdef CONFIG_ARM64_ERRATUM_845719 | 152 | #ifdef CONFIG_ARM64_ERRATUM_845719 |
153 | alternative_if_not ARM64_WORKAROUND_845719 | 153 | alternative_if ARM64_WORKAROUND_845719 |
154 | nop | ||
155 | nop | ||
156 | #ifdef CONFIG_PID_IN_CONTEXTIDR | ||
157 | nop | ||
158 | #endif | ||
159 | alternative_else | ||
160 | tbz x22, #4, 1f | 154 | tbz x22, #4, 1f |
161 | #ifdef CONFIG_PID_IN_CONTEXTIDR | 155 | #ifdef CONFIG_PID_IN_CONTEXTIDR |
162 | mrs x29, contextidr_el1 | 156 | mrs x29, contextidr_el1 |
@@ -165,7 +159,7 @@ alternative_else | |||
165 | msr contextidr_el1, xzr | 159 | msr contextidr_el1, xzr |
166 | #endif | 160 | #endif |
167 | 1: | 161 | 1: |
168 | alternative_endif | 162 | alternative_else_nop_endif |
169 | #endif | 163 | #endif |
170 | .endif | 164 | .endif |
171 | msr elr_el1, x21 // set up the return data | 165 | msr elr_el1, x21 // set up the return data |