projects/linux·commit 94a85511

Merge tag 'x86_core_for_v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

94a85511 · Linus Torvalds <[email protected]> · 2022-12-14 15:03:00 -08:00

Pull x86 core updates from Borislav Petkov:

 - Add the call depth tracking mitigation for Retbleed which has been
   long in the making. It is a lighterweight software-only fix for
   Skylake-based cores where enabling IBRS is a big hammer and causes a
   significant performance impact.

   What it basically does is, it aligns all kernel functions to 16 bytes
   boundary and adds a 16-byte padding before the function, objtool
   collects all functions' locations and when the mitigation gets
   applied, it patches a call accounting thunk which is used to track
   the call depth of the stack at any time.

   When that call depth reaches a magical, microarchitecture-specific
   value for the Return Stack Buffer, the code stuffs that RSB and
   avoids its underflow which could otherwise lead to the Intel variant
   of Retbleed.

   This software-only solution brings a lot of the lost performance
   back, as benchmarks suggest:

       https://lore.kernel.org/all/[email protected]/

   That page above also contains a lot more detailed explanation of the
   whole mechanism

 - Implement a new control flow integrity scheme called FineIBT which is
   based on the software kCFI implementation and uses hardware IBT
   support where present to annotate and track indirect branches using a
   hash to validate them

 - Other misc fixes and cleanups

* tag 'x86_core_for_v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (80 commits)
  x86/paravirt: Use common macro for creating simple asm paravirt functions
  x86/paravirt: Remove clobber bitmask from .parainstructions
  x86/debug: Include percpu.h in debugreg.h to get DECLARE_PER_CPU() et al
  x86/cpufeatures: Move X86_FEATURE_CALL_DEPTH from bit 18 to bit 19 of word 11, to leave space for WIP X86_FEATURE_SGX_EDECCSSA bit
  x86/Kconfig: Enable kernel IBT by default
  x86,pm: Force out-of-line memcpy()
  objtool: Fix weak hole vs prefix symbol
  objtool: Optimize elf_dirty_reloc_sym()
  x86/cfi: Add boot time hash randomization
  x86/cfi: Boot time selection of CFI scheme
  x86/ibt: Implement FineIBT
  objtool: Add --cfi to generate the .cfi_sites section
  x86: Add prefix symbols for function padding
  objtool: Add option to generate prefix symbols
  objtool: Avoid O(bloody terrible) behaviour -- an ode to libelf
  objtool: Slice up elf_create_section_symbol()
  kallsyms: Revert "Take callthunks into account"
  x86: Unconfuse CONFIG_ and X86_FEATURE_ namespaces
  x86/retpoline: Fix crash printing warning
  x86/paravirt: Fix a !PARAVIRT build warning
  ...
Commit
94a855111ed9106971ca2617c5d075269e6aefde
Parents
93761c93 · f1a033cc

Merge commit. Changes below are compared with the first parent: 93761c93.

Changes

103 files changed · +2705 −593

