aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-12 22:18:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-12 22:18:49 -0400
commit3737a12761636ebde0f09ef49daebb8eed18cc8a (patch)
tree965057f4bccd97049f8c0140f8670c5d4278ca3e /arch/x86/mm
parentc29deef32e3699e40da3e9e82267610de04e6b54 (diff)
parent82b897782d10fcc4930c9d4a15b175348fdd2871 (diff)
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull more perf updates from Ingo Molnar: "A second round of perf updates: - wide reaching kprobes sanitization and robustization, with the hope of fixing all 'probe this function crashes the kernel' bugs, by Masami Hiramatsu. - uprobes updates from Oleg Nesterov: tmpfs support, corner case fixes and robustization work. - perf tooling updates and fixes from Jiri Olsa, Namhyung Ki, Arnaldo et al: * Add support to accumulate hist periods (Namhyung Kim) * various fixes, refactorings and enhancements" * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (101 commits) perf: Differentiate exec() and non-exec() comm events perf: Fix perf_event_comm() vs. exec() assumption uprobes/x86: Rename arch_uprobe->def to ->defparam, minor comment updates perf/documentation: Add description for conditional branch filter perf/x86: Add conditional branch filtering support perf/tool: Add conditional branch filter 'cond' to perf record perf: Add new conditional branch filter 'PERF_SAMPLE_BRANCH_COND' uprobes: Teach copy_insn() to support tmpfs uprobes: Shift ->readpage check from __copy_insn() to uprobe_register() perf/x86: Use common PMU interrupt disabled code perf/ARM: Use common PMU interrupt disabled code perf: Disable sampled events if no PMU interrupt perf: Fix use after free in perf_remove_from_context() perf tools: Fix 'make help' message error perf record: Fix poll return value propagation perf tools: Move elide bool into perf_hpp_fmt struct perf tools: Remove elide setup for SORT_MODE__MEMORY mode perf tools: Fix "==" into "=" in ui_browser__warning assignment perf tools: Allow overriding sysfs and proc finding with env var perf tools: Consider header files outside perf directory in tags target ...
Diffstat (limited to 'arch/x86/mm')
-rw-r--r--arch/x86/mm/fault.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 858b47b5221b..36642793e315 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -8,7 +8,7 @@
8#include <linux/kdebug.h> /* oops_begin/end, ... */ 8#include <linux/kdebug.h> /* oops_begin/end, ... */
9#include <linux/module.h> /* search_exception_table */ 9#include <linux/module.h> /* search_exception_table */
10#include <linux/bootmem.h> /* max_low_pfn */ 10#include <linux/bootmem.h> /* max_low_pfn */
11#include <linux/kprobes.h> /* __kprobes, ... */ 11#include <linux/kprobes.h> /* NOKPROBE_SYMBOL, ... */
12#include <linux/mmiotrace.h> /* kmmio_handler, ... */ 12#include <linux/mmiotrace.h> /* kmmio_handler, ... */
13#include <linux/perf_event.h> /* perf_sw_event */ 13#include <linux/perf_event.h> /* perf_sw_event */
14#include <linux/hugetlb.h> /* hstate_index_to_shift */ 14#include <linux/hugetlb.h> /* hstate_index_to_shift */
@@ -46,7 +46,7 @@ enum x86_pf_error_code {
46 * Returns 0 if mmiotrace is disabled, or if the fault is not 46 * Returns 0 if mmiotrace is disabled, or if the fault is not
47 * handled by mmiotrace: 47 * handled by mmiotrace:
48 */ 48 */
49static inline int __kprobes 49static nokprobe_inline int
50kmmio_fault(struct pt_regs *regs, unsigned long addr) 50kmmio_fault(struct pt_regs *regs, unsigned long addr)
51{ 51{
52 if (unlikely(is_kmmio_active())) 52 if (unlikely(is_kmmio_active()))
@@ -55,7 +55,7 @@ kmmio_fault(struct pt_regs *regs, unsigned long addr)
55 return 0; 55 return 0;
56} 56}
57 57
58static inline int __kprobes kprobes_fault(struct pt_regs *regs) 58static nokprobe_inline int kprobes_fault(struct pt_regs *regs)
59{ 59{
60 int ret = 0; 60 int ret = 0;
61 61
@@ -262,7 +262,7 @@ void vmalloc_sync_all(void)
262 * 262 *
263 * Handle a fault on the vmalloc or module mapping area 263 * Handle a fault on the vmalloc or module mapping area
264 */ 264 */
265static noinline __kprobes int vmalloc_fault(unsigned long address) 265static noinline int vmalloc_fault(unsigned long address)
266{ 266{
267 unsigned long pgd_paddr; 267 unsigned long pgd_paddr;
268 pmd_t *pmd_k; 268 pmd_t *pmd_k;
@@ -292,6 +292,7 @@ static noinline __kprobes int vmalloc_fault(unsigned long address)
292 292
293 return 0; 293 return 0;
294} 294}
295NOKPROBE_SYMBOL(vmalloc_fault);
295 296
296/* 297/*
297 * Did it hit the DOS screen memory VA from vm86 mode? 298 * Did it hit the DOS screen memory VA from vm86 mode?
@@ -359,7 +360,7 @@ void vmalloc_sync_all(void)
359 * 360 *
360 * This assumes no large pages in there. 361 * This assumes no large pages in there.
361 */ 362 */
362static noinline __kprobes int vmalloc_fault(unsigned long address) 363static noinline int vmalloc_fault(unsigned long address)
363{ 364{
364 pgd_t *pgd, *pgd_ref; 365 pgd_t *pgd, *pgd_ref;
365 pud_t *pud, *pud_ref; 366 pud_t *pud, *pud_ref;
@@ -426,6 +427,7 @@ static noinline __kprobes int vmalloc_fault(unsigned long address)
426 427
427 return 0; 428 return 0;
428} 429}
430NOKPROBE_SYMBOL(vmalloc_fault);
429 431
430#ifdef CONFIG_CPU_SUP_AMD 432#ifdef CONFIG_CPU_SUP_AMD
431static const char errata93_warning[] = 433static const char errata93_warning[] =
@@ -928,7 +930,7 @@ static int spurious_fault_check(unsigned long error_code, pte_t *pte)
928 * There are no security implications to leaving a stale TLB when 930 * There are no security implications to leaving a stale TLB when
929 * increasing the permissions on a page. 931 * increasing the permissions on a page.
930 */ 932 */
931static noinline __kprobes int 933static noinline int
932spurious_fault(unsigned long error_code, unsigned long address) 934spurious_fault(unsigned long error_code, unsigned long address)
933{ 935{
934 pgd_t *pgd; 936 pgd_t *pgd;
@@ -976,6 +978,7 @@ spurious_fault(unsigned long error_code, unsigned long address)
976 978
977 return ret; 979 return ret;
978} 980}
981NOKPROBE_SYMBOL(spurious_fault);
979 982
980int show_unhandled_signals = 1; 983int show_unhandled_signals = 1;
981 984
@@ -1031,7 +1034,7 @@ static inline bool smap_violation(int error_code, struct pt_regs *regs)
1031 * {,trace_}do_page_fault() have notrace on. Having this an actual function 1034 * {,trace_}do_page_fault() have notrace on. Having this an actual function
1032 * guarantees there's a function trace entry. 1035 * guarantees there's a function trace entry.
1033 */ 1036 */
1034static void __kprobes noinline 1037static noinline void
1035__do_page_fault(struct pt_regs *regs, unsigned long error_code, 1038__do_page_fault(struct pt_regs *regs, unsigned long error_code,
1036 unsigned long address) 1039 unsigned long address)
1037{ 1040{
@@ -1254,8 +1257,9 @@ good_area:
1254 1257
1255 up_read(&mm->mmap_sem); 1258 up_read(&mm->mmap_sem);
1256} 1259}
1260NOKPROBE_SYMBOL(__do_page_fault);
1257 1261
1258dotraplinkage void __kprobes notrace 1262dotraplinkage void notrace
1259do_page_fault(struct pt_regs *regs, unsigned long error_code) 1263do_page_fault(struct pt_regs *regs, unsigned long error_code)
1260{ 1264{
1261 unsigned long address = read_cr2(); /* Get the faulting address */ 1265 unsigned long address = read_cr2(); /* Get the faulting address */
@@ -1273,10 +1277,12 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)
1273 __do_page_fault(regs, error_code, address); 1277 __do_page_fault(regs, error_code, address);
1274 exception_exit(prev_state); 1278 exception_exit(prev_state);
1275} 1279}
1280NOKPROBE_SYMBOL(do_page_fault);
1276 1281
1277#ifdef CONFIG_TRACING 1282#ifdef CONFIG_TRACING
1278static void trace_page_fault_entries(unsigned long address, struct pt_regs *regs, 1283static nokprobe_inline void
1279 unsigned long error_code) 1284trace_page_fault_entries(unsigned long address, struct pt_regs *regs,
1285 unsigned long error_code)
1280{ 1286{
1281 if (user_mode(regs)) 1287 if (user_mode(regs))
1282 trace_page_fault_user(address, regs, error_code); 1288 trace_page_fault_user(address, regs, error_code);
@@ -1284,7 +1290,7 @@ static void trace_page_fault_entries(unsigned long address, struct pt_regs *regs
1284 trace_page_fault_kernel(address, regs, error_code); 1290 trace_page_fault_kernel(address, regs, error_code);
1285} 1291}
1286 1292
1287dotraplinkage void __kprobes notrace 1293dotraplinkage void notrace
1288trace_do_page_fault(struct pt_regs *regs, unsigned long error_code) 1294trace_do_page_fault(struct pt_regs *regs, unsigned long error_code)
1289{ 1295{
1290 /* 1296 /*
@@ -1301,4 +1307,5 @@ trace_do_page_fault(struct pt_regs *regs, unsigned long error_code)
1301 __do_page_fault(regs, error_code, address); 1307 __do_page_fault(regs, error_code, address);
1302 exception_exit(prev_state); 1308 exception_exit(prev_state);
1303} 1309}
1310NOKPROBE_SYMBOL(trace_do_page_fault);
1304#endif /* CONFIG_TRACING */ 1311#endif /* CONFIG_TRACING */