summaryrefslogtreecommitdiff
path: root/driver/probes_manager.c
blob: 647be79aaa22224a272a927b7ffa2edf5008d649 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
////////////////////////////////////////////////////////////////////////////////////
//
//      FILE:           probes_manager.c
//
//      DESCRIPTION:
//      This file is C source for SWAP driver.
//
//      SEE ALSO:       probes_manager.h
//      AUTHOR:         L.Komkov, A.Gerenkov
//      COMPANY NAME:   Samsung Research Center in Moscow
//      DEPT NAME:      Advanced Software Group
//      CREATED:        2008.02.15
//      VERSION:        1.0
//      REVISION DATE:  2008.12.03
//
////////////////////////////////////////////////////////////////////////////////////

#include <linux/percpu.h>
#include <ksyms.h>
#include "module.h"
#include "probes_manager.h"

#ifdef EC_ARCH_arm
/* ARCH == arm */
#include "../kprobe/dbi_kprobes.h"
#endif /* def EC_ARCH_arm */

#ifdef EC_ARCH_x86
/* ARCH == x86 */
//#include <linux/kprobes.h>
#include "../kprobe/dbi_kprobes.h"
#endif /* def EC_ARCH_x86 */

#ifdef EC_ARCH_mips
/* ARCH == mips */
#include "../kprobe/dbi_kprobes.h"
#endif /* def EC_ARCH_mips */

unsigned long pf_addr;
unsigned long cp_addr;
unsigned long mr_addr;
unsigned long exit_addr;
unsigned long unmap_addr;
kernel_probe_t *pf_probe = NULL;
kernel_probe_t *cp_probe = NULL;
kernel_probe_t *mr_probe = NULL;
kernel_probe_t *exit_probe = NULL;
kernel_probe_t *unmap_probe = NULL;
unsigned int probes_flags = 0;

int
probes_manager_init (void)
{
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38)
	spin_lock_init(&ec_spinlock);
	spin_lock_init(&ec_probe_spinlock);
#endif /* LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38) */
	pf_addr = swap_ksyms("do_page_fault");
	if (pf_addr == 0) {
		EPRINTF("Cannot find address for page fault function!");
		return -EINVAL;
	}

	cp_addr = swap_ksyms("copy_process");
	if (cp_addr == 0) {
		EPRINTF("Cannot find address for copy_process function!");
		return -EINVAL;
	}

	mr_addr = swap_ksyms("mm_release");
	if (mr_addr == 0) {
		EPRINTF("Cannot find address for mm_release function!");
		return -EINVAL;
	}

	exit_addr = swap_ksyms("do_exit");
	if (exit_addr == 0) {
		EPRINTF("Cannot find address for do_exit function!");
		return -EINVAL;
	}

	unmap_addr = swap_ksyms("do_munmap");
	if (unmap_addr == 0) {
		EPRINTF("Cannot find address for do_munmap function!");
		return -EINVAL;
	}

	return storage_init ();
}

void
probes_manager_down (void)
{
	detach_selected_probes ();
	storage_down ();
}

static int
register_kernel_jprobe (kernel_probe_t * probe)
{
	int result;
	if( ((probe == pf_probe) && (us_proc_probes & US_PROC_PF_INSTLD)) ||
	    ((probe == cp_probe) && (us_proc_probes & US_PROC_CP_INSTLD)) ||
	    ((probe == mr_probe) && (us_proc_probes & US_PROC_MR_INSTLD)) ||
	    ((probe == unmap_probe) && (us_proc_probes & US_PROC_UNMAP_INSTLD)) ||
	    ((probe == exit_probe) && (us_proc_probes & US_PROC_EXIT_INSTLD)))
	{
		return 0;	// probe is already registered
	}
	result = dbi_register_jprobe (&probe->jprobe);
	if (result)
	{
		EPRINTF ("register_kernel_jprobe(0x%lx) failure %d", probe->addr, result);
		return result;
	}
	return 0;
}

static int
unregister_kernel_jprobe (kernel_probe_t * probe)
{
	if( ((probe == pf_probe) && (us_proc_probes & US_PROC_PF_INSTLD)) ||
	    ((probe == cp_probe) && (us_proc_probes & US_PROC_CP_INSTLD)) ||
	    ((probe == mr_probe) && (us_proc_probes & US_PROC_MR_INSTLD)) ||
	    ((probe == unmap_probe) && (us_proc_probes & US_PROC_UNMAP_INSTLD)) ||
	    ((probe == exit_probe) && (us_proc_probes & US_PROC_EXIT_INSTLD)) ) {
		return 0;	// probe is necessary for user space instrumentation
	}
	dbi_unregister_jprobe (&probe->jprobe);
	return 0;
}

