Skip to content

Commit 93e04d4

Browse files
committed
Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 PTI fixes from Ingo Molnar: "Two fixes: a relatively simple objtool fix that makes Clang built kernels work with ORC debug info, plus an alternatives macro fix" * 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/alternatives: Fixup alternative_call_2 objtool: Add Clang support
2 parents b5dbc28 + bd62710 commit 93e04d4

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

arch/x86/include/asm/alternative.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,11 @@ static inline int alternatives_text_reserved(void *start, void *end)
218218
*/
219219
#define alternative_call_2(oldfunc, newfunc1, feature1, newfunc2, feature2, \
220220
output, input...) \
221-
{ \
222221
asm volatile (ALTERNATIVE_2("call %P[old]", "call %P[new1]", feature1,\
223222
"call %P[new2]", feature2) \
224223
: output, ASM_CALL_CONSTRAINT \
225224
: [old] "i" (oldfunc), [new1] "i" (newfunc1), \
226-
[new2] "i" (newfunc2), ## input); \
227-
}
225+
[new2] "i" (newfunc2), ## input)
228226

229227
/*
230228
* use this macro(s) if you need more than one output parameter

tools/objtool/check.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,17 @@ static int update_insn_state(struct instruction *insn, struct insn_state *state)
13861386
state->vals[op->dest.reg].offset = -state->stack_size;
13871387
}
13881388

1389+
else if (op->src.reg == CFI_BP && op->dest.reg == CFI_SP &&
1390+
cfa->base == CFI_BP) {
1391+
1392+
/*
1393+
* mov %rbp, %rsp
1394+
*
1395+
* Restore the original stack pointer (Clang).
1396+
*/
1397+
state->stack_size = -state->regs[CFI_BP].offset;
1398+
}
1399+
13891400
else if (op->dest.reg == cfa->base) {
13901401

13911402
/* mov %reg, %rsp */

0 commit comments

Comments
 (0)