History

x86/purgatory: Omit use of bin2c

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).

Masahiro Yamada committed 4 years ago

Commit 2d17bd21 parent 61922d35 files · +17 −10Browse files

Unified · Split

5 files
  1. arch/x86/.gitignore +0 −2
  2. arch/x86/Kconfig +0 −1
  3. arch/x86/purgatory/Makefile +1 −7
  4. arch/x86/purgatory/kexec-purgatory.S +14 −0
  5. scripts/remove-stale-files +2 −0
arch/x86/.gitignore+0−2
@@ -3,6 +3,4 @@ boot/compressed/vmlinux · 2 unmodified lines
3tools/test_get_len3tools/test_get_len
4tools/insn_sanity4tools/insn_sanity
5tools/insn_decoder_test5tools/insn_decoder_test
6purgatory/kexec-purgatory.c
7purgatory/purgatory.ro6purgatory/purgatory.ro
8
arch/x86/Kconfig+0−1
@@ -2032,7 +2032,6 @@ config KEXEC · 2031 unmodified lines
2032config KEXEC_FILE2032config KEXEC_FILE
2033 bool "kexec file based system call"2033 bool "kexec file based system call"
2034 select KEXEC_CORE2034 select KEXEC_CORE
2035 select BUILD_BIN2C
2036 depends on X86_642035 depends on X86_64
2037 depends on CRYPTO=y2036 depends on CRYPTO=y
2038 depends on CRYPTO_SHA256=y2037 depends on CRYPTO_SHA256=y
arch/x86/purgatory/Makefile+1−7
@@ -73,12 +73,6 @@ $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE · 72 unmodified lines
73$(obj)/purgatory.chk: $(obj)/purgatory.ro FORCE73$(obj)/purgatory.chk: $(obj)/purgatory.ro FORCE
74 $(call if_changed,ld)74 $(call if_changed,ld)
75 75
76targets += kexec-purgatory.c76$(obj)/kexec-purgatory.o: $(obj)/purgatory.ro $(obj)/purgatory.chk
77
78quiet_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
84obj-y += kexec-purgatory.o78obj-y += kexec-purgatory.o
arch/x86/purgatory/kexec-purgatory.S+14−0
@@ -0,0 +1,14 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2
3 .section .rodata, "a"
4
5 .align 8
6kexec_purgatory:
7 .globl kexec_purgatory
8 .incbin "arch/x86/purgatory/purgatory.ro"
9.Lkexec_purgatory_end:
10
11 .align 8
12kexec_purgatory_size:
13 .globl kexec_purgatory_size
14 .quad .Lkexec_purgatory_end - kexec_purgatory
scripts/remove-stale-files+2−0
@@ -41,3 +41,5 @@ if [ -n "${building_out_of_srctree}" ]; then · 40 unmodified lines
41fi41fi
42 42
43rm -f scripts/extract-cert43rm -f scripts/extract-cert
44
45rm -f arch/x86/purgatory/kexec-purgatory.c