lkml.org 
[lkml]   [2010]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[Patch 1/2 v2] Clear reserved bits of DR6 in do_debug()
    Clear the reserved bits from the stored copy of debug status register (DR6).
    This will help easy bitwise operations.

    Signed-off-by: K.Prasad <prasad@linux.vnet.ibm.com>
    ---
    arch/x86/include/asm/debugreg.h | 3 +++
    arch/x86/kernel/traps.c | 3 +++
    2 files changed, 6 insertions(+)

    Index: linux-2.6-tip.bugfix_perf_hbkpt/arch/x86/include/asm/debugreg.h
    ===================================================================
    --- linux-2.6-tip.bugfix_perf_hbkpt.orig/arch/x86/include/asm/debugreg.h
    +++ linux-2.6-tip.bugfix_perf_hbkpt/arch/x86/include/asm/debugreg.h
    @@ -14,6 +14,9 @@
    which debugging register was responsible for the trap. The other bits
    are either reserved or not of interest to us. */

    +/* Define reserved bits in DR6 which are always set to 1 */
    +#define DR6_RESERVED (0xFFFF0FF0)
    +
    #define DR_TRAP0 (0x1) /* db0 */
    #define DR_TRAP1 (0x2) /* db1 */
    #define DR_TRAP2 (0x4) /* db2 */
    Index: linux-2.6-tip.bugfix_perf_hbkpt/arch/x86/kernel/traps.c
    ===================================================================
    --- linux-2.6-tip.bugfix_perf_hbkpt.orig/arch/x86/kernel/traps.c
    +++ linux-2.6-tip.bugfix_perf_hbkpt/arch/x86/kernel/traps.c
    @@ -534,6 +534,9 @@ dotraplinkage void __kprobes do_debug(st

    get_debugreg(dr6, 6);

    + /* Filter out all the reserved bits which are preset to 1 */
    + dr6 &= ~DR6_RESERVED;
    +
    /* Catch kmemcheck conditions first of all! */
    if ((dr6 & DR_STEP) && kmemcheck_trap(regs))
    return;


    \
     
     \ /
      Last update: 2010-01-28 12:17    [W:0.020 / U:63.956 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site