opt.c (74be62c7cefbf320e0605f3da6639ef80448ff00) opt.c (d9f5f32a7d17f4906a21ad59589853639a1328a0)
1/*
2 * Kernel Probes Jump Optimization (Optprobes)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *

--- 25 unchanged lines hidden (view full) ---

34#include <asm/cacheflush.h>
35#include <asm/desc.h>
36#include <asm/pgtable.h>
37#include <linux/uaccess.h>
38#include <asm/alternative.h>
39#include <asm/insn.h>
40#include <asm/debugreg.h>
41#include <asm/set_memory.h>
1/*
2 * Kernel Probes Jump Optimization (Optprobes)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *

--- 25 unchanged lines hidden (view full) ---

34#include <asm/cacheflush.h>
35#include <asm/desc.h>
36#include <asm/pgtable.h>
37#include <linux/uaccess.h>
38#include <asm/alternative.h>
39#include <asm/insn.h>
40#include <asm/debugreg.h>
41#include <asm/set_memory.h>
42#include <asm/sections.h>
42
43#include "common.h"
44
45unsigned long __recover_optprobed_insn(kprobe_opcode_t *buf, unsigned long addr)
46{
47 struct optimized_kprobe *op;
48 struct kprobe *kp;
49 long offs;

--- 196 unchanged lines hidden (view full) ---

246 kprobe_opcode_t buf[MAX_INSN_SIZE];
247
248 /* Lookup symbol including addr */
249 if (!kallsyms_lookup_size_offset(paddr, &size, &offset))
250 return 0;
251
252 /*
253 * Do not optimize in the entry code due to the unstable
43
44#include "common.h"
45
46unsigned long __recover_optprobed_insn(kprobe_opcode_t *buf, unsigned long addr)
47{
48 struct optimized_kprobe *op;
49 struct kprobe *kp;
50 long offs;

--- 196 unchanged lines hidden (view full) ---

247 kprobe_opcode_t buf[MAX_INSN_SIZE];
248
249 /* Lookup symbol including addr */
250 if (!kallsyms_lookup_size_offset(paddr, &size, &offset))
251 return 0;
252
253 /*
254 * Do not optimize in the entry code due to the unstable
254 * stack handling.
255 * stack handling and registers setup.
255 */
256 */
256 if ((paddr >= (unsigned long)__entry_text_start) &&
257 (paddr < (unsigned long)__entry_text_end))
257 if (((paddr >= (unsigned long)__entry_text_start) &&
258 (paddr < (unsigned long)__entry_text_end)) ||
259 ((paddr >= (unsigned long)__irqentry_text_start) &&
260 (paddr < (unsigned long)__irqentry_text_end)))
258 return 0;
259
260 /* Check there is enough space for a relative jump. */
261 if (size - offset < RELATIVEJUMP_SIZE)
262 return 0;
263
264 /* Decode instructions */
265 addr = paddr - offset;

--- 203 unchanged lines hidden ---
261 return 0;
262
263 /* Check there is enough space for a relative jump. */
264 if (size - offset < RELATIVEJUMP_SIZE)
265 return 0;
266
267 /* Decode instructions */
268 addr = paddr - offset;

--- 203 unchanged lines hidden ---