FileStatusAddDelContent
Makefilemodified+2−2View file
arch/Kconfigmodified+24−0View file
arch/ia64/Kconfigmodified+1−0View file
arch/ia64/Makefilemodified+1−1View file
arch/um/kernel/um_arch.cmodified+5−0View file
arch/x86/Kconfigmodified+74−1View file
arch/x86/Makefilemodified+6−0View file
arch/x86/boot/compressed/head_64.Smodified+8−0View file
arch/x86/crypto/camellia-aesni-avx-asm_64.Smodified+0−2View file
arch/x86/crypto/camellia-aesni-avx2-asm_64.Smodified+0−4View file
arch/x86/crypto/cast5-avx-x86_64-asm_64.Smodified+0−2View file
arch/x86/crypto/crct10dif-pcl-asm_64.Smodified+0−1View file
arch/x86/crypto/poly1305-x86_64-cryptogams.plmodified+0−1View file
arch/x86/crypto/serpent-avx-x86_64-asm_64.Smodified+0−2View file
arch/x86/crypto/serpent-avx2-asm_64.Smodified+0−2View file
arch/x86/crypto/sha1_ni_asm.Smodified+0−1View file
arch/x86/crypto/sha256-avx-asm.Smodified+0−1View file
arch/x86/crypto/sha256-avx2-asm.Smodified+0−1View file
arch/x86/crypto/sha256-ssse3-asm.Smodified+0−1View file
arch/x86/crypto/sha256_ni_asm.Smodified+0−1View file
arch/x86/crypto/sm3-avx-asm_64.Smodified+0−1View file
arch/x86/crypto/sm4-aesni-avx-asm_64.Smodified+0−7View file
arch/x86/crypto/sm4-aesni-avx2-asm_64.Smodified+0−6View file
arch/x86/crypto/twofish-avx-x86_64-asm_64.Smodified+0−2View file
arch/x86/entry/entry_32.Smodified+2−2View file
arch/x86/entry/entry_64.Smodified+28−22View file
arch/x86/entry/entry_64_compat.Smodified+3−4View file
arch/x86/entry/thunk_64.Smodified+2−2View file
arch/x86/entry/vdso/Makefilemodified+8−6View file
arch/x86/include/asm/alternative.hmodified+65−3View file
arch/x86/include/asm/cpufeatures.hmodified+1−2View file
arch/x86/include/asm/current.hmodified+29−3View file
arch/x86/include/asm/debugreg.hmodified+1−1View file
arch/x86/include/asm/disabled-features.hmodified+8−1View file
arch/x86/include/asm/hardirq.hmodified+2−1View file
arch/x86/include/asm/irq_stack.hmodified+6−6View file
arch/x86/include/asm/linkage.hmodified+55−8View file
arch/x86/include/asm/nospec-branch.hmodified+170−6View file
arch/x86/include/asm/paravirt.hmodified+15−2View file
arch/x86/include/asm/paravirt_types.hmodified+19−15View file
arch/x86/include/asm/preempt.hmodified+14−13View file
arch/x86/include/asm/processor.hmodified+2−9View file
arch/x86/include/asm/qspinlock_paravirt.hmodified+20−27View file
arch/x86/include/asm/smp.hmodified+5−7View file
arch/x86/include/asm/text-patching.hmodified+1−0View file
arch/x86/kernel/Makefilemodified+2−0View file
arch/x86/kernel/alternative.cmodified+495−34View file
arch/x86/kernel/asm-offsets.cmodified+5−0View file
arch/x86/kernel/asm-offsets_64.cmodified+1−1View file
arch/x86/kernel/callthunks.cadded+388−0View file
arch/x86/kernel/cpu/Makefilemodified+0−3View file
arch/x86/kernel/cpu/bugs.cmodified+32−2View file
arch/x86/kernel/cpu/common.cmodified+44−53View file
arch/x86/kernel/dumpstack_32.cmodified+2−2View file
arch/x86/kernel/dumpstack_64.cmodified+1−1View file
arch/x86/kernel/ftrace.cmodified+13−7View file
arch/x86/kernel/ftrace_64.Smodified+34−3View file
arch/x86/kernel/head_64.Smodified+1−0View file
arch/x86/kernel/irq_32.cmodified+5−8View file
arch/x86/kernel/irq_64.cmodified+3−3View file
arch/x86/kernel/kprobes/core.cmodified+0−1View file
arch/x86/kernel/kvm.cmodified+6−12View file
arch/x86/kernel/module.cmodified+42−5View file
arch/x86/kernel/paravirt.cmodified+2−19View file
arch/x86/kernel/process_32.cmodified+3−3View file
arch/x86/kernel/process_64.cmodified+3−3View file
arch/x86/kernel/relocate_kernel_64.Smodified+3−2View file
arch/x86/kernel/setup_percpu.cmodified+2−5View file
arch/x86/kernel/smpboot.cmodified+7−3View file
arch/x86/kernel/static_call.cmodified+2−1View file
arch/x86/kernel/traps.cmodified+2−2View file
arch/x86/kernel/unwind_orc.cmodified+20−1View file
arch/x86/kernel/vmlinux.lds.Smodified+23−14View file
arch/x86/kvm/svm/vmenter.Smodified+1−0View file
arch/x86/lib/error-inject.cmodified+1−0View file
arch/x86/lib/putuser.Smodified+49−13View file
arch/x86/lib/retpoline.Smodified+99−8View file
arch/x86/net/bpf_jit_comp.cmodified+34−11View file
arch/x86/power/hibernate.cmodified+1−1View file
arch/x86/xen/enlighten_pv.cmodified+1−1View file
include/asm-generic/vmlinux.lds.hmodified+2−2View file
include/linux/linkage.hmodified+2−2View file
include/linux/static_call.hmodified+2−0View file
kernel/static_call_inline.cmodified+18−5View file
kernel/trace/trace_selftest.cmodified+8−1View file
lib/Kconfig.debugmodified+1−0View file
samples/ftrace/ftrace-direct-modify.cmodified+3−0View file
samples/ftrace/ftrace-direct-multi-modify.cmodified+3−0View file
samples/ftrace/ftrace-direct-multi.cmodified+2−0View file
samples/ftrace/ftrace-direct-too.cmodified+2−0View file
samples/ftrace/ftrace-direct.cmodified+2−0View file
scripts/Makefile.libmodified+3−0View file
tools/include/linux/interval_tree_generic.hadded+187−0View file
tools/objtool/arch/x86/decode.cmodified+24−0View file
tools/objtool/builtin-check.cmodified+8−1View file
tools/objtool/check.cmodified+310−81View file
tools/objtool/elf.cmodified+199−97View file
tools/objtool/include/objtool/arch.hmodified+2−0View file
tools/objtool/include/objtool/builtin.hmodified+3−0View file
tools/objtool/include/objtool/check.hmodified+11−1View file
tools/objtool/include/objtool/elf.hmodified+7−2View file
tools/objtool/include/objtool/objtool.hmodified+1−0View file
tools/objtool/objtool.cmodified+1−0View file

Only the first 600 diff lines are shown. Download the complete patch.

Makefile

View file
diff --git a/Makefile b/Makefile
index 5aa604a..6aa709d 100644
--- a/Makefile
+++ b/Makefile
@@ -1006,8 +1006,8 @@ KBUILD_CFLAGS += $(CC_FLAGS_CFI)
export CC_FLAGS_CFI
endif
-ifdef CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B
-KBUILD_CFLAGS += -falign-functions=64
+ifneq ($(CONFIG_FUNCTION_ALIGNMENT),0)
+KBUILD_CFLAGS += -falign-functions=$(CONFIG_FUNCTION_ALIGNMENT)
endif
# arch Makefile may override CC so keep this after arch Makefile is included

