aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/step.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/step.c')
-rw-r--r--arch/x86/kernel/step.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/arch/x86/kernel/step.c b/arch/x86/kernel/step.c
index cf4b9dac4a05..f55c003f5b63 100644
--- a/arch/x86/kernel/step.c
+++ b/arch/x86/kernel/step.c
@@ -12,17 +12,12 @@ unsigned long convert_rip_to_linear(struct task_struct *child, struct pt_regs *r
12{ 12{
13 unsigned long addr, seg; 13 unsigned long addr, seg;
14 14
15#ifdef CONFIG_X86_64 15 addr = regs->ip;
16 addr = regs->rip;
17 seg = regs->cs & 0xffff; 16 seg = regs->cs & 0xffff;
18#else 17 if (v8086_mode(regs)) {
19 addr = regs->eip;
20 seg = regs->xcs & 0xffff;
21 if (regs->eflags & X86_EFLAGS_VM) {
22 addr = (addr & 0xffff) + (seg << 4); 18 addr = (addr & 0xffff) + (seg << 4);
23 return addr; 19 return addr;
24 } 20 }
25#endif
26 21
27 /* 22 /*
28 * We'll assume that the code segments in the GDT 23 * We'll assume that the code segments in the GDT
@@ -124,11 +119,11 @@ static int enable_single_step(struct task_struct *child)
124 /* 119 /*
125 * If TF was already set, don't do anything else 120 * If TF was already set, don't do anything else
126 */ 121 */
127 if (regs->eflags & X86_EFLAGS_TF) 122 if (regs->flags & X86_EFLAGS_TF)
128 return 0; 123 return 0;
129 124
130 /* Set TF on the kernel stack.. */ 125 /* Set TF on the kernel stack.. */
131 regs->eflags |= X86_EFLAGS_TF; 126 regs->flags |= X86_EFLAGS_TF;
132 127
133 /* 128 /*
134 * ..but if TF is changed by the instruction we will trace, 129 * ..but if TF is changed by the instruction we will trace,
@@ -203,5 +198,5 @@ void user_disable_single_step(struct task_struct *child)
203 198
204 /* But touch TF only if it was set by us.. */ 199 /* But touch TF only if it was set by us.. */
205 if (test_and_clear_tsk_thread_flag(child, TIF_FORCED_TF)) 200 if (test_and_clear_tsk_thread_flag(child, TIF_FORCED_TF))
206 task_pt_regs(child)->eflags &= ~X86_EFLAGS_TF; 201 task_pt_regs(child)->flags &= ~X86_EFLAGS_TF;
207} 202}