diff options
Diffstat (limited to 'arch/x86/kernel/step.c')
-rw-r--r-- | arch/x86/kernel/step.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/kernel/step.c b/arch/x86/kernel/step.c index 6a93b93f91f1..6732272e3479 100644 --- a/arch/x86/kernel/step.c +++ b/arch/x86/kernel/step.c | |||
@@ -5,12 +5,24 @@ | |||
5 | #include <linux/mm.h> | 5 | #include <linux/mm.h> |
6 | #include <linux/ptrace.h> | 6 | #include <linux/ptrace.h> |
7 | 7 | ||
8 | #ifdef CONFIG_X86_32 | ||
9 | static | ||
10 | #endif | ||
8 | unsigned long convert_rip_to_linear(struct task_struct *child, struct pt_regs *regs) | 11 | unsigned long convert_rip_to_linear(struct task_struct *child, struct pt_regs *regs) |
9 | { | 12 | { |
10 | unsigned long addr, seg; | 13 | unsigned long addr, seg; |
11 | 14 | ||
15 | #ifdef CONFIG_X86_64 | ||
12 | addr = regs->rip; | 16 | addr = regs->rip; |
13 | seg = regs->cs & 0xffff; | 17 | seg = regs->cs & 0xffff; |
18 | #else | ||
19 | addr = regs->eip; | ||
20 | seg = regs->xcs & 0xffff; | ||
21 | if (regs->eflags & X86_EFLAGS_VM) { | ||
22 | addr = (addr & 0xffff) + (seg << 4); | ||
23 | return addr; | ||
24 | } | ||
25 | #endif | ||
14 | 26 | ||
15 | /* | 27 | /* |
16 | * We'll assume that the code segments in the GDT | 28 | * We'll assume that the code segments in the GDT |
@@ -69,12 +81,14 @@ static int is_setting_trap_flag(struct task_struct *child, struct pt_regs *regs) | |||
69 | case 0xf0: case 0xf2: case 0xf3: | 81 | case 0xf0: case 0xf2: case 0xf3: |
70 | continue; | 82 | continue; |
71 | 83 | ||
84 | #ifdef CONFIG_X86_64 | ||
72 | case 0x40 ... 0x4f: | 85 | case 0x40 ... 0x4f: |
73 | if (regs->cs != __USER_CS) | 86 | if (regs->cs != __USER_CS) |
74 | /* 32-bit mode: register increment */ | 87 | /* 32-bit mode: register increment */ |
75 | return 0; | 88 | return 0; |
76 | /* 64-bit mode: REX prefix */ | 89 | /* 64-bit mode: REX prefix */ |
77 | continue; | 90 | continue; |
91 | #endif | ||
78 | 92 | ||
79 | /* CHECKME: f2, f3 */ | 93 | /* CHECKME: f2, f3 */ |
80 | 94 | ||