arch/Kconfig

View file
diff --git a/arch/Kconfig b/arch/Kconfig
index 2d0e709..a3c47c2 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -1438,4 +1438,28 @@ source "kernel/gcov/Kconfig"
source "scripts/gcc-plugins/Kconfig"
+config FUNCTION_ALIGNMENT_4B
+ bool
+
+config FUNCTION_ALIGNMENT_8B
+ bool
+
+config FUNCTION_ALIGNMENT_16B
+ bool
+
+config FUNCTION_ALIGNMENT_32B
+ bool
+
+config FUNCTION_ALIGNMENT_64B
+ bool
+
+config FUNCTION_ALIGNMENT
+ int
+ default 64 if FUNCTION_ALIGNMENT_64B
+ default 32 if FUNCTION_ALIGNMENT_32B
+ default 16 if FUNCTION_ALIGNMENT_16B
+ default 8 if FUNCTION_ALIGNMENT_8B
+ default 4 if FUNCTION_ALIGNMENT_4B
+ default 0
+
endmenu

arch/ia64/Kconfig

View file
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index c6e06cd..d7e4a24 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -63,6 +63,7 @@ config IA64
select NUMA if !FLATMEM
select PCI_MSI_ARCH_FALLBACKS if PCI_MSI
select ZONE_DMA32
+ select FUNCTION_ALIGNMENT_32B
default y
help
The Itanium Processor Family is Intel's 64-bit successor to

arch/ia64/Makefile

View file
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile
index 56c4bb2..d553ab7 100644
--- a/arch/ia64/Makefile
+++ b/arch/ia64/Makefile
@@ -23,7 +23,7 @@ KBUILD_AFLAGS_KERNEL := -mconstant-gp
EXTRA :=
cflags-y := -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \
- -falign-functions=32 -frename-registers -fno-optimize-sibling-calls
+ -frename-registers -fno-optimize-sibling-calls
KBUILD_CFLAGS_KERNEL := -mconstant-gp
GAS_STATUS = $(shell $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)")

arch/um/kernel/um_arch.c

View file
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 8adf8e8..786b44d 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -444,6 +444,11 @@ void apply_returns(s32 *start, s32 *end)
{
}
+void apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
+ s32 *start_cfi, s32 *end_cfi)
+{
+}
+
void apply_alternatives(struct alt_instr *start, struct alt_instr *end)
{
}

arch/x86/Kconfig

View file
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 9f8c03b..61b4c7b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -292,6 +292,8 @@ config X86
select X86_FEATURE_NAMES if PROC_FS
select PROC_PID_ARCH_STATUS if PROC_FS
select HAVE_ARCH_NODE_DEV_GROUP if X86_SGX
+ select FUNCTION_ALIGNMENT_16B if X86_64 || X86_ALIGNMENT_16
+ select FUNCTION_ALIGNMENT_4B
imply IMA_SECURE_AND_OR_TRUSTED_BOOT if EFI
select HAVE_DYNAMIC_FTRACE_NO_PATCHABLE
@@ -1855,7 +1857,7 @@ config CC_HAS_IBT
config X86_KERNEL_IBT
prompt "Indirect Branch Tracking"
- bool
+ def_bool y
depends on X86_64 && CC_HAS_IBT && HAVE_OBJTOOL
# https://github.com/llvm/llvm-project/commit/9d7001eba9c4cb311e03cd8cdc231f9e579f2d0f
depends on !LD_IS_LLD || LLD_VERSION >= 140000
@@ -2492,6 +2494,46 @@ config CC_HAS_SLS
config CC_HAS_RETURN_THUNK
def_bool $(cc-option,-mfunction-return=thunk-extern)
+config CC_HAS_ENTRY_PADDING
+ def_bool $(cc-option,-fpatchable-function-entry=16,16)
+
+config FUNCTION_PADDING_CFI
+ int
+ default 59 if FUNCTION_ALIGNMENT_64B
+ default 27 if FUNCTION_ALIGNMENT_32B
+ default 11 if FUNCTION_ALIGNMENT_16B
+ default 3 if FUNCTION_ALIGNMENT_8B
+ default 0
+
+# Basically: FUNCTION_ALIGNMENT - 5*CFI_CLANG
+# except Kconfig can't do arithmetic :/
+config FUNCTION_PADDING_BYTES
+ int
+ default FUNCTION_PADDING_CFI if CFI_CLANG
+ default FUNCTION_ALIGNMENT
+
+config CALL_PADDING
+ def_bool n
+ depends on CC_HAS_ENTRY_PADDING && OBJTOOL
+ select FUNCTION_ALIGNMENT_16B
+
+config FINEIBT
+ def_bool y
+ depends on X86_KERNEL_IBT && CFI_CLANG && RETPOLINE
+ select CALL_PADDING
+
+config HAVE_CALL_THUNKS
+ def_bool y
+ depends on CC_HAS_ENTRY_PADDING && RETHUNK && OBJTOOL
+
+config CALL_THUNKS
+ def_bool n
+ select CALL_PADDING
+
+config PREFIX_SYMBOLS
+ def_bool y
+ depends on CALL_PADDING && !CFI_CLANG
+
menuconfig SPECULATION_MITIGATIONS
bool "Mitigations for speculative execution vulnerabilities"
default y
@@ -2543,6 +2585,37 @@ config CPU_UNRET_ENTRY
help
Compile the kernel with support for the retbleed=unret mitigation.
+config CALL_DEPTH_TRACKING
+ bool "Mitigate RSB underflow with call depth tracking"
+ depends on CPU_SUP_INTEL && HAVE_CALL_THUNKS
+ select HAVE_DYNAMIC_FTRACE_NO_PATCHABLE
+ select CALL_THUNKS
+ default y
+ help
+ Compile the kernel with call depth tracking to mitigate the Intel
+ SKL Return-Speculation-Buffer (RSB) underflow issue. The
+ mitigation is off by default and needs to be enabled on the
+ kernel command line via the retbleed=stuff option. For
+ non-affected systems the overhead of this option is marginal as
+ the call depth tracking is using run-time generated call thunks
+ in a compiler generated padding area and call patching. This
+ increases text size by ~5%. For non affected systems this space
+ is unused. On affected SKL systems this results in a significant
+ performance gain over the IBRS mitigation.
+
+config CALL_THUNKS_DEBUG
+ bool "Enable call thunks and call depth tracking debugging"
+ depends on CALL_DEPTH_TRACKING
+ select FUNCTION_ALIGNMENT_32B
+ default n
+ help
+ Enable call/ret counters for imbalance detection and build in
+ a noisy dmesg about callthunks generation and call patching for
+ trouble shooting. The debug prints need to be enabled on the
+ kernel command line with 'debug-callthunks'.
+ Only enable this, when you are debugging call thunks as this
+ creates a noticable runtime overhead. If unsure say N.
+
config CPU_IBPB_ENTRY
bool "Enable IBPB on kernel entry"
depends on CPU_SUP_AMD && X86_64

