%%db6 register still not saved 2.2.16 (x86)

From: James Cownie (jcownie@etnus.com)
Date: Mon Jun 12 2000 - 07:33:07 EST


Guys,

I see you all discussing changes in the ptrace interface for x86
extended FP register support, so I hope you're the right people for
this...

There's still an outstanding bug in the 2.2. series (all of them)
which is that debug register 6 (the debug status register) is never
saved back into the tss as it should be.

This means that a debugger can never detect from the debug status
register that a data watch point has been hit.

This was reported (with a patch) back in December 1999 (see below).

Any chance that the (one line) fix will ever make it into the kernel ?
(Or any reason why it shouldn't ? It's one store instruction on a
debug trap, and it's _needed_).

2.0 series kernels got this right :-)

Keep up the good work.

-- Jim

James Cownie <jcownie@etnus.com>
Etnus, Inc. +44 117 9071438
http://www.etnus.com

PATCH: saving i386 debug register on debug traps

Eric Pouech (Eric.Pouech@wanadoo.fr)
Thu, 09 Dec 1999 20:57:11 +0000

This is a multi-part message in MIME format.
--------------61AA24BAC20342151375201C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

since 2.1.0 (!), the DR6 value was not saved on debug traps, so
not allowing to know which DR0-3 did trigger a trap (if any)

this patch (against 2.2.13) should solve this issue

A+

-- 
---------------
Eric Pouech (http://perso.wanadoo.fr/eric.pouech/)
"The future will be better tomorrow", Vice President Dan Quayle
--------------61AA24BAC20342151375201C
Content-Type: text/plain; charset=us-ascii;
 name="dr6.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="dr6.diff"

--- traps.c.orig Thu Dec 9 21:39:40 1999 +++ traps.c Thu Dec 9 21:49:13 1999 @@ -354,10 +354,11 @@ unsigned int condition; struct task_struct *tsk = current; + __asm__ __volatile__("movl %%db6,%0" : "=r" (condition)); + tsk->tss.debugreg[6] = condition; + if (regs->eflags & VM_MASK) goto debug_vm86; - - __asm__ __volatile__("movl %%db6,%0" : "=r" (condition)); /* Mask out spurious TF errors due to lazy TF clearing */ if (condition & DR_STEP) {

--------------61AA24BAC20342151375201C--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:25 EST