static int
register_kernel_retprobe (kernel_probe_t * probe)
{
	int result;
	if( ((probe == pf_probe) && (us_proc_probes & US_PROC_PF_INSTLD)) ||
	    ((probe == cp_probe) && (us_proc_probes & US_PROC_CP_INSTLD)) ||
	    ((probe == mr_probe) && (us_proc_probes & US_PROC_MR_INSTLD)) ||
	    ((probe == unmap_probe) && (us_proc_probes & US_PROC_UNMAP_INSTLD)) ||
	    ((probe == exit_probe) && (us_proc_probes & US_PROC_EXIT_INSTLD)) ) {

		return 0;	// probe is already registered
	}

	result = dbi_register_kretprobe (&probe->retprobe);
	if (result)
	{
		EPRINTF ("register_kernel_retprobe(0x%lx) failure %d", probe->addr, result);
		return result;
	}
	return 0;
}

static int
unregister_kernel_retprobe (kernel_probe_t * probe)
{
	if( ((probe == pf_probe) && (us_proc_probes & US_PROC_PF_INSTLD)) ||
	    ((probe == cp_probe) && (us_proc_probes & US_PROC_CP_INSTLD)) ||
	    ((probe == mr_probe) && (us_proc_probes & US_PROC_MR_INSTLD)) ||
	    ((probe == unmap_probe) && (us_proc_probes & US_PROC_UNMAP_INSTLD)) ||
	    ((probe == exit_probe) && (us_proc_probes & US_PROC_EXIT_INSTLD)) ) {
		return 0;	// probe is necessary for user space instrumentation
	}
	dbi_unregister_kretprobe (&probe->retprobe);
	return 0;
}

int
register_kernel_probe (kernel_probe_t * probe)
{
	register_kernel_jprobe (probe);
	register_kernel_retprobe (probe);
	return 0;
}

int
unregister_kernel_probe (kernel_probe_t * probe)
{
	unregister_kernel_jprobe (probe);
	unregister_kernel_retprobe (probe);
	return 0;
}

int
attach_selected_probes (void)
{
	int result = 0;
	int partial_result = 0;
	kernel_probe_t *p;
	struct hlist_node *node;

	hlist_for_each_entry_rcu (p, node, &kernel_probes, hlist)
	{
		partial_result = register_kernel_probe (p);
		if (partial_result)
		{
			result = partial_result;
			detach_selected_probes ();	// return into safe state
			break;
		}
	}

	return result;
}

int
detach_selected_probes (void)
{
	kernel_probe_t *p;
	struct hlist_node *node;

	hlist_for_each_entry_rcu (p, node, &kernel_probes, hlist)
		unregister_kernel_probe (p);
	hlist_for_each_entry_rcu (p, node, &otg_kernel_probes, hlist) {
		unregister_kernel_probe(p);
	}

	return 0;
}

int
add_probe (unsigned long addr)
{
	int result = 0;
	kernel_probe_t **pprobe = NULL;

	DPRINTF("add probe at 0x%0x\n", addr);
	if (EC_STATE_IDLE != ec_info.ec_state)
	{
		EPRINTF("Probes addition is allowed in IDLE state only.");
		return -EINVAL;
	}

	if (addr == pf_addr) {
		probes_flags |= PROBE_FLAG_PF_INSTLD;
		if (us_proc_probes & US_PROC_PF_INSTLD)
		{
			return 0;
		}
		pprobe = &pf_probe;
	}
	else if (addr == cp_addr) {
		probes_flags |= PROBE_FLAG_CP_INSTLD;
		if (us_proc_probes & US_PROC_CP_INSTLD)
		{
			return 0;
		}
		pprobe = &cp_probe;
	}
	else if (addr == exit_addr) {
		probes_flags |= PROBE_FLAG_EXIT_INSTLD;
		if (us_proc_probes & US_PROC_EXIT_INSTLD)
		{
			return 0;
		}
		pprobe = &exit_probe;
	}
	else if (addr == mr_addr) {
		probes_flags |= PROBE_FLAG_MR_INSTLD;
		if (us_proc_probes & US_PROC_MR_INSTLD) {
			return 0;
		}
		pprobe = &mr_probe;
	}
	else if (addr == unmap_addr) {
		probes_flags |= PROBE_FLAG_UNMAP_INSTLD;
		if (us_proc_probes & US_PROC_UNMAP_INSTLD)
		{
			return 0;
		}
		pprobe = &unmap_probe;
	}

	result = add_probe_to_list (addr, pprobe);
	if (result) {
		if (addr == pf_addr)
			probes_flags &= ~PROBE_FLAG_PF_INSTLD;
		else if (addr == cp_addr)
			probes_flags &= ~PROBE_FLAG_CP_INSTLD;
		else if (addr == exit_addr)
			probes_flags &= ~PROBE_FLAG_EXIT_INSTLD;
		else if (addr == mr_addr)
			probes_flags &= ~PROBE_FLAG_MR_INSTLD;
		else if (addr == unmap_addr)
			probes_flags &= ~PROBE_FLAG_UNMAP_INSTLD;
	}
	return result;
}

