Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/boot/compressed: Only build mem_encrypt.S if AMD_MEM_ENCRYPT=y

Avoid building the mem_encrypt.o object if memory encryption support is
not enabled to begin with.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20221122161017.2426828-17-ardb@kernel.org

authored by

Ard Biesheuvel and committed by
Borislav Petkov
61de13df 30c9ca16

+1 -3
+1 -1
arch/x86/boot/compressed/Makefile
··· 100 100 ifdef CONFIG_X86_64 101 101 vmlinux-objs-y += $(obj)/ident_map_64.o 102 102 vmlinux-objs-y += $(obj)/idt_64.o $(obj)/idt_handlers_64.o 103 - vmlinux-objs-y += $(obj)/mem_encrypt.o 103 + vmlinux-objs-$(CONFIG_AMD_MEM_ENCRYPT) += $(obj)/mem_encrypt.o 104 104 vmlinux-objs-y += $(obj)/pgtable_64.o 105 105 vmlinux-objs-$(CONFIG_AMD_MEM_ENCRYPT) += $(obj)/sev.o 106 106 endif
-2
arch/x86/boot/compressed/mem_encrypt.S
··· 307 307 308 308 .data 309 309 310 - #ifdef CONFIG_AMD_MEM_ENCRYPT 311 310 .balign 8 312 311 SYM_DATA(sme_me_mask, .quad 0) 313 312 SYM_DATA(sev_status, .quad 0) ··· 322 323 .word . - boot32_idt - 1 323 324 .long 0 324 325 SYM_DATA_END(boot32_idt_desc) 325 - #endif