Skip to content

Commit 64ad946

Browse files
committed
Merge tag 'x86_core_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 core updates from Borislav Petkov: - Get rid of all the .fixup sections because this generates misleading/wrong stacktraces and confuse RELIABLE_STACKTRACE and LIVEPATCH as the backtrace misses the function which is being fixed up. - Add Straight Line Speculation mitigation support which uses a new compiler switch -mharden-sls= which sticks an INT3 after a RET or an indirect branch in order to block speculation after them. Reportedly, CPUs do speculate behind such insns. - The usual set of cleanups and improvements * tag 'x86_core_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (32 commits) x86/entry_32: Fix segment exceptions objtool: Remove .fixup handling x86: Remove .fixup section x86/word-at-a-time: Remove .fixup usage x86/usercopy: Remove .fixup usage x86/usercopy_32: Simplify __copy_user_intel_nocache() x86/sgx: Remove .fixup usage x86/checksum_32: Remove .fixup usage x86/vmx: Remove .fixup usage x86/kvm: Remove .fixup usage x86/segment: Remove .fixup usage x86/fpu: Remove .fixup usage x86/xen: Remove .fixup usage x86/uaccess: Remove .fixup usage x86/futex: Remove .fixup usage x86/msr: Remove .fixup usage x86/extable: Extend extable functionality x86/entry_32: Remove .fixup usage x86/entry_64: Remove .fixup usage x86/copy_mc_64: Remove .fixup usage ...
2 parents 8e5b0ad + 9cdbeec commit 64ad946

File tree

163 files changed

+1047
-1349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+1047
-1349
lines changed

Makefile

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -688,17 +688,6 @@ ifdef CONFIG_FUNCTION_TRACER
688688
CC_FLAGS_FTRACE := -pg
689689
endif
690690

691-
ifdef CONFIG_CC_IS_GCC
692-
RETPOLINE_CFLAGS := $(call cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register)
693-
RETPOLINE_VDSO_CFLAGS := $(call cc-option,-mindirect-branch=thunk-inline -mindirect-branch-register)
694-
endif
695-
ifdef CONFIG_CC_IS_CLANG
696-
RETPOLINE_CFLAGS := -mretpoline-external-thunk
697-
RETPOLINE_VDSO_CFLAGS := -mretpoline
698-
endif
699-
export RETPOLINE_CFLAGS
700-
export RETPOLINE_VDSO_CFLAGS
701-
702691
include $(srctree)/arch/$(SRCARCH)/Makefile
703692

704693
ifdef need-config

arch/x86/Kconfig

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,18 @@ config RETPOLINE
473473
branches. Requires a compiler with -mindirect-branch=thunk-extern
474474
support for full protection. The kernel may run slower.
475475

476+
config CC_HAS_SLS
477+
def_bool $(cc-option,-mharden-sls=all)
478+
479+
config SLS
480+
bool "Mitigate Straight-Line-Speculation"
481+
depends on CC_HAS_SLS && X86_64
482+
default n
483+
help
484+
Compile the kernel with straight-line-speculation options to guard
485+
against straight line speculation. The kernel image might be slightly
486+
larger.
487+
476488
config X86_CPU_RESCTRL
477489
bool "x86 CPU resource control support"
478490
depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD)
@@ -1952,7 +1964,7 @@ config EFI
19521964

19531965
config EFI_STUB
19541966
bool "EFI stub support"
1955-
depends on EFI && !X86_USE_3DNOW
1967+
depends on EFI
19561968
depends on $(cc-option,-mabi=ms) || X86_32
19571969
select RELOCATABLE
19581970
help

arch/x86/Kconfig.cpu

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,6 @@ config X86_USE_PPRO_CHECKSUM
342342
def_bool y
343343
depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MATOM
344344

345-
config X86_USE_3DNOW
346-
def_bool y
347-
depends on (MCYRIXIII || MK7 || MGEODE_LX) && !UML
348-
349345
#
350346
# P6_NOPs are a relatively minor optimization that require a family >=
351347
# 6 processor, except that it is broken on certain VIA chips.

