Skip to content

Commit 61de13d

Browse files
ardbiesheuvelsuryasaimadhu
authored andcommitted
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 <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 30c9ca1 commit 61de13d

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

arch/x86/boot/compressed/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ vmlinux-objs-$(CONFIG_RANDOMIZE_BASE) += $(obj)/kaslr.o
100100
ifdef CONFIG_X86_64
101101
vmlinux-objs-y += $(obj)/ident_map_64.o
102102
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
104104
vmlinux-objs-y += $(obj)/pgtable_64.o
105105
vmlinux-objs-$(CONFIG_AMD_MEM_ENCRYPT) += $(obj)/sev.o
106106
endif

arch/x86/boot/compressed/mem_encrypt.S

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ SYM_FUNC_END(startup32_check_sev_cbit)
307307

308308
.data
309309

310-
#ifdef CONFIG_AMD_MEM_ENCRYPT
311310
.balign 8
312311
SYM_DATA(sme_me_mask, .quad 0)
313312
SYM_DATA(sev_status, .quad 0)
@@ -323,4 +322,3 @@ SYM_DATA_START_LOCAL(boot32_idt_desc)
323322
.word . - boot32_idt - 1
324323
.long 0
325324
SYM_DATA_END(boot32_idt_desc)
326-
#endif

0 commit comments

Comments
 (0)