Skip to content

Commit de8ac81

Browse files
committed
Merge tag 'x86_core_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull core x86 updates from Borislav Petkov: - Remove all the code around GS switching on 32-bit now that it is not needed anymore - Other misc improvements * tag 'x86_core_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: bug: Use normal relative pointers in 'struct bug_entry' x86/nmi: Make register_nmi_handler() more robust x86/asm: Merge load_gs_index() x86/32: Remove lazy GS macros ELF: Remove elf_core_copy_kernel_regs() x86/32: Simplify ELF_CORE_COPY_REGS
2 parents a13dc4d + 69505e3 commit de8ac81

File tree

23 files changed

+61
-88
lines changed

23 files changed

+61
-88
lines changed

arch/arm64/include/asm/asm-bug.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
14472: .string file; \
1515
.popsection; \
1616
\
17-
.long 14472b - 14470b; \
17+
.long 14472b - .; \
1818
.short line;
1919
#else
2020
#define _BUGVERBOSE_LOCATION(file, line)
@@ -25,7 +25,7 @@
2525
#define __BUG_ENTRY(flags) \
2626
.pushsection __bug_table,"aw"; \
2727
.align 2; \
28-
14470: .long 14471f - 14470b; \
28+
14470: .long 14471f - .; \
2929
_BUGVERBOSE_LOCATION(__FILE__, __LINE__) \
3030
.short flags; \
3131
.popsection; \

arch/powerpc/include/asm/bug.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
#ifdef CONFIG_DEBUG_BUGVERBOSE
1414
.macro __EMIT_BUG_ENTRY addr,file,line,flags
1515
.section __bug_table,"aw"
16-
5001: .4byte \addr - 5001b, 5002f - 5001b
16+
5001: .4byte \addr - .
17+
.4byte 5002f - .
1718
.short \line, \flags
1819
.org 5001b+BUG_ENTRY_SIZE
1920
.previous
@@ -24,7 +25,7 @@
2425
#else
2526
.macro __EMIT_BUG_ENTRY addr,file,line,flags
2627
.section __bug_table,"aw"
27-
5001: .4byte \addr - 5001b
28+
5001: .4byte \addr - .
2829
.short \flags
2930
.org 5001b+BUG_ENTRY_SIZE
3031
.previous
@@ -49,15 +50,16 @@
4950
#ifdef CONFIG_DEBUG_BUGVERBOSE
5051
#define _EMIT_BUG_ENTRY \
5152
".section __bug_table,\"aw\"\n" \
52-
"2:\t.4byte 1b - 2b, %0 - 2b\n" \
53-
"\t.short %1, %2\n" \
53+
"2: .4byte 1b - .\n" \
54+
" .4byte %0 - .\n" \
55+
" .short %1, %2\n" \
5456
".org 2b+%3\n" \
5557
".previous\n"
5658
#else
5759
#define _EMIT_BUG_ENTRY \
5860
".section __bug_table,\"aw\"\n" \
59-
"2:\t.4byte 1b - 2b\n" \
60-
"\t.short %2\n" \
61+
"2: .4byte 1b - .\n" \
62+
" .short %2\n" \
6163
".org 2b+%3\n" \
6264
".previous\n"
6365
#endif

arch/powerpc/kernel/fadump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ u32 *__init fadump_regs_to_elf_notes(u32 *buf, struct pt_regs *regs)
752752
* FIXME: How do i get PID? Do I really need it?
753753
* prstatus.pr_pid = ????
754754
*/
755-
elf_core_copy_kernel_regs(&prstatus.pr_reg, regs);
755+
elf_core_copy_regs(&prstatus.pr_reg, regs);
756756
buf = append_elf_note(buf, CRASH_CORE_NOTE_NAME, NT_PRSTATUS,
757757
&prstatus, sizeof(prstatus));
758758
return buf;

