aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-11-30 21:39:07 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-11-30 21:39:07 -0500
commit868dda00b98ccc701a70b8c1b0168fc3bbfd595d (patch)
tree8e9b7a3a66231ded456827504035613f50124d95
parent1f817429b2ddc08f5c92a5b83d0f303f1e0d1bd4 (diff)
parentea2412dc21cc790335d319181dddc43682aef164 (diff)
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Catalin Marinas: - Cortex-A76 erratum workaround - ftrace fix to enable syscall events on arm64 - Fix uninitialised pointer in iort_get_platform_device_domain() * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: ACPI/IORT: Fix iort_get_platform_device_domain() uninitialized pointer value arm64: ftrace: Fix to enable syscall events on arm64 arm64: Add workaround for Cortex-A76 erratum 1286807
-rw-r--r--Documentation/arm64/silicon-errata.txt1
-rw-r--r--arch/arm64/Kconfig25
-rw-r--r--arch/arm64/include/asm/ftrace.h13
-rw-r--r--arch/arm64/include/asm/tlbflush.h4
-rw-r--r--arch/arm64/kernel/cpu_errata.c20
-rw-r--r--drivers/acpi/arm64/iort.c2
6 files changed, 59 insertions, 6 deletions
diff --git a/Documentation/arm64/silicon-errata.txt b/Documentation/arm64/silicon-errata.txt
index 76ccded8b74c..8f9577621144 100644
--- a/Documentation/arm64/silicon-errata.txt
+++ b/Documentation/arm64/silicon-errata.txt
@@ -57,6 +57,7 @@ stable kernels.
57| ARM | Cortex-A73 | #858921 | ARM64_ERRATUM_858921 | 57| ARM | Cortex-A73 | #858921 | ARM64_ERRATUM_858921 |
58| ARM | Cortex-A55 | #1024718 | ARM64_ERRATUM_1024718 | 58| ARM | Cortex-A55 | #1024718 | ARM64_ERRATUM_1024718 |
59| ARM | Cortex-A76 | #1188873 | ARM64_ERRATUM_1188873 | 59| ARM | Cortex-A76 | #1188873 | ARM64_ERRATUM_1188873 |
60| ARM | Cortex-A76 | #1286807 | ARM64_ERRATUM_1286807 |
60| ARM | MMU-500 | #841119,#826419 | N/A | 61| ARM | MMU-500 | #841119,#826419 | N/A |
61| | | | | 62| | | | |
62| Cavium | ThunderX ITS | #22375, #24313 | CAVIUM_ERRATUM_22375 | 63| Cavium | ThunderX ITS | #22375, #24313 | CAVIUM_ERRATUM_22375 |
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 787d7850e064..ea2ab0330e3a 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -497,6 +497,24 @@ config ARM64_ERRATUM_1188873
497 497
498 If unsure, say Y. 498 If unsure, say Y.
499 499
500config ARM64_ERRATUM_1286807
501 bool "Cortex-A76: Modification of the translation table for a virtual address might lead to read-after-read ordering violation"
502 default y
503 select ARM64_WORKAROUND_REPEAT_TLBI
504 help
505 This option adds workaround for ARM Cortex-A76 erratum 1286807
506
507 On the affected Cortex-A76 cores (r0p0 to r3p0), if a virtual
508 address for a cacheable mapping of a location is being
509 accessed by a core while another core is remapping the virtual
510 address to a new physical page using the recommended
511 break-before-make sequence, then under very rare circumstances
512 TLBI+DSB completes before a read using the translation being
513 invalidated has been observed by other observers. The
514 workaround repeats the TLBI+DSB operation.
515
516 If unsure, say Y.
517
500config CAVIUM_ERRATUM_22375 518config CAVIUM_ERRATUM_22375
501 bool "Cavium erratum 22375, 24313" 519 bool "Cavium erratum 22375, 24313"
502 default y 520 default y
@@ -566,9 +584,16 @@ config QCOM_FALKOR_ERRATUM_1003
566 is unchanged. Work around the erratum by invalidating the walk cache 584 is unchanged. Work around the erratum by invalidating the walk cache
567 entries for the trampoline before entering the kernel proper. 585 entries for the trampoline before entering the kernel proper.
568 586
587config ARM64_WORKAROUND_REPEAT_TLBI
588 bool
589 help
590 Enable the repeat TLBI workaround for Falkor erratum 1009 and
591 Cortex-A76 erratum 1286807.
592
569config QCOM_FALKOR_ERRATUM_1009 593config QCOM_FALKOR_ERRATUM_1009
570 bool "Falkor E1009: Prematurely complete a DSB after a TLBI" 594 bool "Falkor E1009: Prematurely complete a DSB after a TLBI"
571 default y 595 default y
596 select ARM64_WORKAROUND_REPEAT_TLBI
572 help 597 help
573 On Falkor v1, the CPU may prematurely complete a DSB following a 598 On Falkor v1, the CPU may prematurely complete a DSB following a
574 TLBI xxIS invalidate maintenance operation. Repeat the TLBI operation 599 TLBI xxIS invalidate maintenance operation. Repeat the TLBI operation
diff --git a/arch/arm64/include/asm/ftrace.h b/arch/arm64/include/asm/ftrace.h
index caa955f10e19..fac54fb050d0 100644
--- a/arch/arm64/include/asm/ftrace.h
+++ b/arch/arm64/include/asm/ftrace.h
@@ -56,6 +56,19 @@ static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs)
56{ 56{
57 return is_compat_task(); 57 return is_compat_task();
58} 58}
59
60#define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
61
62static inline bool arch_syscall_match_sym_name(const char *sym,
63 const char *name)
64{
65 /*
66 * Since all syscall functions have __arm64_ prefix, we must skip it.
67 * However, as we described above, we decided to ignore compat
68 * syscalls, so we don't care about __arm64_compat_ prefix here.
69 */
70 return !strcmp(sym + 8, name);
71}
59#endif /* ifndef __ASSEMBLY__ */ 72#endif /* ifndef __ASSEMBLY__ */
60 73
61#endif /* __ASM_FTRACE_H */ 74#endif /* __ASM_FTRACE_H */
diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlbflush.h
index c3c0387aee18..5dfd23897dea 100644
--- a/arch/arm64/include/asm/tlbflush.h
+++ b/arch/arm64/include/asm/tlbflush.h
@@ -41,14 +41,14 @@
41 ALTERNATIVE("nop\n nop", \ 41 ALTERNATIVE("nop\n nop", \
42 "dsb ish\n tlbi " #op, \ 42 "dsb ish\n tlbi " #op, \
43 ARM64_WORKAROUND_REPEAT_TLBI, \ 43 ARM64_WORKAROUND_REPEAT_TLBI, \
44 CONFIG_QCOM_FALKOR_ERRATUM_1009) \ 44 CONFIG_ARM64_WORKAROUND_REPEAT_TLBI) \
45 : : ) 45 : : )
46 46
47#define __TLBI_1(op, arg) asm ("tlbi " #op ", %0\n" \ 47#define __TLBI_1(op, arg) asm ("tlbi " #op ", %0\n" \
48 ALTERNATIVE("nop\n nop", \ 48 ALTERNATIVE("nop\n nop", \
49 "dsb ish\n tlbi " #op ", %0", \ 49 "dsb ish\n tlbi " #op ", %0", \
50 ARM64_WORKAROUND_REPEAT_TLBI, \ 50 ARM64_WORKAROUND_REPEAT_TLBI, \
51 CONFIG_QCOM_FALKOR_ERRATUM_1009) \ 51 CONFIG_ARM64_WORKAROUND_REPEAT_TLBI) \
52 : : "r" (arg)) 52 : : "r" (arg))
53 53
54#define __TLBI_N(op, arg, n, ...) __TLBI_##n(op, arg) 54#define __TLBI_N(op, arg, n, ...) __TLBI_##n(op, arg)
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index a509e35132d2..6ad715d67df8 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -570,6 +570,20 @@ static const struct midr_range arm64_harden_el2_vectors[] = {
570 570
571#endif 571#endif
572 572
573#ifdef CONFIG_ARM64_WORKAROUND_REPEAT_TLBI
574
575static const struct midr_range arm64_repeat_tlbi_cpus[] = {
576#ifdef CONFIG_QCOM_FALKOR_ERRATUM_1009
577 MIDR_RANGE(MIDR_QCOM_FALKOR_V1, 0, 0, 0, 0),
578#endif
579#ifdef CONFIG_ARM64_ERRATUM_1286807
580 MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 3, 0),
581#endif
582 {},
583};
584
585#endif
586
573const struct arm64_cpu_capabilities arm64_errata[] = { 587const struct arm64_cpu_capabilities arm64_errata[] = {
574#if defined(CONFIG_ARM64_ERRATUM_826319) || \ 588#if defined(CONFIG_ARM64_ERRATUM_826319) || \
575 defined(CONFIG_ARM64_ERRATUM_827319) || \ 589 defined(CONFIG_ARM64_ERRATUM_827319) || \
@@ -695,11 +709,11 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
695 .matches = is_kryo_midr, 709 .matches = is_kryo_midr,
696 }, 710 },
697#endif 711#endif
698#ifdef CONFIG_QCOM_FALKOR_ERRATUM_1009 712#ifdef CONFIG_ARM64_WORKAROUND_REPEAT_TLBI
699 { 713 {
700 .desc = "Qualcomm Technologies Falkor erratum 1009", 714 .desc = "Qualcomm erratum 1009, ARM erratum 1286807",
701 .capability = ARM64_WORKAROUND_REPEAT_TLBI, 715 .capability = ARM64_WORKAROUND_REPEAT_TLBI,
702 ERRATA_MIDR_REV(MIDR_QCOM_FALKOR_V1, 0, 0), 716 ERRATA_MIDR_RANGE_LIST(arm64_repeat_tlbi_cpus),
703 }, 717 },
704#endif 718#endif
705#ifdef CONFIG_ARM64_ERRATUM_858921 719#ifdef CONFIG_ARM64_ERRATUM_858921
diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index 2a361e22d38d..70f4e80b9246 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -700,7 +700,7 @@ static void iort_set_device_domain(struct device *dev,
700 */ 700 */
701static struct irq_domain *iort_get_platform_device_domain(struct device *dev) 701static struct irq_domain *iort_get_platform_device_domain(struct device *dev)
702{ 702{
703 struct acpi_iort_node *node, *msi_parent; 703 struct acpi_iort_node *node, *msi_parent = NULL;
704 struct fwnode_handle *iort_fwnode; 704 struct fwnode_handle *iort_fwnode;
705 struct acpi_iort_its_group *its; 705 struct acpi_iort_its_group *its;
706 int i; 706 int i;