Re: [PATCH v5] Fix INT1 Recursion with unregistered breakpoints

From: Jeff Merkey
Date: Sat Dec 19 2015 - 22:16:18 EST


> /*
> + * Check if we got an execute breakpoint, if so
> + * set the resume flag to avoid int1 recursion.
> + */
> + if ((dr7 & (DR_RW_MASK << ((i * DR_CONTROL_SIZE) +
> + DR_CONTROL_SHIFT))) == DR_RW_EXECUTE)
> + args->regs->flags |= X86_EFLAGS_RF;
> +
> + /*

This patch is functionaly correct but I still need to make it perfect.
I more try and test run.
I tested this and it works, but I need to shift it the other way
(right) rather than (left) since DR_RW_EXECUTE is always 0 this will
always work but to be perfect I need to do:

if (((dr7 >> ((i * DR_CONTROL_SIZE) + DR_CONTROL_SHIFT)) & DR_RW_MASK)
== DR_RW_EXECUTE)

and that is perfect syntax.

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