arch/powerpc/platforms/powernv/opal-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static void __init fill_prstatus(struct elf_prstatus *prstatus, int pir,
112112
struct pt_regs *regs)
113113
{
114114
memset(prstatus, 0, sizeof(struct elf_prstatus));
115-
elf_core_copy_kernel_regs(&(prstatus->pr_reg), regs);
115+
elf_core_copy_regs(&(prstatus->pr_reg), regs);
116116

117117
/*
118118
* Overload PID with PIR value.

arch/riscv/include/asm/bug.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
typedef u32 bug_insn_t;
3131

3232
#ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
33-
#define __BUG_ENTRY_ADDR RISCV_INT " 1b - 2b"
34-
#define __BUG_ENTRY_FILE RISCV_INT " %0 - 2b"
33+
#define __BUG_ENTRY_ADDR RISCV_INT " 1b - ."
34+
#define __BUG_ENTRY_FILE RISCV_INT " %0 - ."
3535
#else
3636
#define __BUG_ENTRY_ADDR RISCV_PTR " 1b"
3737
#define __BUG_ENTRY_FILE RISCV_PTR " %0"

arch/s390/include/asm/bug.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"1: .asciz \""__FILE__"\"\n" \
1616
".previous\n" \
1717
".section __bug_table,\"awM\",@progbits,%2\n" \
18-
"2: .long 0b-2b,1b-2b\n" \
18+
"2: .long 0b-.\n" \
19+
" .long 1b-.\n" \
1920
" .short %0,%1\n" \
2021
" .org 2b+%2\n" \
2122
".previous\n" \
@@ -30,7 +31,7 @@
3031
asm_inline volatile( \
3132
"0: mc 0,0\n" \
3233
".section __bug_table,\"awM\",@progbits,%1\n" \
33-
"1: .long 0b-1b\n" \
34+
"1: .long 0b-.\n" \
3435
" .short %0\n" \
3536
" .org 1b+%1\n" \
3637
".previous\n" \

arch/x86/include/asm/bug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#ifdef CONFIG_X86_32
1919
# define __BUG_REL(val) ".long " __stringify(val)
2020
#else
21-
# define __BUG_REL(val) ".long " __stringify(val) " - 2b"
21+
# define __BUG_REL(val) ".long " __stringify(val) " - ."
2222
#endif
2323

2424
#ifdef CONFIG_DEBUG_BUGVERBOSE

arch/x86/include/asm/elf.h

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ extern unsigned int vdso32_enabled;
116116
* now struct_user_regs, they are different)
117117
*/
118118

119-
#define ELF_CORE_COPY_REGS_COMMON(pr_reg, regs) \
119+
#define ELF_CORE_COPY_REGS(pr_reg, regs) \
120120
do { \
121121
pr_reg[0] = regs->bx; \
122122
pr_reg[1] = regs->cx; \
@@ -128,6 +128,7 @@ do { \
128128
pr_reg[7] = regs->ds; \
129129
pr_reg[8] = regs->es; \
130130
pr_reg[9] = regs->fs; \
131+
savesegment(gs, pr_reg[10]); \
131132
pr_reg[11] = regs->orig_ax; \
132133
pr_reg[12] = regs->ip; \
133134
pr_reg[13] = regs->cs; \
@@ -136,18 +137,6 @@ do { \
136137
pr_reg[16] = regs->ss; \
137138
} while (0);
138139

139-
#define ELF_CORE_COPY_REGS(pr_reg, regs) \
140-
do { \
141-
ELF_CORE_COPY_REGS_COMMON(pr_reg, regs);\
142-
pr_reg[10] = get_user_gs(regs); \
143-
} while (0);
144-
145-
#define ELF_CORE_COPY_KERNEL_REGS(pr_reg, regs) \
146-
do { \
147-
ELF_CORE_COPY_REGS_COMMON(pr_reg, regs);\
148-
savesegment(gs, pr_reg[10]); \
149-
} while (0);
150-
151140
#define ELF_PLATFORM (utsname()->machine)
152141
#define set_personality_64bit() do { } while (0)
153142

arch/x86/include/asm/mmu_context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ do { \
141141
#ifdef CONFIG_X86_32
142142
#define deactivate_mm(tsk, mm) \
143143
do { \
144-
lazy_load_gs(0); \
144+
loadsegment(gs, 0); \
145145
} while (0)
146146
#else
147147
#define deactivate_mm(tsk, mm) \

arch/x86/include/asm/nmi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ struct nmiaction {
4747
#define register_nmi_handler(t, fn, fg, n, init...) \
4848
({ \
4949
static struct nmiaction init fn##_na = { \
50+
.list = LIST_HEAD_INIT(fn##_na.list), \
5051
.handler = (fn), \
5152
.name = (n), \
5253
.flags = (fg), \

0 commit comments

Comments
 (0)