arch/x86/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ else
1212
KBUILD_DEFCONFIG := $(ARCH)_defconfig
1313
endif
1414

15+
ifdef CONFIG_CC_IS_GCC
16+
RETPOLINE_CFLAGS := $(call cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register)
17+
RETPOLINE_CFLAGS += $(call cc-option,-mindirect-branch-cs-prefix)
18+
RETPOLINE_VDSO_CFLAGS := $(call cc-option,-mindirect-branch=thunk-inline -mindirect-branch-register)
19+
endif
20+
ifdef CONFIG_CC_IS_CLANG
21+
RETPOLINE_CFLAGS := -mretpoline-external-thunk
22+
RETPOLINE_VDSO_CFLAGS := -mretpoline
23+
endif
24+
export RETPOLINE_CFLAGS
25+
export RETPOLINE_VDSO_CFLAGS
26+
1527
# For gcc stack alignment is specified with -mpreferred-stack-boundary,
1628
# clang has the option -mstack-alignment for that purpose.
1729
ifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
@@ -179,6 +191,10 @@ ifdef CONFIG_RETPOLINE
179191
endif
180192
endif
181193

194+
ifdef CONFIG_SLS
195+
KBUILD_CFLAGS += -mharden-sls=all
196+
endif
197+
182198
KBUILD_LDFLAGS += -m elf_$(UTS_MACHINE)
183199

184200
ifdef CONFIG_LTO_CLANG

arch/x86/boot/compressed/efi_thunk_64.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ SYM_FUNC_START(__efi64_thunk)
101101

102102
pop %rbx
103103
pop %rbp
104-
ret
104+
RET
105105
SYM_FUNC_END(__efi64_thunk)
106106

107107
.code32

arch/x86/boot/compressed/head_64.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ SYM_FUNC_START(efi32_pe_entry)
813813
2: popl %edi // restore callee-save registers
814814
popl %ebx
815815
leave
816-
ret
816+
RET
817817
SYM_FUNC_END(efi32_pe_entry)
818818

819819
.section ".rodata"
@@ -868,7 +868,7 @@ SYM_FUNC_START(startup32_set_idt_entry)
868868

869869
pop %ecx
870870
pop %ebx
871-
ret
871+
RET
872872
SYM_FUNC_END(startup32_set_idt_entry)
873873
#endif
874874

@@ -884,7 +884,7 @@ SYM_FUNC_START(startup32_load_idt)
884884
movl %eax, rva(boot32_idt_desc+2)(%ebp)
885885
lidt rva(boot32_idt_desc)(%ebp)
886886
#endif
887-
ret
887+
RET
888888
SYM_FUNC_END(startup32_load_idt)
889889

890890
/*
@@ -954,7 +954,7 @@ SYM_FUNC_START(startup32_check_sev_cbit)
954954
popl %ebx
955955
popl %eax
956956
#endif
957-
ret
957+
RET
958958
SYM_FUNC_END(startup32_check_sev_cbit)
959959

960960
/*

arch/x86/boot/compressed/mem_encrypt.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ SYM_FUNC_START(get_sev_encryption_bit)
5858

5959
#endif /* CONFIG_AMD_MEM_ENCRYPT */
6060

61-
ret
61+
RET
6262
SYM_FUNC_END(get_sev_encryption_bit)
6363

6464
/**
@@ -92,7 +92,7 @@ SYM_CODE_START_LOCAL(sev_es_req_cpuid)
9292
/* All good - return success */
9393
xorl %eax, %eax
9494
1:
95-
ret
95+
RET
9696
2:
9797
movl $-1, %eax
9898
jmp 1b
@@ -221,7 +221,7 @@ SYM_FUNC_START(set_sev_encryption_mask)
221221
#endif
222222

223223
xor %rax, %rax
224-
ret
224+
RET
225225
SYM_FUNC_END(set_sev_encryption_mask)
226226

227227
.data

arch/x86/crypto/aegis128-aesni-asm.S

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ SYM_FUNC_START_LOCAL(__load_partial)
122122
pxor T0, MSG
123123

