hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/arch/s390/kernel/machine_kexec.c
....@@ -14,11 +14,8 @@
1414 #include <linux/reboot.h>
1515 #include <linux/ftrace.h>
1616 #include <linux/debug_locks.h>
17
-#include <linux/suspend.h>
1817 #include <asm/cio.h>
1918 #include <asm/setup.h>
20
-#include <asm/pgtable.h>
21
-#include <asm/pgalloc.h>
2219 #include <asm/smp.h>
2320 #include <asm/ipl.h>
2421 #include <asm/diag.h>
....@@ -27,6 +24,7 @@
2724 #include <asm/cacheflush.h>
2825 #include <asm/os_info.h>
2926 #include <asm/set_memory.h>
27
+#include <asm/stacktrace.h>
3028 #include <asm/switch_to.h>
3129 #include <asm/nmi.h>
3230
....@@ -36,36 +34,6 @@
3634 extern const unsigned long long relocate_kernel_len;
3735
3836 #ifdef CONFIG_CRASH_DUMP
39
-
40
-/*
41
- * PM notifier callback for kdump
42
- */
43
-static int machine_kdump_pm_cb(struct notifier_block *nb, unsigned long action,
44
- void *ptr)
45
-{
46
- switch (action) {
47
- case PM_SUSPEND_PREPARE:
48
- case PM_HIBERNATION_PREPARE:
49
- if (kexec_crash_image)
50
- arch_kexec_unprotect_crashkres();
51
- break;
52
- case PM_POST_SUSPEND:
53
- case PM_POST_HIBERNATION:
54
- if (kexec_crash_image)
55
- arch_kexec_protect_crashkres();
56
- break;
57
- default:
58
- return NOTIFY_DONE;
59
- }
60
- return NOTIFY_OK;
61
-}
62
-
63
-static int __init machine_kdump_pm_init(void)
64
-{
65
- pm_notifier(machine_kdump_pm_cb, 0);
66
- return 0;
67
-}
68
-arch_initcall(machine_kdump_pm_init);
6937
7038 /*
7139 * Reset the system, copy boot CPU registers to absolute zero,
....@@ -95,7 +63,7 @@
9563 start_kdump(1);
9664
9765 /* Die if start_kdump returns */
98
- disabled_wait((unsigned long) __builtin_return_address(0));
66
+ disabled_wait();
9967 }
10068
10169 /*
....@@ -140,7 +108,20 @@
140108 */
141109 store_status(__do_machine_kdump, image);
142110 }
143
-#endif
111
+
112
+static unsigned long do_start_kdump(unsigned long addr)
113
+{
114
+ struct kimage *image = (struct kimage *) addr;
115
+ int (*start_kdump)(int) = (void *)image->start;
116
+ int rc;
117
+
118
+ __arch_local_irq_stnsm(0xfb); /* disable DAT */
119
+ rc = start_kdump(0);
120
+ __arch_local_irq_stosm(0x04); /* enable DAT */
121
+ return rc;
122
+}
123
+
124
+#endif /* CONFIG_CRASH_DUMP */
144125
145126 /*
146127 * Check if kdump checksums are valid: We call purgatory with parameter "0"
....@@ -148,12 +129,11 @@
148129 static bool kdump_csum_valid(struct kimage *image)
149130 {
150131 #ifdef CONFIG_CRASH_DUMP
151
- int (*start_kdump)(int) = (void *)image->start;
152132 int rc;
153133
154
- __arch_local_irq_stnsm(0xfb); /* disable DAT */
155
- rc = start_kdump(0);
156
- __arch_local_irq_stosm(0x04); /* enable DAT */
134
+ preempt_disable();
135
+ rc = CALL_ON_STACK(do_start_kdump, S390_lowcore.nodat_stack, 1, image);
136
+ preempt_enable();
157137 return rc == 0;
158138 #else
159139 return false;
....@@ -243,6 +223,9 @@
243223 VMCOREINFO_SYMBOL(lowcore_ptr);
244224 VMCOREINFO_SYMBOL(high_memory);
245225 VMCOREINFO_LENGTH(lowcore_ptr, NR_CPUS);
226
+ vmcoreinfo_append_str("SDMA=%lx\n", __sdma);
227
+ vmcoreinfo_append_str("EDMA=%lx\n", __edma);
228
+ vmcoreinfo_append_str("KERNELOFFSET=%lx\n", kaslr_offset());
246229 mem_assign_absolute(S390_lowcore.vmcore_info, paddr_vmcoreinfo_note());
247230 }
248231
....@@ -271,7 +254,7 @@
271254 (*data_mover)(&image->head, image->start);
272255
273256 /* Die if kexec returns */
274
- disabled_wait((unsigned long) __builtin_return_address(0));
257
+ disabled_wait();
275258 }
276259
277260 /*