The .incbin assembler directive is much faster than bin2c + $(CC). Do similar refactoring as in 4c0f032d4963 ("s390/purgatory: Omit use of bin2c"). Please note the .quad directive matches to size_t in C (both 8 byte) because the purgatory is compiled only for the 64-bit kernel. (KEXEC_FILE depends on X86_64).
Unified · Split
| @@ -3,6 +3,4 @@ boot/compressed/vmlinux · 2 unmodified lines | |||
| 3 | tools/test_get_len | 3 | tools/test_get_len |
| 4 | tools/insn_sanity | 4 | tools/insn_sanity |
| 5 | tools/insn_decoder_test | 5 | tools/insn_decoder_test |
| 6 | purgatory/kexec-purgatory.c | ||
| 7 | purgatory/purgatory.ro | 6 | purgatory/purgatory.ro |
| 8 | |||
| @@ -2032,7 +2032,6 @@ config KEXEC · 2031 unmodified lines | |||
| 2032 | config KEXEC_FILE | 2032 | config KEXEC_FILE |
| 2033 | bool "kexec file based system call" | 2033 | bool "kexec file based system call" |
| 2034 | select KEXEC_CORE | 2034 | select KEXEC_CORE |
| 2035 | select BUILD_BIN2C | ||
| 2036 | depends on X86_64 | 2035 | depends on X86_64 |
| 2037 | depends on CRYPTO=y | 2036 | depends on CRYPTO=y |
| 2038 | depends on CRYPTO_SHA256=y | 2037 | depends on CRYPTO_SHA256=y |
| @@ -73,12 +73,6 @@ $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE · 72 unmodified lines | |||
| 73 | $(obj)/purgatory.chk: $(obj)/purgatory.ro FORCE | 73 | $(obj)/purgatory.chk: $(obj)/purgatory.ro FORCE |
| 74 | $(call if_changed,ld) | 74 | $(call if_changed,ld) |
| 75 | 75 | ||
| 76 | targets += kexec-purgatory.c | 76 | $(obj)/kexec-purgatory.o: $(obj)/purgatory.ro $(obj)/purgatory.chk |
| 77 | |||
| 78 | quiet_cmd_bin2c = BIN2C $@ | ||
| 79 | cmd_bin2c = $(objtree)/scripts/bin2c kexec_purgatory < $< > $@ | ||
| 80 | |||
| 81 | $(obj)/kexec-purgatory.c: $(obj)/purgatory.ro $(obj)/purgatory.chk FORCE | ||
| 82 | $(call if_changed,bin2c) | ||
| 83 | 77 | ||
| 84 | obj-y += kexec-purgatory.o | 78 | obj-y += kexec-purgatory.o |
| @@ -0,0 +1,14 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
| 2 | |||
| 3 | .section .rodata, "a" | ||
| 4 | |||
| 5 | .align 8 | ||
| 6 | kexec_purgatory: | ||
| 7 | .globl kexec_purgatory | ||
| 8 | .incbin "arch/x86/purgatory/purgatory.ro" | ||
| 9 | .Lkexec_purgatory_end: | ||
| 10 | |||
| 11 | .align 8 | ||
| 12 | kexec_purgatory_size: | ||
| 13 | .globl kexec_purgatory_size | ||
| 14 | .quad .Lkexec_purgatory_end - kexec_purgatory | ||
| @@ -41,3 +41,5 @@ if [ -n "${building_out_of_srctree}" ]; then · 40 unmodified lines | |||
| 41 | fi | 41 | fi |
| 42 | 42 | ||
| 43 | rm -f scripts/extract-cert | 43 | rm -f scripts/extract-cert |
| 44 | |||
| 45 | rm -f arch/x86/purgatory/kexec-purgatory.c | ||