int reset_probes(void)
{
	struct hlist_node *node, *tnode;
	kernel_probe_t *p;

	hlist_for_each_entry_safe (p, node, tnode, &kernel_probes, hlist) {
		if (p->addr == pf_addr) {
			probes_flags &= ~PROBE_FLAG_PF_INSTLD;
			pf_probe = NULL;
		} else if (p->addr == cp_addr) {
			probes_flags &= ~PROBE_FLAG_CP_INSTLD;
			cp_probe = NULL;
		} else if (p->addr == exit_addr) {
			probes_flags &= ~PROBE_FLAG_EXIT_INSTLD;
			exit_probe = NULL;
		} else if (p->addr == mr_addr) {
			probes_flags &= ~PROBE_FLAG_MR_INSTLD;
			mr_probe = NULL;
		} else if (p->addr == unmap_addr) {
			probes_flags &= ~PROBE_FLAG_UNMAP_INSTLD;
			unmap_probe = NULL;
		}
		hlist_del(node);
		kfree(p);
	}

	hlist_for_each_entry_safe (p, node, tnode, &otg_kernel_probes, hlist) {
		if (p->addr == pf_addr) {
			probes_flags &= ~PROBE_FLAG_PF_INSTLD;
			pf_probe = NULL;
		} else if (p->addr == cp_addr) {
			probes_flags &= ~PROBE_FLAG_CP_INSTLD;
			cp_probe = NULL;
		} else if (p->addr == exit_addr) {
			probes_flags &= ~PROBE_FLAG_EXIT_INSTLD;
			exit_probe = NULL;
		} else if (p->addr == mr_addr) {
			probes_flags &= ~PROBE_FLAG_MR_INSTLD;
			mr_probe = NULL;
		} else if (p->addr == unmap_addr) {
			probes_flags &= ~PROBE_FLAG_UNMAP_INSTLD;
			unmap_probe = NULL;
		}
		hlist_del(node);
		kfree(p);
	}

	return 0;
}

int
remove_probe (unsigned long addr)
{
	int result = 0;

	if (EC_STATE_IDLE != ec_info.ec_state)
	{
		EPRINTF("Probes addition is allowed in IDLE state only.");
		return -EINVAL;
	}

	if (addr == pf_addr) {
		probes_flags &= ~PROBE_FLAG_PF_INSTLD;
		if (us_proc_probes & US_PROC_PF_INSTLD)
		{
			return 0;
		}
		pf_probe = NULL;
	}
	else if (addr == cp_addr) {
		probes_flags &= ~PROBE_FLAG_CP_INSTLD;
		if (us_proc_probes & US_PROC_CP_INSTLD)
		{
			return 0;
		}
		cp_probe = NULL;
	}
	else if (addr == mr_addr) {
		probes_flags &= ~PROBE_FLAG_MR_INSTLD;
		if (us_proc_probes & US_PROC_MR_INSTLD) {
			return 0;
		}
		mr_probe = NULL;
	}
	else if (addr == exit_addr) {
		probes_flags &= ~PROBE_FLAG_EXIT_INSTLD;
		if (us_proc_probes & US_PROC_EXIT_INSTLD)
		{
			return 0;
		}
		exit_probe = NULL;
	}
	else if (addr == unmap_addr) {
		probes_flags &= ~PROBE_FLAG_UNMAP_INSTLD;
		if (us_proc_probes & US_PROC_UNMAP_INSTLD)
		{
			return 0;
		}
		unmap_probe = NULL;
	}

	result = remove_probe_from_list (addr);

	return result;
}

static DEFINE_PER_CPU(kernel_probe_t *, gpKernProbe) = NULL;

