hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/x86/purgatory/purgatory.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * purgatory: Runs between two kernels
34 *
....@@ -5,38 +6,17 @@
56 *
67 * Author:
78 * Vivek Goyal <vgoyal@redhat.com>
8
- *
9
- * This source code is licensed under the GNU General Public License,
10
- * Version 2. See the file COPYING for more details.
119 */
1210
1311 #include <linux/bug.h>
14
-#include <linux/sha256.h>
12
+#include <crypto/sha.h>
1513 #include <asm/purgatory.h>
1614
1715 #include "../boot/string.h"
1816
19
-unsigned long purgatory_backup_dest __section(.kexec-purgatory);
20
-unsigned long purgatory_backup_src __section(.kexec-purgatory);
21
-unsigned long purgatory_backup_sz __section(.kexec-purgatory);
17
+u8 purgatory_sha256_digest[SHA256_DIGEST_SIZE] __section(".kexec-purgatory");
2218
23
-u8 purgatory_sha256_digest[SHA256_DIGEST_SIZE] __section(.kexec-purgatory);
24
-
25
-struct kexec_sha_region purgatory_sha_regions[KEXEC_SEGMENT_MAX] __section(.kexec-purgatory);
26
-
27
-/*
28
- * On x86, second kernel requries first 640K of memory to boot. Copy
29
- * first 640K to a backup region in reserved memory range so that second
30
- * kernel can use first 640K.
31
- */
32
-static int copy_backup_region(void)
33
-{
34
- if (purgatory_backup_dest) {
35
- memcpy((void *)purgatory_backup_dest,
36
- (void *)purgatory_backup_src, purgatory_backup_sz);
37
- }
38
- return 0;
39
-}
19
+struct kexec_sha_region purgatory_sha_regions[KEXEC_SEGMENT_MAX] __section(".kexec-purgatory");
4020
4121 static int verify_sha256_digest(void)
4222 {
....@@ -68,7 +48,6 @@
6848 for (;;)
6949 ;
7050 }
71
- copy_backup_region();
7251 }
7352
7453 /*