summaryrefslogtreecommitdiffstats
path: root/runtime/uprobes/uprobes_i386.c
diff options
context:
space:
mode:
authorkenistoj <kenistoj>2007-10-16 23:40:49 +0000
committerkenistoj <kenistoj>2007-10-16 23:40:49 +0000
commitde14b6dab7064616fe2828c7ead9cca6a48463ce (patch)
tree6b0afe6dede588b4ddd32e05c973ed9a5f07a6d5 /runtime/uprobes/uprobes_i386.c
parente3632368cea4bb761f90d001744f03b6b81f339e (diff)
downloadsystemtap-steved-de14b6dab7064616fe2828c7ead9cca6a48463ce.tar.gz
systemtap-steved-de14b6dab7064616fe2828c7ead9cca6a48463ce.tar.xz
systemtap-steved-de14b6dab7064616fe2828c7ead9cca6a48463ce.zip
* runtime/uprobes/uprobes.[ch], uprobes_i386.[ch],
uprobes_ppc64.h, uprobes_s390.h: Adjusted SLOT_IP and arch_validate_probed_insn to accept task pointer (needed by x86_64); added uprobe_probept_arch_info and uprobe_task_arch_info (ditto). * runtime/uprobes/uprobes_i386.c: Fixed a couple of glitches discovered when porting to x86_64
Diffstat (limited to 'runtime/uprobes/uprobes_i386.c')
-rw-r--r--runtime/uprobes/uprobes_i386.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/runtime/uprobes/uprobes_i386.c b/runtime/uprobes/uprobes_i386.c
index 21420681..5fe7d781 100644
--- a/runtime/uprobes/uprobes_i386.c
+++ b/runtime/uprobes/uprobes_i386.c
@@ -69,8 +69,8 @@
W(0x80, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)| /* 80 */
W(0x90, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1), /* 90 */
W(0xa0, 1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,1)| /* a0 */
- W(0xb0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1), /* b0 */
- W(0xc0, 1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1)| /* c0 */
+ W(0xb0, 1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1), /* b0 */
+ W(0xc0, 1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1)| /* c0 */
W(0xd0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), /* d0 */
W(0xe0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)| /* e0 */
W(0xf0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) /* f0 */
@@ -80,10 +80,8 @@
/*
* TODO:
- * - Allow valid 2-byte opcodes (first byte = 0x0f).
- * - Where necessary, examine the modrm byte and allow valid instructions
+ * - Where necessary, examine the modrm byte and allow only valid instructions
* in the different Groups and fpu instructions.
- * - Allow at least some instruction prefixes.
* - Note: If we go past the first byte, do we need to verify that
* subsequent bytes were actually there, rather than off the last page?
* Probably overkill. We don't verify that they specified the first byte
@@ -104,12 +102,11 @@
* fa, fb - cli, sti
*
* opcodes we may need to refine support for:
- * 0f - valid 2-byte opcodes
* 66 - data16 prefix
* 8f - Group 1 - only reg = 0 is OK
* c6-c7 - Group 11 - only reg = 0 is OK
* d9-df - fpu insns with some illegal encodings
- * fe - Group 4 - only reg = 1 or 2 is OK
+ * fe - Group 4 - only reg = 0 or 1 is OK
* ff - Group 5 - only reg = 0-6 is OK
*
* others -- Do we need to support these?
@@ -123,7 +120,8 @@
*/
static
-int arch_validate_probed_insn(struct uprobe_probept *ppt)
+int arch_validate_probed_insn(struct uprobe_probept *ppt,
+ struct task_struct *tsk)
{
uprobe_opcode_t *insn = ppt->insn;
@@ -138,9 +136,9 @@ int arch_validate_probed_insn(struct uprobe_probept *ppt)
printk(KERN_ERR "uprobes does not currently support probing "
"instructions with the 2-byte opcode 0x0f 0x%2.2x\n",
insn[1]);
- }
- printk(KERN_ERR "uprobes does not currently support probing "
- "instructions whose first byte is 0x%2.2x\n", insn[0]);
+ } else
+ printk(KERN_ERR "uprobes does not currently support probing "
+ "instructions whose first byte is 0x%2.2x\n", insn[0]);
return -EPERM;
}