124124
.Lld_partial_8:
125-
ret
125+
RET
126126
SYM_FUNC_END(__load_partial)
127127

128128
/*
@@ -180,7 +180,7 @@ SYM_FUNC_START_LOCAL(__store_partial)
180180
mov %r10b, (%r9)
181181

182182
.Lst_partial_1:
183-
ret
183+
RET
184184
SYM_FUNC_END(__store_partial)
185185

186186
/*
@@ -225,7 +225,7 @@ SYM_FUNC_START(crypto_aegis128_aesni_init)
225225
movdqu STATE4, 0x40(STATEP)
226226

227227
FRAME_END
228-
ret
228+
RET
229229
SYM_FUNC_END(crypto_aegis128_aesni_init)
230230

231231
/*
@@ -337,7 +337,7 @@ SYM_FUNC_START(crypto_aegis128_aesni_ad)
337337
movdqu STATE3, 0x30(STATEP)
338338
movdqu STATE4, 0x40(STATEP)
339339
FRAME_END
340-
ret
340+
RET
341341

342342
.Lad_out_1:
343343
movdqu STATE4, 0x00(STATEP)
@@ -346,7 +346,7 @@ SYM_FUNC_START(crypto_aegis128_aesni_ad)
346346
movdqu STATE2, 0x30(STATEP)
347347
movdqu STATE3, 0x40(STATEP)
348348
FRAME_END
349-
ret
349+
RET
350350

351351
.Lad_out_2:
352352
movdqu STATE3, 0x00(STATEP)
@@ -355,7 +355,7 @@ SYM_FUNC_START(crypto_aegis128_aesni_ad)
355355
movdqu STATE1, 0x30(STATEP)
356356
movdqu STATE2, 0x40(STATEP)
357357
FRAME_END
358-
ret
358+
RET
359359

360360
.Lad_out_3:
361361
movdqu STATE2, 0x00(STATEP)
@@ -364,7 +364,7 @@ SYM_FUNC_START(crypto_aegis128_aesni_ad)
364364
movdqu STATE0, 0x30(STATEP)
365365
movdqu STATE1, 0x40(STATEP)
366366
FRAME_END
367-
ret
367+
RET
368368

369369
.Lad_out_4:
370370
movdqu STATE1, 0x00(STATEP)
@@ -373,11 +373,11 @@ SYM_FUNC_START(crypto_aegis128_aesni_ad)
373373
movdqu STATE4, 0x30(STATEP)
374374
movdqu STATE0, 0x40(STATEP)
375375
FRAME_END
376-
ret
376+
RET
377377

378378
.Lad_out:
379379
FRAME_END
380-
ret
380+
RET
381381
SYM_FUNC_END(crypto_aegis128_aesni_ad)
382382

383383
.macro encrypt_block a s0 s1 s2 s3 s4 i
@@ -452,7 +452,7 @@ SYM_FUNC_START(crypto_aegis128_aesni_enc)
452452
movdqu STATE2, 0x30(STATEP)
453453
movdqu STATE3, 0x40(STATEP)
454454
FRAME_END
455-
ret
455+
RET
456456

457457
.Lenc_out_1:
458458
movdqu STATE3, 0x00(STATEP)
@@ -461,7 +461,7 @@ SYM_FUNC_START(crypto_aegis128_aesni_enc)
461461
movdqu STATE1, 0x30(STATEP)
462462
movdqu STATE2, 0x40(STATEP)
463463
FRAME_END
464-
ret
464+
RET
465465

466466
.Lenc_out_2:
467467
movdqu STATE2, 0x00(STATEP)
@@ -470,7 +470,7 @@ SYM_FUNC_START(crypto_aegis128_aesni_enc)
470470
movdqu STATE0, 0x30(STATEP)
471471
movdqu STATE1, 0x40(STATEP)
472472
FRAME_END
473-
ret
473+
RET
474474

475475
.Lenc_out_3:
476476
movdqu STATE1, 0x00(STATEP)
@@ -479,7 +479,7 @@ SYM_FUNC_START(crypto_aegis128_aesni_enc)
479479
movdqu STATE4, 0x30(STATEP)
480480
movdqu STATE0, 0x40(STATEP)
481481
FRAME_END
482-
ret
482+
RET
483483

484484
.Lenc_out_4:
485485
movdqu STATE0, 0x00(STATEP)
@@ -488,11 +488,11 @@ SYM_FUNC_START(crypto_aegis128_aesni_enc)
488488
movdqu STATE3, 0x30(STATEP)
489489
movdqu STATE4, 0x40(STATEP)
490490
FRAME_END
491-
ret
491+
RET
492492

493493
.Lenc_out:
494494
FRAME_END
495-
ret
495+
RET
496496
SYM_FUNC_END(crypto_aegis128_aesni_enc)
497497

498498
/*
@@ -532,7 +532,7 @@ SYM_FUNC_START(crypto_aegis128_aesni_enc_tail)
532532
movdqu STATE3, 0x40(STATEP)
533533

534534
FRAME_END
535-
ret
535+
RET
536536
SYM_FUNC_END(crypto_aegis128_aesni_enc_tail)
537537

538538
.macro decrypt_block a s0 s1 s2 s3 s4 i
@@ -606,7 +606,7 @@ SYM_FUNC_START(crypto_aegis128_aesni_dec)
606606
movdqu STATE2, 0x30(STATEP)
607607
movdqu STATE3, 0x40(STATEP)
608608
FRAME_END
609-
ret
609+
RET
610610

611611
.Ldec_out_1:
612612
movdqu STATE3, 0x00(STATEP)
@@ -615,7 +615,7 @@ SYM_FUNC_START(crypto_aegis128_aesni_dec)
615615
movdqu STATE1, 0x30(STATEP)
616616
movdqu STATE2, 0x40(STATEP)
617617
FRAME_END
618-
ret
618+
RET
619619

620620
.Ldec_out_2:
621621
movdqu STATE2, 0x00(STATEP)
@@ -624,7 +624,7 @@ SYM_FUNC_START(crypto_aegis128_aesni_dec)
624624
movdqu STATE0, 0x30(STATEP)
625625
movdqu STATE1, 0x40(STATEP)
626626
FRAME_END
627-
ret
627+
RET
628628

629629
.Ldec_out_3:
630630
movdqu STATE1, 0x00(STATEP)
@@ -633,7 +633,7 @@ SYM_FUNC_START(crypto_aegis128_aesni_dec)
633633
movdqu STATE4, 0x30(STATEP)
634634
movdqu STATE0, 0x40(STATEP)
635635
FRAME_END
636-
ret
636+
RET
637637

638638
.Ldec_out_4:
639639
movdqu STATE0, 0x00(STATEP)
@@ -642,11 +642,11 @@ SYM_FUNC_START(crypto_aegis128_aesni_dec)
642642
movdqu STATE3, 0x30(STATEP)
643643
movdqu STATE4, 0x40(STATEP)
644644
FRAME_END
645-
ret
645+
RET
646646

647647
.Ldec_out:
648648
FRAME_END
649-
ret
649+
RET
650650
SYM_FUNC_END(crypto_aegis128_aesni_dec)
651651

652652
/*
@@ -696,7 +696,7 @@ SYM_FUNC_START(crypto_aegis128_aesni_dec_tail)
696696
movdqu STATE3, 0x40(STATEP)
697697

698698
FRAME_END
699-
ret
699+
RET
700700
SYM_FUNC_END(crypto_aegis128_aesni_dec_tail)
701701

702702
/*
@@ -743,5 +743,5 @@ SYM_FUNC_START(crypto_aegis128_aesni_final)
743743
movdqu MSG, (%rsi)
744744

745745
FRAME_END
746-
ret
746+
RET
747747
SYM_FUNC_END(crypto_aegis128_aesni_final)

arch/x86/crypto/aes_ctrby8_avx-x86_64.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ ddq_add_8:
525525
/* return updated IV */
526526
vpshufb xbyteswap, xcounter, xcounter
527527
vmovdqu xcounter, (p_iv)
528-
ret
528+
RET
529529
.endm
530530

531531
/*

0 commit comments

Comments
 (0)