unsigned long
def_jprobe_event_pre_handler (kernel_probe_t * probe, struct pt_regs *regs)
{
	__get_cpu_var (gpKernProbe) = probe;

	return 0;
}

void
def_jprobe_event_handler (unsigned long arg1, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5, unsigned long arg6)
{
	//static int nCount;
	kernel_probe_t *probe = __get_cpu_var(gpKernProbe);
	int skip = 0;

	if (pf_probe == probe)
	{
		if (us_proc_probes & US_PROC_PF_INSTLD)
			do_page_fault_j_pre_code(arg1, arg2, (struct pt_regs *) arg3);
#ifdef CONFIG_X86
		/* FIXME on x86 targets do_page_fault instrumentation may lead to
		 * abnormal termination of some applications (in most cases GUI apps).
		 * It looks like when do_page_fault probe is hit and the
		 * def_jprobe_event_handler is executed it tries to write event info
		 * into the SWAP buffer which seems not to be mapped into the
		 * process memory yet. Such behaviour causes segmentation faults.
		 * For now as a workaround we just avoid to write the ENTRY event into
		 * the buffer in all cases. */
		skip = 1;
#else /* CONFIG_X86 */
		if (!(probes_flags & PROBE_FLAG_PF_INSTLD))
			skip = 1;
#endif /* CONFIG_X86 */
	}
	else if (cp_probe == probe)
	{
		if (!(probes_flags & PROBE_FLAG_CP_INSTLD))
			skip = 1;
	}
	else if (mr_probe == probe)
	{
		if (us_proc_probes & US_PROC_MR_INSTLD)
			mm_release_probe_pre_code();
		if (!(probes_flags & PROBE_FLAG_MR_INSTLD))
			skip = 1;
	}
	else if (exit_probe == probe)
	{
		if (us_proc_probes & US_PROC_EXIT_INSTLD)
			do_exit_probe_pre_code();
		if (!(probes_flags & PROBE_FLAG_EXIT_INSTLD))
			skip = 1;
	}
	else if (unmap_probe == probe)
	{
		if (us_proc_probes & US_PROC_UNMAP_INSTLD)
			do_munmap_probe_pre_code((struct mm_struct *)arg1, arg2, (size_t)arg3);
		if (!(probes_flags & PROBE_FLAG_UNMAP_INSTLD))
			skip = 1;
	}

	if (!skip)
		pack_event_info (KS_PROBE_ID, RECORD_ENTRY, "pxxxxxx", probe->addr, arg1, arg2, arg3, arg4, arg5, arg6);
	dbi_jprobe_return ();
}

int
def_retprobe_event_handler (struct kretprobe_instance *pi, struct pt_regs *regs, kernel_probe_t * probe)
{
	int skip = 0;
	int ret_val;

	if (pf_probe == probe)
	{
		if (us_proc_probes & US_PROC_PF_INSTLD)
			do_page_fault_ret_pre_code ();
		if (!(probes_flags & PROBE_FLAG_PF_INSTLD))
			skip = 1;
	}
	if (cp_probe == probe)
	{
		if (us_proc_probes & US_PROC_CP_INSTLD)
			copy_process_ret_pre_code((struct task_struct*)(regs_return_value(regs)));

		if (!(probes_flags & PROBE_FLAG_CP_INSTLD))
			skip = 1;
	}
	else if (mr_probe == probe)
	{
		if (!(probes_flags & PROBE_FLAG_MR_INSTLD))
			skip = 1;
	}
	else if (exit_probe == probe)
	{
		if (!(probes_flags & PROBE_FLAG_EXIT_INSTLD))
			skip = 1;
	}
	else if (unmap_probe == probe)
	{
		if (!(probes_flags & PROBE_FLAG_UNMAP_INSTLD))
			skip = 1;
	}

	if (!skip) {
		ret_val = regs_return_value(regs);
		pack_event_info (KS_PROBE_ID, RECORD_RET, "pd",
				 probe->addr, ret_val);
	}
	return 0;
}

/* This is a callback that is called by module 'swap_handlers'
 * in order to register user defined handlers */
