Skip to content

Commit fdf5563

Browse files
committed
Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 cleanups from Ingo Molnar: "This topic tree contains more commits than usual: - most of it are uaccess cleanups/reorganization by Al - there's a bunch of prototype declaration (--Wmissing-prototypes) cleanups - misc other cleanups all around the map" * 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (36 commits) x86/mm/set_memory: Fix -Wmissing-prototypes warnings x86/efi: Add a prototype for efi_arch_mem_reserve() x86/mm: Mark setup_emu2phys_nid() static x86/jump_label: Move 'inline' keyword placement x86/platform/uv: Add a missing prototype for uv_bau_message_interrupt() kill uaccess_try() x86: unsafe_put-style macro for sigmask x86: x32_setup_rt_frame(): consolidate uaccess areas x86: __setup_rt_frame(): consolidate uaccess areas x86: __setup_frame(): consolidate uaccess areas x86: setup_sigcontext(): list user_access_{begin,end}() into callers x86: get rid of put_user_try in __setup_rt_frame() (both 32bit and 64bit) x86: ia32_setup_rt_frame(): consolidate uaccess areas x86: ia32_setup_frame(): consolidate uaccess areas x86: ia32_setup_sigcontext(): lift user_access_{begin,end}() into the callers x86/alternatives: Mark text_poke_loc_init() static x86/cpu: Fix a -Wmissing-prototypes warning for init_ia32_feat_ctl() x86/mm: Drop pud_mknotpresent() x86: Replace setup_irq() by request_irq() x86/configs: Slightly reduce defconfigs ...
2 parents 97cddfc + a215032 commit fdf5563

Some content is hidden

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

43 files changed

+445
-827
lines changed

Documentation/x86/exception-tables.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,12 +340,6 @@ pointer which points to one of:
340340
entry->insn. It is used to distinguish page faults from machine
341341
check.
342342

343-
3) ``int ex_handler_ext(const struct exception_table_entry *fixup)``
344-
This case is used for uaccess_err ... we need to set a flag
345-
in the task structure. Before the handler functions existed this
346-
case was handled by adding a large offset to the fixup to tag
347-
it as special.
348-
349343
More functions can easily be added.
350344

351345
CONFIG_BUILDTIME_TABLE_SORT allows the __ex_table section to be sorted post

arch/x86/configs/i386_defconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ CONFIG_IP6_NF_MANGLE=y
125125
CONFIG_NET_SCHED=y
126126
CONFIG_NET_EMATCH=y
127127
CONFIG_NET_CLS_ACT=y
128-
CONFIG_HAMRADIO=y
129128
CONFIG_CFG80211=y
130129
CONFIG_MAC80211=y
131130
CONFIG_MAC80211_LEDS=y
@@ -171,7 +170,6 @@ CONFIG_FORCEDETH=y
171170
CONFIG_8139TOO=y
172171
# CONFIG_8139TOO_PIO is not set
173172
CONFIG_R8169=y
174-
CONFIG_FDDI=y
175173
CONFIG_INPUT_POLLDEV=y
176174
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
177175
CONFIG_INPUT_EVDEV=y

arch/x86/configs/x86_64_defconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ CONFIG_IP6_NF_MANGLE=y
123123
CONFIG_NET_SCHED=y
124124
CONFIG_NET_EMATCH=y
125125
CONFIG_NET_CLS_ACT=y
126-
CONFIG_HAMRADIO=y
127126
CONFIG_CFG80211=y
128127
CONFIG_MAC80211=y
129128
CONFIG_MAC80211_LEDS=y
@@ -164,7 +163,6 @@ CONFIG_SKY2=y
164163
CONFIG_FORCEDETH=y
165164
CONFIG_8139TOO=y
166165
CONFIG_R8169=y
167-
CONFIG_FDDI=y
168166
CONFIG_INPUT_POLLDEV=y
169167
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
170168
CONFIG_INPUT_EVDEV=y

arch/x86/entry/common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <asm/fpu/api.h>
3535
#include <asm/nospec-branch.h>
3636
#include <asm/io_bitmap.h>
37+
#include <asm/syscall.h>
3738

3839
#define CREATE_TRACE_POINTS
3940
#include <trace/events/syscalls.h>

arch/x86/events/core.c

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2490,7 +2490,7 @@ perf_callchain_user32(struct pt_regs *regs, struct perf_callchain_entry_ctx *ent
24902490
/* 32-bit process in 64-bit kernel. */
24912491
unsigned long ss_base, cs_base;
24922492
struct stack_frame_ia32 frame;
2493-
const void __user *fp;
2493+
const struct stack_frame_ia32 __user *fp;
24942494

24952495
if (!test_thread_flag(TIF_IA32))
24962496
return 0;
@@ -2501,18 +2501,12 @@ perf_callchain_user32(struct pt_regs *regs, struct perf_callchain_entry_ctx *ent
25012501
fp = compat_ptr(ss_base + regs->bp);
25022502
pagefault_disable();
25032503
while (entry->nr < entry->max_stack) {
2504-
unsigned long bytes;
2505-
frame.next_frame = 0;
2506-
frame.return_address = 0;
2507-
25082504
if (!valid_user_frame(fp, sizeof(frame)))
25092505
break;
25102506

2511-
bytes = __copy_from_user_nmi(&frame.next_frame, fp, 4);
2512-
if (bytes != 0)
2507+
if (__get_user(frame.next_frame, &fp->next_frame))
25132508
break;
2514-
bytes = __copy_from_user_nmi(&frame.return_address, fp+4, 4);
2515-
if (bytes != 0)
2509+
if (__get_user(frame.return_address, &fp->return_address))
25162510
break;
25172511

25182512
perf_callchain_store(entry, cs_base + frame.return_address);
@@ -2533,7 +2527,7 @@ void
25332527
perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs)
25342528
{
25352529
struct stack_frame frame;
2536-
const unsigned long __user *fp;
2530+
const struct stack_frame __user *fp;
25372531

25382532
if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
25392533
/* TODO: We don't support guest os callchain now */
@@ -2546,7 +2540,7 @@ perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs
25462540
if (regs->flags & (X86_VM_MASK | PERF_EFLAGS_VM))
25472541
return;
25482542

2549-
fp = (unsigned long __user *)regs->bp;
2543+
fp = (void __user *)regs->bp;
25502544

25512545
perf_callchain_store(entry, regs->ip);
25522546

@@ -2558,19 +2552,12 @@ perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs
25582552

25592553
pagefault_disable();
25602554
while (entry->nr < entry->max_stack) {
2561-
unsigned long bytes;
2562-
2563-
frame.next_frame = NULL;
2564-
frame.return_address = 0;
2565-
25662555
if (!valid_user_frame(fp, sizeof(frame)))
25672556
break;
25682557

2569-
bytes = __copy_from_user_nmi(&frame.next_frame, fp, sizeof(*fp));
2570-
if (bytes != 0)
2558+
if (__get_user(frame.next_frame, &fp->next_frame))
25712559
break;
2572-
bytes = __copy_from_user_nmi(&frame.return_address, fp + 1, sizeof(*fp));
2573-
if (bytes != 0)
2560+
if (__get_user(frame.return_address, &fp->return_address))
25742561
break;
25752562

25762563
perf_callchain_store(entry, frame.return_address);

0 commit comments

Comments
 (0)