summaryrefslogtreecommitdiffstats
path: root/arch/mips/mips-Kconfig-add-QEMUMIPS64-option.patch
blob: 44d929665384866641460302e3da6447a42a0a8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
From 8b05f6af70cc61956a8563a3bc79789dcffecfc5 Mon Sep 17 00:00:00 2001
From: Bruce Ashfield <bruce.ashfield@gmail.com>
Date: Tue, 7 Jan 2020 03:34:12 +0000
Subject: [PATCH] mips: Kconfig: add QEMUMIPS64 option

In 5.4+ mips has switched to using the generic VDSO implementation, in
particular the following commits are the bulk of the changes:

   932bb934ed4d mips: compat: vdso: Use legacy syscalls as fallback
   cdab7e2c73d5 mips: vdso: Fix flip/flop vdso building bug
   b4c0f7fa5308 mips: vdso: Fix source path
   1f66c45db330 mips: Add clock_gettime64 entry point
   abed3d826f2f mips: Add clock_getres entry point
   6393e6064486 mips: fix vdso32 build, again
   24640f233b46 mips: Add support for generic vDSO
   8919975b6171 MIPS: VDSO: Fix build for binutils < 2.25
   90800281e761 MIPS: VDSO: Remove unused gettimeofday.c

There is a (currently) unknown interaction between qemumips64, the
mti_malta64 platform, glibc and VDSO that causes a segfault when
gettimeofday is called during boot. It appears that the VDSO
configuration of the gic address is incorrect, and hence when
read_gic_count() is called during do_hres() initialization, the
page is not properly mapped and a segfault is triggered.

If we avoid reading the gic, and let the vdso syscall fallbacks
be enabled, we are find for boot. The most flexible way to avoid
these reads is to make the two malta clocksources not be selected
when we are booting under qemumips64. This allows other platforms
to not be impacted.

Once a root cause of this bad mapping is found, we can drop the
new CONFIG_QEMUMIPS64 option and behaviour will revert to using
the git automatically.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 arch/mips/Kconfig | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 797d7f1ad5fe..9337527d778f 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -92,6 +92,10 @@ config MIPS
 	select SYSCTL_EXCEPTION_TRACE
 	select VIRT_TO_BUS
 
+config QEMUMIPS64
+	bool "Enable for qemumips64 specific configurations"
+        default n
+
 menu "Machine selection"
 
 choice
@@ -103,17 +107,17 @@ config MIPS_GENERIC
 	select BOOT_RAW
 	select BUILTIN_DTB
 	select CEVT_R4K
-	select CLKSRC_MIPS_GIC
 	select COMMON_CLK
 	select CPU_MIPSR2_IRQ_EI
 	select CPU_MIPSR2_IRQ_VI
-	select CSRC_R4K
 	select DMA_PERDEV_COHERENT
 	select HAVE_PCI
 	select IRQ_MIPS_CPU
 	select MIPS_AUTO_PFN_OFFSET
 	select MIPS_CPU_SCACHE
 	select MIPS_GIC
+	select CLKSRC_MIPS_GIC if !QEMUMIPS64
+	select CSRC_R4K if !QEMUMIPS64
 	select MIPS_L1_CACHE_SHIFT_7
 	select NO_EXCEPT_FILL
 	select PCI_DRIVERS_GENERIC
@@ -535,9 +539,9 @@ config MIPS_MALTA
 	select BOOT_RAW
 	select BUILTIN_DTB
 	select CEVT_R4K
-	select CLKSRC_MIPS_GIC
+	select CLKSRC_MIPS_GIC if !QEMUMIPS64
+	select CSRC_R4K if !QEMUMIPS64
 	select COMMON_CLK
-	select CSRC_R4K
 	select DMA_MAYBE_COHERENT
 	select GENERIC_ISA_DMA
 	select HAVE_PCSPKR_PLATFORM
-- 
2.19.1