arch/x86/Makefile

View file
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 415a5d1..a3a07df 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -208,6 +208,12 @@ ifdef CONFIG_SLS
KBUILD_CFLAGS += -mharden-sls=all
endif
+ifdef CONFIG_CALL_PADDING
+PADDING_CFLAGS := -fpatchable-function-entry=$(CONFIG_FUNCTION_PADDING_BYTES),$(CONFIG_FUNCTION_PADDING_BYTES)
+KBUILD_CFLAGS += $(PADDING_CFLAGS)
+export PADDING_CFLAGS
+endif
+
KBUILD_LDFLAGS += -m elf_$(UTS_MACHINE)
ifdef CONFIG_LTO_CLANG

arch/x86/boot/compressed/head_64.S

View file
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index d4c4281..a757129 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -38,6 +38,14 @@
#include "pgtable.h"
/*
+ * Fix alignment at 16 bytes. Following CONFIG_FUNCTION_ALIGNMENT will result
+ * in assembly errors due to trying to move .org backward due to the excessive
+ * alignment.
+ */
+#undef __ALIGN
+#define __ALIGN .balign 16, 0x90
+
+/*
* Locally defined symbols should be marked hidden:
*/
.hidden _bss

arch/x86/crypto/camellia-aesni-avx-asm_64.S

