kprobes.c (59dc5bfca0cb6a29db1a50847684eb5c19f8f400) kprobes.c (0566fa760d235c119cef92119efc3ab11486a08a)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Kernel Probes (KProbes)
4 *
5 * Copyright (C) IBM Corporation, 2002, 2004
6 *
7 * 2002-Oct Created by Vamsi Krishna S <vamsi_krishna@in.ibm.com> Kernel
8 * Probes initial implementation ( includes contributions from

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

124{
125 int ret = 0;
126 struct kprobe *prev;
127 struct ppc_inst insn = ppc_inst_read(p->addr);
128
129 if ((unsigned long)p->addr & 0x03) {
130 printk("Attempt to register kprobe at an unaligned address\n");
131 ret = -EINVAL;
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Kernel Probes (KProbes)
4 *
5 * Copyright (C) IBM Corporation, 2002, 2004
6 *
7 * 2002-Oct Created by Vamsi Krishna S <vamsi_krishna@in.ibm.com> Kernel
8 * Probes initial implementation ( includes contributions from

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

124{
125 int ret = 0;
126 struct kprobe *prev;
127 struct ppc_inst insn = ppc_inst_read(p->addr);
128
129 if ((unsigned long)p->addr & 0x03) {
130 printk("Attempt to register kprobe at an unaligned address\n");
131 ret = -EINVAL;
132 } else if (IS_MTMSRD(insn) || IS_RFID(insn) || IS_RFI(insn)) {
133 printk("Cannot register a kprobe on rfi/rfid or mtmsr[d]\n");
132 } else if (IS_MTMSRD(insn) || IS_RFID(insn)) {
133 printk("Cannot register a kprobe on mtmsr[d]/rfi[d]\n");
134 ret = -EINVAL;
135 } else if ((unsigned long)p->addr & ~PAGE_MASK &&
136 ppc_inst_prefixed(ppc_inst_read(p->addr - 1))) {
137 printk("Cannot register a kprobe on the second word of prefixed instruction\n");
138 ret = -EINVAL;
139 }
140 preempt_disable();
141 prev = get_kprobe(p->addr - 1);

--- 448 unchanged lines hidden ---
134 ret = -EINVAL;
135 } else if ((unsigned long)p->addr & ~PAGE_MASK &&
136 ppc_inst_prefixed(ppc_inst_read(p->addr - 1))) {
137 printk("Cannot register a kprobe on the second word of prefixed instruction\n");
138 ret = -EINVAL;
139 }
140 preempt_disable();
141 prev = get_kprobe(p->addr - 1);

--- 448 unchanged lines hidden ---