diff options
-rw-r--r-- | arch/arm64/Kconfig | 108 | ||||
-rw-r--r-- | arch/arm64/kernel/cpu_errata.c | 14 |
2 files changed, 122 insertions, 0 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 2294be00f0ca..f5412d628ff6 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig | |||
@@ -195,6 +195,114 @@ endmenu | |||
195 | 195 | ||
196 | menu "Kernel Features" | 196 | menu "Kernel Features" |
197 | 197 | ||
198 | menu "ARM errata workarounds via the alternatives framework" | ||
199 | |||
200 | config ARM64_ERRATUM_826319 | ||
201 | bool "Cortex-A53: 826319: System might deadlock if a write cannot complete until read data is accepted" | ||
202 | default y | ||
203 | help | ||
204 | This option adds an alternative code sequence to work around ARM | ||
205 | erratum 826319 on Cortex-A53 parts up to r0p2 with an AMBA 4 ACE or | ||
206 | AXI master interface and an L2 cache. | ||
207 | |||
208 | If a Cortex-A53 uses an AMBA AXI4 ACE interface to other processors | ||
209 | and is unable to accept a certain write via this interface, it will | ||
210 | not progress on read data presented on the read data channel and the | ||
211 | system can deadlock. | ||
212 | |||
213 | The workaround promotes data cache clean instructions to | ||
214 | data cache clean-and-invalidate. | ||
215 | Please note that this does not necessarily enable the workaround, | ||
216 | as it depends on the alternative framework, which will only patch | ||
217 | the kernel if an affected CPU is detected. | ||
218 | |||
219 | If unsure, say Y. | ||
220 | |||
221 | config ARM64_ERRATUM_827319 | ||
222 | bool "Cortex-A53: 827319: Data cache clean instructions might cause overlapping transactions to the interconnect" | ||
223 | default y | ||
224 | help | ||
225 | This option adds an alternative code sequence to work around ARM | ||
226 | erratum 827319 on Cortex-A53 parts up to r0p2 with an AMBA 5 CHI | ||
227 | master interface and an L2 cache. | ||
228 | |||
229 | Under certain conditions this erratum can cause a clean line eviction | ||
230 | to occur at the same time as another transaction to the same address | ||
231 | on the AMBA 5 CHI interface, which can cause data corruption if the | ||
232 | interconnect reorders the two transactions. | ||
233 | |||
234 | The workaround promotes data cache clean instructions to | ||
235 | data cache clean-and-invalidate. | ||
236 | Please note that this does not necessarily enable the workaround, | ||
237 | as it depends on the alternative framework, which will only patch | ||
238 | the kernel if an affected CPU is detected. | ||
239 | |||
240 | If unsure, say Y. | ||
241 | |||
242 | config ARM64_ERRATUM_824069 | ||
243 | bool "Cortex-A53: 824069: Cache line might not be marked as clean after a CleanShared snoop" | ||
244 | default y | ||
245 | help | ||
246 | This option adds an alternative code sequence to work around ARM | ||
247 | erratum 824069 on Cortex-A53 parts up to r0p2 when it is connected | ||
248 | to a coherent interconnect. | ||
249 | |||
250 | If a Cortex-A53 processor is executing a store or prefetch for | ||
251 | write instruction at the same time as a processor in another | ||
252 | cluster is executing a cache maintenance operation to the same | ||
253 | address, then this erratum might cause a clean cache line to be | ||
254 | incorrectly marked as dirty. | ||
255 | |||
256 | The workaround promotes data cache clean instructions to | ||
257 | data cache clean-and-invalidate. | ||
258 | Please note that this option does not necessarily enable the | ||
259 | workaround, as it depends on the alternative framework, which will | ||
260 | only patch the kernel if an affected CPU is detected. | ||
261 | |||
262 | If unsure, say Y. | ||
263 | |||
264 | config ARM64_ERRATUM_819472 | ||
265 | bool "Cortex-A53: 819472: Store exclusive instructions might cause data corruption" | ||
266 | default y | ||
267 | help | ||
268 | This option adds an alternative code sequence to work around ARM | ||
269 | erratum 819472 on Cortex-A53 parts up to r0p1 with an L2 cache | ||
270 | present when it is connected to a coherent interconnect. | ||
271 | |||
272 | If the processor is executing a load and store exclusive sequence at | ||
273 | the same time as a processor in another cluster is executing a cache | ||
274 | maintenance operation to the same address, then this erratum might | ||
275 | cause data corruption. | ||
276 | |||
277 | The workaround promotes data cache clean instructions to | ||
278 | data cache clean-and-invalidate. | ||
279 | Please note that this does not necessarily enable the workaround, | ||
280 | as it depends on the alternative framework, which will only patch | ||
281 | the kernel if an affected CPU is detected. | ||
282 | |||
283 | If unsure, say Y. | ||
284 | |||
285 | config ARM64_ERRATUM_832075 | ||
286 | bool "Cortex-A57: 832075: possible deadlock on mixing exclusive memory accesses with device loads" | ||
287 | default y | ||
288 | help | ||
289 | This option adds an alternative code sequence to work around ARM | ||
290 | erratum 832075 on Cortex-A57 parts up to r1p2. | ||
291 | |||
292 | Affected Cortex-A57 parts might deadlock when exclusive load/store | ||
293 | instructions to Write-Back memory are mixed with Device loads. | ||
294 | |||
295 | The workaround is to promote device loads to use Load-Acquire | ||
296 | semantics. | ||
297 | Please note that this does not necessarily enable the workaround, | ||
298 | as it depends on the alternative framework, which will only patch | ||
299 | the kernel if an affected CPU is detected. | ||
300 | |||
301 | If unsure, say Y. | ||
302 | |||
303 | endmenu | ||
304 | |||
305 | |||
198 | choice | 306 | choice |
199 | prompt "Page size" | 307 | prompt "Page size" |
200 | default ARM64_4K_PAGES | 308 | default ARM64_4K_PAGES |
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c index 30935d2da55a..5a5226ffcbc8 100644 --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c | |||
@@ -65,18 +65,32 @@ is_affected_midr_range(struct arm64_cpu_capabilities *entry) | |||
65 | .midr_range_max = max | 65 | .midr_range_max = max |
66 | 66 | ||
67 | struct arm64_cpu_capabilities arm64_errata[] = { | 67 | struct arm64_cpu_capabilities arm64_errata[] = { |
68 | #if defined(CONFIG_ARM64_ERRATUM_826319) || \ | ||
69 | defined(CONFIG_ARM64_ERRATUM_827319) || \ | ||
70 | defined(CONFIG_ARM64_ERRATUM_824069) | ||
68 | { | 71 | { |
69 | /* Cortex-A53 r0p[012] */ | 72 | /* Cortex-A53 r0p[012] */ |
70 | .desc = "ARM errata 826319, 827319, 824069", | 73 | .desc = "ARM errata 826319, 827319, 824069", |
71 | .capability = ARM64_WORKAROUND_CLEAN_CACHE, | 74 | .capability = ARM64_WORKAROUND_CLEAN_CACHE, |
72 | MIDR_RANGE(MIDR_CORTEX_A53, 0x00, 0x02), | 75 | MIDR_RANGE(MIDR_CORTEX_A53, 0x00, 0x02), |
73 | }, | 76 | }, |
77 | #endif | ||
78 | #ifdef CONFIG_ARM64_ERRATUM_819472 | ||
79 | { | ||
80 | /* Cortex-A53 r0p[01] */ | ||
81 | .desc = "ARM errata 819472", | ||
82 | .capability = ARM64_WORKAROUND_CLEAN_CACHE, | ||
83 | MIDR_RANGE(MIDR_CORTEX_A53, 0x00, 0x01), | ||
84 | }, | ||
85 | #endif | ||
86 | #ifdef CONFIG_ARM64_ERRATUM_832075 | ||
74 | { | 87 | { |
75 | /* Cortex-A57 r0p0 - r1p2 */ | 88 | /* Cortex-A57 r0p0 - r1p2 */ |
76 | .desc = "ARM erratum 832075", | 89 | .desc = "ARM erratum 832075", |
77 | .capability = ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE, | 90 | .capability = ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE, |
78 | MIDR_RANGE(MIDR_CORTEX_A57, 0x00, 0x12), | 91 | MIDR_RANGE(MIDR_CORTEX_A57, 0x00, 0x12), |
79 | }, | 92 | }, |
93 | #endif | ||
80 | { | 94 | { |
81 | } | 95 | } |
82 | }; | 96 | }; |