This is called with interrupts disabled, there's no point in using
get_cpu() and per_cpu().
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Daniel Thompson <daniel.thompson@linaro.org>
Link: https://lore.kernel.org/r/20200902133201.292906672@infradead.org
*/
static int hw_breakpoint_handler(struct die_args *args)
{
*/
static int hw_breakpoint_handler(struct die_args *args)
{
- int i, cpu, rc = NOTIFY_STOP;
+ int i, rc = NOTIFY_STOP;
struct perf_event *bp;
unsigned long dr6;
unsigned long *dr6_p;
struct perf_event *bp;
unsigned long dr6;
unsigned long *dr6_p;
- * Assert that local interrupts are disabled
* Reset the DRn bits in the virtualized register value.
* The ptrace trigger routine will add in whatever is needed.
*/
current->thread.debugreg6 &= ~DR_TRAP_BITS;
* Reset the DRn bits in the virtualized register value.
* The ptrace trigger routine will add in whatever is needed.
*/
current->thread.debugreg6 &= ~DR_TRAP_BITS;
/* Handle all the breakpoints that were triggered */
for (i = 0; i < HBP_NUM; ++i) {
/* Handle all the breakpoints that were triggered */
for (i = 0; i < HBP_NUM; ++i) {
- bp = per_cpu(bp_per_reg[i], cpu);
+ bp = this_cpu_read(bp_per_reg[i]);
/*
* Reset the 'i'th TRAP bit in dr6 to denote completion of
* exception handling
/*
* Reset the 'i'th TRAP bit in dr6 to denote completion of
* exception handling
(dr6 & (~DR_TRAP_BITS)))
rc = NOTIFY_DONE;
(dr6 & (~DR_TRAP_BITS)))
rc = NOTIFY_DONE;