void dbi_install_user_handlers(void)
{
	kernel_probe_t *probe;
	struct hlist_node *node;
	unsigned long pre_handler_addr, jp_handler_addr, rp_handler_addr;

	// FIXME: functions 'find_jp_handler', 'find_rp_handler', 'find_pre_handler' - not found
	/* We must perform this lookup whenever this function is called
	 * because the addresses of find_*_handler functions may differ. */
	// swap_handlers removed
	unsigned long (*find_jp_handler)(unsigned long) =
	// swap_handlers removed
		(unsigned long (*)(unsigned long))swap_ksyms("find_jp_handler");
	unsigned long (*find_rp_handler)(unsigned long) =
			(unsigned long (*)(unsigned long))swap_ksyms("find_rp_handler");
	unsigned long (*find_pre_handler)(unsigned long) =
			(unsigned long (*)(unsigned long))swap_ksyms("find_pre_handler");
	hlist_for_each_entry_rcu (probe, node, &kernel_probes, hlist) {
		if(find_pre_handler)
		{
			pre_handler_addr = find_pre_handler(probe->addr);
			if (find_pre_handler != NULL) {
				DPRINTF("Added user pre handler for 0x%lx: 0x%lx",
						probe->addr, find_pre_handler);
				probe->jprobe.pre_entry = (kprobe_pre_entry_handler_t)pre_handler_addr;
			}
		}
		jp_handler_addr = find_jp_handler(probe->addr);
		if (jp_handler_addr != 0) {
			DPRINTF("Added user jp handler for 0x%lx: 0x%lx",
					probe->addr, jp_handler_addr);
			probe->jprobe.entry = (kprobe_opcode_t *)jp_handler_addr;
		}
		rp_handler_addr = find_rp_handler(probe->addr);
		if (rp_handler_addr != 0)
			probe->retprobe.handler = (kretprobe_handler_t)rp_handler_addr;
	}
}
EXPORT_SYMBOL_GPL(dbi_install_user_handlers);

void dbi_uninstall_user_handlers(void)
{
	kernel_probe_t *probe;
	struct hlist_node *node;

	hlist_for_each_entry_rcu (probe, node, &kernel_probes, hlist) {
		DPRINTF("Removed user jp handler for 0x%lx", probe->addr);
		probe->jprobe.pre_entry = (kprobe_pre_entry_handler_t)def_jprobe_event_pre_handler;
		probe->jprobe.entry = (kprobe_opcode_t *)def_jprobe_event_handler;
		probe->retprobe.handler = (kretprobe_handler_t)def_retprobe_event_handler;
	}
}
EXPORT_SYMBOL_GPL(dbi_uninstall_user_handlers);

int is_pf_installed_by_user(void)
{
	return (probes_flags & PROBE_FLAG_PF_INSTLD) ? 1: 0;
}
EXPORT_SYMBOL_GPL(is_pf_installed_by_user);

int install_kern_otg_probe(unsigned long addr,
			   unsigned long pre_handler,
			   unsigned long jp_handler,
			   unsigned long rp_handler)
{
	kernel_probe_t *new_probe = NULL;
	kernel_probe_t *probe;
	int ret = 0;

	probe = find_probe(addr);
	if (probe) {
		/* It is not a problem if we have already registered
		   this probe before */
		return 0;
	}

	new_probe = kmalloc(sizeof (kernel_probe_t), GFP_ATOMIC);
	if (!new_probe) {
		EPRINTF("No memory for new probe");
		return -1;
	}
	memset(new_probe, 0, sizeof(kernel_probe_t));

	new_probe->addr = addr;
	new_probe->jprobe.kp.addr = new_probe->retprobe.kp.addr = (kprobe_opcode_t *)addr;
	new_probe->jprobe.priv_arg = new_probe->retprobe.priv_arg = new_probe;

	if (pre_handler) {
		new_probe->jprobe.pre_entry =
			(kprobe_pre_entry_handler_t)
			pre_handler;
	} else {
		new_probe->jprobe.pre_entry =
			(kprobe_pre_entry_handler_t)
			def_jprobe_event_pre_handler;
	}

	if (jp_handler) {
		new_probe->jprobe.entry = (kprobe_opcode_t *)jp_handler;
	} else {
		new_probe->jprobe.entry =
			(kprobe_opcode_t *)
			def_jprobe_event_handler;
	}

	if (rp_handler) {
		new_probe->retprobe.handler = (kretprobe_handler_t)rp_handler;
	} else {
		new_probe->retprobe.handler =
			(kretprobe_handler_t)
			def_retprobe_event_handler;
	}

	INIT_HLIST_NODE (&new_probe->hlist);
	hlist_add_head_rcu (&new_probe->hlist, &kernel_probes);

	ret = register_kernel_probe(new_probe);
	if (ret) {
		EPRINTF("Cannot set kernel probe at addr %lx", addr);
		return -1;
	}

	return 0;
}
EXPORT_SYMBOL_GPL(install_kern_otg_probe);