View file
diff --git a/arch/x86/crypto/camellia-aesni-avx-asm_64.S b/arch/x86/crypto/camellia-aesni-avx-asm_64.S
index 2e1658d..4a30618 100644
--- a/arch/x86/crypto/camellia-aesni-avx-asm_64.S
+++ b/arch/x86/crypto/camellia-aesni-avx-asm_64.S
@@ -712,7 +712,6 @@ SYM_FUNC_END(roundsm16_x4_x5_x6_x7_x0_x1_x2_x3_y4_y5_y6_y7_y0_y1_y2_y3_ab)
.text
-.align 8
SYM_FUNC_START_LOCAL(__camellia_enc_blk16)
/* input:
* %rdi: ctx, CTX
@@ -799,7 +798,6 @@ SYM_FUNC_START_LOCAL(__camellia_enc_blk16)
jmp .Lenc_done;
SYM_FUNC_END(__camellia_enc_blk16)
-.align 8
SYM_FUNC_START_LOCAL(__camellia_dec_blk16)
/* input:
* %rdi: ctx, CTX

arch/x86/crypto/camellia-aesni-avx2-asm_64.S

View file
diff --git a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
index 0e4e9ab..deaf62a 100644
--- a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
+++ b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
@@ -221,7 +221,6 @@
* Size optimization... with inlined roundsm32 binary would be over 5 times
* larger and would only marginally faster.
*/
-.align 8
SYM_FUNC_START_LOCAL(roundsm32_x0_x1_x2_x3_x4_x5_x6_x7_y0_y1_y2_y3_y4_y5_y6_y7_cd)
roundsm32(%ymm0, %ymm1, %ymm2, %ymm3, %ymm4, %ymm5, %ymm6, %ymm7,
%ymm8, %ymm9, %ymm10, %ymm11, %ymm12, %ymm13, %ymm14, %ymm15,
@@ -229,7 +228,6 @@ SYM_FUNC_START_LOCAL(roundsm32_x0_x1_x2_x3_x4_x5_x6_x7_y0_y1_y2_y3_y4_y5_y6_y7_c
RET;
SYM_FUNC_END(roundsm32_x0_x1_x2_x3_x4_x5_x6_x7_y0_y1_y2_y3_y4_y5_y6_y7_cd)
-.align 8
SYM_FUNC_START_LOCAL(roundsm32_x4_x5_x6_x7_x0_x1_x2_x3_y4_y5_y6_y7_y0_y1_y2_y3_ab)
roundsm32(%ymm4, %ymm5, %ymm6, %ymm7, %ymm0, %ymm1, %ymm2, %ymm3,
%ymm12, %ymm13, %ymm14, %ymm15, %ymm8, %ymm9, %ymm10, %ymm11,
@@ -748,7 +746,6 @@ SYM_FUNC_END(roundsm32_x4_x5_x6_x7_x0_x1_x2_x3_y4_y5_y6_y7_y0_y1_y2_y3_ab)
.text
-.align 8
SYM_FUNC_START_LOCAL(__camellia_enc_blk32)
/* input:
* %rdi: ctx, CTX
@@ -835,7 +832,6 @@ SYM_FUNC_START_LOCAL(__camellia_enc_blk32)
jmp .Lenc_done;
SYM_FUNC_END(__camellia_enc_blk32)
-.align 8
SYM_FUNC_START_LOCAL(__camellia_dec_blk32)
/* input:
* %rdi: ctx, CTX

arch/x86/crypto/cast5-avx-x86_64-asm_64.S

View file
diff --git a/arch/x86/crypto/cast5-avx-x86_64-asm_64.S b/arch/x86/crypto/cast5-avx-x86_64-asm_64.S
index b258af4..0326a01 100644
--- a/arch/x86/crypto/cast5-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/cast5-avx-x86_64-asm_64.S
@@ -208,7 +208,6 @@
.text
-.align 16
SYM_FUNC_START_LOCAL(__cast5_enc_blk16)
/* input:
* %rdi: ctx
@@ -282,7 +281,6 @@ SYM_FUNC_START_LOCAL(__cast5_enc_blk16)
RET;
SYM_FUNC_END(__cast5_enc_blk16)
-.align 16
SYM_FUNC_START_LOCAL(__cast5_dec_blk16)
/* input:
* %rdi: ctx

arch/x86/crypto/crct10dif-pcl-asm_64.S

View file
diff --git a/arch/x86/crypto/crct10dif-pcl-asm_64.S b/arch/x86/crypto/crct10dif-pcl-asm_64.S
index 721474a..5286db5 100644
--- a/arch/x86/crypto/crct10dif-pcl-asm_64.S
+++ b/arch/x86/crypto/crct10dif-pcl-asm_64.S
@@ -94,7 +94,6 @@
#
# Assumes len >= 16.
#
-.align 16
SYM_FUNC_START(crc_t10dif_pcl)
movdqa .Lbswap_mask(%rip), BSWAP_MASK

arch/x86/crypto/poly1305-x86_64-cryptogams.pl

View file
diff --git a/arch/x86/crypto/poly1305-x86_64-cryptogams.pl b/arch/x86/crypto/poly1305-x86_64-cryptogams.pl
index 2077ce7..b9abcd7 100644
--- a/arch/x86/crypto/poly1305-x86_64-cryptogams.pl
+++ b/arch/x86/crypto/poly1305-x86_64-cryptogams.pl
@@ -108,7 +108,6 @@ if (!$kernel) {
sub declare_function() {
my ($name, $align, $nargs) = @_;
if($kernel) {
- $code .= ".align $align\n";
$code .= "SYM_FUNC_START($name)\n";
$code .= ".L$name:\n";
} else {

arch/x86/crypto/serpent-avx-x86_64-asm_64.S

View file
diff --git a/arch/x86/crypto/serpent-avx-x86_64-asm_64.S b/arch/x86/crypto/serpent-avx-x86_64-asm_64.S
index 82f2313..97e2836 100644
--- a/arch/x86/crypto/serpent-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/serpent-avx-x86_64-asm_64.S
@@ -550,7 +550,6 @@
#define write_blocks(x0, x1, x2, x3, t0, t1, t2) \
transpose_4x4(x0, x1, x2, x3, t0, t1, t2)
-.align 8
SYM_FUNC_START_LOCAL(__serpent_enc_blk8_avx)
/* input:
* %rdi: ctx, CTX
@@ -604,7 +603,6 @@ SYM_FUNC_START_LOCAL(__serpent_enc_blk8_avx)
RET;
SYM_FUNC_END(__serpent_enc_blk8_avx)
-.align 8
SYM_FUNC_START_LOCAL(__serpent_dec_blk8_avx)
/* input:
* %rdi: ctx, CTX

arch/x86/crypto/serpent-avx2-asm_64.S

View file
diff --git a/arch/x86/crypto/serpent-avx2-asm_64.S b/arch/x86/crypto/serpent-avx2-asm_64.S
index 8ea34c9..6d60c50 100644
--- a/arch/x86/crypto/serpent-avx2-asm_64.S
+++ b/arch/x86/crypto/serpent-avx2-asm_64.S
@@ -550,7 +550,6 @@
#define write_blocks(x0, x1, x2, x3, t0, t1, t2) \
transpose_4x4(x0, x1, x2, x3, t0, t1, t2)
-.align 8
SYM_FUNC_START_LOCAL(__serpent_enc_blk16)
/* input:
* %rdi: ctx, CTX
@@ -604,7 +603,6 @@ SYM_FUNC_START_LOCAL(__serpent_enc_blk16)
RET;
SYM_FUNC_END(__serpent_enc_blk16)
-.align 8
SYM_FUNC_START_LOCAL(__serpent_dec_blk16)
/* input:
* %rdi: ctx, CTX

arch/x86/crypto/sha1_ni_asm.S

View file
diff --git a/arch/x86/crypto/sha1_ni_asm.S b/arch/x86/crypto/sha1_ni_asm.S
index 3cae5a1..cade913 100644
--- a/arch/x86/crypto/sha1_ni_asm.S
+++ b/arch/x86/crypto/sha1_ni_asm.S
@@ -93,7 +93,6 @@
* numBlocks: Number of blocks to process
*/
.text
-.align 32
SYM_TYPED_FUNC_START(sha1_ni_transform)
push %rbp
mov %rsp, %rbp

arch/x86/crypto/sha256-avx-asm.S

View file
diff --git a/arch/x86/crypto/sha256-avx-asm.S b/arch/x86/crypto/sha256-avx-asm.S
index 06ea30c..5555b5d 100644
--- a/arch/x86/crypto/sha256-avx-asm.S
+++ b/arch/x86/crypto/sha256-avx-asm.S
@@ -348,7 +348,6 @@ a = TMP_
########################################################################
.text
SYM_TYPED_FUNC_START(sha256_transform_avx)
-.align 32
pushq %rbx
pushq %r12
pushq %r13

arch/x86/crypto/sha256-avx2-asm.S

View file
diff --git a/arch/x86/crypto/sha256-avx2-asm.S b/arch/x86/crypto/sha256-avx2-asm.S
index 2d2be53..3eada94 100644
--- a/arch/x86/crypto/sha256-avx2-asm.S
+++ b/arch/x86/crypto/sha256-avx2-asm.S
@@ -525,7 +525,6 @@ STACK_SIZE = _CTX + _CTX_SIZE
########################################################################
.text
SYM_TYPED_FUNC_START(sha256_transform_rorx)
-.align 32
pushq %rbx
pushq %r12
pushq %r13

arch/x86/crypto/sha256-ssse3-asm.S

View file
diff --git a/arch/x86/crypto/sha256-ssse3-asm.S b/arch/x86/crypto/sha256-ssse3-asm.S
index 7db2883..959288e 100644
--- a/arch/x86/crypto/sha256-ssse3-asm.S
+++ b/arch/x86/crypto/sha256-ssse3-asm.S
@@ -357,7 +357,6 @@ a = TMP_
########################################################################
.text
SYM_TYPED_FUNC_START(sha256_transform_ssse3)
-.align 32
pushq %rbx
pushq %r12
pushq %r13

arch/x86/crypto/sha256_ni_asm.S

View file
diff --git a/arch/x86/crypto/sha256_ni_asm.S b/arch/x86/crypto/sha256_ni_asm.S
index 47f9393..537b6dc 100644
--- a/arch/x86/crypto/sha256_ni_asm.S
+++ b/arch/x86/crypto/sha256_ni_asm.S
@@ -97,7 +97,6 @@
*/
.text
-.align 32
SYM_TYPED_FUNC_START(sha256_ni_transform)
shl $6, NUM_BLKS /* convert to bytes */

arch/x86/crypto/sm3-avx-asm_64.S

View file
diff --git a/arch/x86/crypto/sm3-avx-asm_64.S b/arch/x86/crypto/sm3-avx-asm_64.S
index 8fc5ac6..503bab4 100644
--- a/arch/x86/crypto/sm3-avx-asm_64.S
+++ b/arch/x86/crypto/sm3-avx-asm_64.S
@@ -328,7 +328,6 @@
* void sm3_transform_avx(struct sm3_state *state,
* const u8 *data, int nblocks);
*/
-.align 16
SYM_TYPED_FUNC_START(sm3_transform_avx)
/* input:
* %rdi: ctx, CTX

arch/x86/crypto/sm4-aesni-avx-asm_64.S

View file
diff --git a/arch/x86/crypto/sm4-aesni-avx-asm_64.S b/arch/x86/crypto/sm4-aesni-avx-asm_64.S
index 22b6560..e2668d2 100644
--- a/arch/x86/crypto/sm4-aesni-avx-asm_64.S
+++ b/arch/x86/crypto/sm4-aesni-avx-asm_64.S
@@ -140,13 +140,11 @@
.text
-.align 16
/*
* void sm4_aesni_avx_crypt4(const u32 *rk, u8 *dst,
* const u8 *src, int nblocks)
*/
-.align 8
SYM_FUNC_START(sm4_aesni_avx_crypt4)
/* input:
* %rdi: round key array, CTX
@@ -250,7 +248,6 @@ SYM_FUNC_START(sm4_aesni_avx_crypt4)
RET;
SYM_FUNC_END(sm4_aesni_avx_crypt4)
-.align 8
SYM_FUNC_START_LOCAL(__sm4_crypt_blk8)
/* input:
* %rdi: round key array, CTX
@@ -364,7 +361,6 @@ SYM_FUNC_END(__sm4_crypt_blk8)
* void sm4_aesni_avx_crypt8(const u32 *rk, u8 *dst,
* const u8 *src, int nblocks)
*/
-.align 8
SYM_FUNC_START(sm4_aesni_avx_crypt8)
/* input:
* %rdi: round key array, CTX
@@ -420,7 +416,6 @@ SYM_FUNC_END(sm4_aesni_avx_crypt8)
* void sm4_aesni_avx_ctr_enc_blk8(const u32 *rk, u8 *dst,
* const u8 *src, u8 *iv)
*/
-.align 8
SYM_TYPED_FUNC_START(sm4_aesni_avx_ctr_enc_blk8)
/* input:
* %rdi: round key array, CTX
@@ -495,7 +490,6 @@ SYM_FUNC_END(sm4_aesni_avx_ctr_enc_blk8)
* void sm4_aesni_avx_cbc_dec_blk8(const u32 *rk, u8 *dst,
* const u8 *src, u8 *iv)
*/
-.align 8
SYM_TYPED_FUNC_START(sm4_aesni_avx_cbc_dec_blk8)
/* input:
* %rdi: round key array, CTX
@@ -545,7 +539,6 @@ SYM_FUNC_END(sm4_aesni_avx_cbc_dec_blk8)
* void sm4_aesni_avx_cfb_dec_blk8(const u32 *rk, u8 *dst,
* const u8 *src, u8 *iv)
*/
-.align 8
SYM_TYPED_FUNC_START(sm4_aesni_avx_cfb_dec_blk8)
/* input:
* %rdi: round key array, CTX

arch/x86/crypto/sm4-aesni-avx2-asm_64.S

View file
diff --git a/arch/x86/crypto/sm4-aesni-avx2-asm_64.S b/arch/x86/crypto/sm4-aesni-avx2-asm_64.S
index 23ee39a..98ede94 100644
--- a/arch/x86/crypto/sm4-aesni-avx2-asm_64.S
+++ b/arch/x86/crypto/sm4-aesni-avx2-asm_64.S
@@ -154,9 +154,6 @@
.long 0xdeadbeef, 0xdeadbeef, 0xdeadbeef
.text
-.align 16
-
-.align 8
SYM_FUNC_START_LOCAL(__sm4_crypt_blk16)
/* input:
* %rdi: round key array, CTX
@@ -282,7 +279,6 @@ SYM_FUNC_END(__sm4_crypt_blk16)
* void sm4_aesni_avx2_ctr_enc_blk16(const u32 *rk, u8 *dst,
* const u8 *src, u8 *iv)
*/
-.align 8
SYM_TYPED_FUNC_START(sm4_aesni_avx2_ctr_enc_blk16)
/* input:
* %rdi: round key array, CTX
@@ -395,7 +391,6 @@ SYM_FUNC_END(sm4_aesni_avx2_ctr_enc_blk16)
* void sm4_aesni_avx2_cbc_dec_blk16(const u32 *rk, u8 *dst,
* const u8 *src, u8 *iv)
*/
-.align 8
SYM_TYPED_FUNC_START(sm4_aesni_avx2_cbc_dec_blk16)
/* input:
* %rdi: round key array, CTX
@@ -449,7 +444,6 @@ SYM_FUNC_END(sm4_aesni_avx2_cbc_dec_blk16)
* void sm4_aesni_avx2_cfb_dec_blk16(const u32 *rk, u8 *dst,
* const u8 *src, u8 *iv)
*/
-.align 8
SYM_TYPED_FUNC_START(sm4_aesni_avx2_cfb_dec_blk16)
/* input:
* %rdi: round key array, CTX

arch/x86/crypto/twofish-avx-x86_64-asm_64.S

View file
diff --git a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
index 31f9b2e..12fde27 100644
--- a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
@@ -228,7 +228,6 @@
vpxor x2, wkey, x2; \
vpxor x3, wkey, x3;
-.align 8
SYM_FUNC_START_LOCAL(__twofish_enc_blk8)
/* input:
* %rdi: ctx, CTX
@@ -270,7 +269,6 @@ SYM_FUNC_START_LOCAL(__twofish_enc_blk8)
RET;
SYM_FUNC_END(__twofish_enc_blk8)
-.align 8
SYM_FUNC_START_LOCAL(__twofish_dec_blk8)
/* input:
* %rdi: ctx, CTX

arch/x86/entry/entry_32.S

View file
diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index e309e71..91397f5 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -1181,7 +1181,7 @@ SYM_CODE_START(asm_exc_nmi)
* is using the thread stack right now, so it's safe for us to use it.
*/
movl %esp, %ebx
- movl PER_CPU_VAR(cpu_current_top_of_stack), %esp
+ movl PER_CPU_VAR(pcpu_hot + X86_top_of_stack), %esp
call exc_nmi
movl %ebx, %esp
@@ -1243,7 +1243,7 @@ SYM_CODE_START(rewind_stack_and_make_dead)
/* Prevent any naive code from trying to unwind to our caller. */
xorl %ebp, %ebp
- movl PER_CPU_VAR(cpu_current_top_of_stack), %esi
+ movl PER_CPU_VAR(pcpu_hot + X86_top_of_stack), %esi
leal -TOP_OF_KERNEL_STACK_PADDING-PTREGS_SIZE(%esi), %esp
call make_task_dead

arch/x86/entry/entry_64.S

View file
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index 9953d96..15739a2 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -92,7 +92,7 @@ SYM_CODE_START(entry_SYSCALL_64)
/* tss.sp2 is scratch space. */
movq %rsp, PER_CPU_VAR(cpu_tss_rw + TSS_sp2)
SWITCH_TO_KERNEL_CR3 scratch_reg=%rsp
- movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp
+ movq PER_CPU_VAR(pcpu_hot + X86_top_of_stack), %rsp
SYM_INNER_LABEL(entry_SYSCALL_64_safe_stack, SYM_L_GLOBAL)
ANNOTATE_NOENDBR
@@ -252,7 +252,7 @@ SYM_FUNC_START(__switch_to_asm)
#ifdef CONFIG_STACKPROTECTOR
movq TASK_stack_canary(%rsi), %rbx
- movq %rbx, PER_CPU_VAR(fixed_percpu_data) + stack_canary_offset

This diff is incomplete. Download the complete patch.

arch/x86/entry/entry_64_compat.S

View file

This diff is incomplete. Download the complete patch.

arch/x86/entry/thunk_64.S

View file

This diff is incomplete. Download the complete patch.

arch/x86/entry/vdso/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/alternative.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/cpufeatures.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/current.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/debugreg.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/disabled-features.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/hardirq.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/irq_stack.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/linkage.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/nospec-branch.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/paravirt.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/paravirt_types.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/preempt.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/processor.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/qspinlock_paravirt.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/smp.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/text-patching.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/alternative.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/asm-offsets.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/asm-offsets_64.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/callthunks.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/cpu/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/cpu/bugs.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/cpu/common.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/dumpstack_32.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/dumpstack_64.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/ftrace.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/ftrace_64.S

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/head_64.S

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/irq_32.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/irq_64.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/kprobes/core.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/kvm.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/module.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/paravirt.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/process_32.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/process_64.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/relocate_kernel_64.S

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/setup_percpu.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/smpboot.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/static_call.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/traps.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/unwind_orc.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/vmlinux.lds.S

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/svm/vmenter.S

View file

This diff is incomplete. Download the complete patch.

arch/x86/lib/error-inject.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/lib/putuser.S

View file

This diff is incomplete. Download the complete patch.

arch/x86/lib/retpoline.S

View file

This diff is incomplete. Download the complete patch.

arch/x86/net/bpf_jit_comp.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/power/hibernate.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/xen/enlighten_pv.c

View file

This diff is incomplete. Download the complete patch.

include/asm-generic/vmlinux.lds.h

View file

This diff is incomplete. Download the complete patch.

include/linux/linkage.h

View file

This diff is incomplete. Download the complete patch.

include/linux/static_call.h

View file

This diff is incomplete. Download the complete patch.

kernel/static_call_inline.c

View file

This diff is incomplete. Download the complete patch.

kernel/trace/trace_selftest.c

View file

This diff is incomplete. Download the complete patch.

lib/Kconfig.debug

View file

This diff is incomplete. Download the complete patch.

samples/ftrace/ftrace-direct-modify.c

View file

This diff is incomplete. Download the complete patch.

samples/ftrace/ftrace-direct-multi-modify.c

View file

This diff is incomplete. Download the complete patch.

samples/ftrace/ftrace-direct-multi.c

View file

This diff is incomplete. Download the complete patch.

samples/ftrace/ftrace-direct-too.c

View file

This diff is incomplete. Download the complete patch.

samples/ftrace/ftrace-direct.c

View file

This diff is incomplete. Download the complete patch.

scripts/Makefile.lib

View file

This diff is incomplete. Download the complete patch.

tools/include/linux/interval_tree_generic.h

View file

This diff is incomplete. Download the complete patch.

tools/objtool/arch/x86/decode.c

View file

This diff is incomplete. Download the complete patch.

tools/objtool/builtin-check.c

View file

This diff is incomplete. Download the complete patch.

tools/objtool/check.c

View file

This diff is incomplete. Download the complete patch.

tools/objtool/elf.c

View file

This diff is incomplete. Download the complete patch.

tools/objtool/include/objtool/arch.h

View file

This diff is incomplete. Download the complete patch.

tools/objtool/include/objtool/builtin.h

View file

This diff is incomplete. Download the complete patch.

tools/objtool/include/objtool/check.h

View file

This diff is incomplete. Download the complete patch.

tools/objtool/include/objtool/elf.h

View file

This diff is incomplete. Download the complete patch.

tools/objtool/include/objtool/objtool.h

View file

This diff is incomplete. Download the complete patch.

tools/objtool/objtool.c

View file

This diff is incomplete. Download the complete patch.