[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <546EBF70.9020706@linaro.org>
Date: Thu, 20 Nov 2014 23:28:32 -0500
From: David Long <dave.long@...aro.org>
To: "Jon Medhurst (Tixy)" <tixy@...aro.org>
CC: linux-arm-kernel@...ts.infradead.org,
Russell King <linux@....linux.org.uk>,
Sandeepa Prabhu <sandeepa.prabhu@...aro.org>,
William Cohen <wcohen@...hat.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Anil S Keshavamurthy <anil.s.keshavamurthy@...el.com>,
davem@...emloft.net, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/5] arm64: Kprobes with single stepping support
On 11/18/14 08:28, Jon Medhurst (Tixy) wrote:
> On Tue, 2014-11-18 at 01:32 -0500, David Long wrote:
>> From: Sandeepa Prabhu <sandeepa.prabhu@...aro.org>
>>
>> Add support for basic kernel probes(kprobes) and jump probes
>> (jprobes) for ARM64.
>>
>> Kprobes will utilize software breakpoint and single step debug
>> exceptions supported on ARM v8.
>>
>> software breakpoint is placed at the probe address to trap the
>> kernel execution into kprobe handler.
>>
>> ARM v8 support single stepping to be enabled while exception return
>> (ERET) with next PC in exception return address (ELR_EL1).
>> kprobe handler prepares a executable memory slot for out-of-line
>> execution with the copy of the original instruction under probe, and
>> enable single stepping from the instruction slot. With this scheme,
>> the instruction is executed with the exact same register context
>> 'except PC' that points to instruction slot.
>>
>> Debug mask(PSTATE.D) is enabled only when single stepping a recursive
>> kprobes i.e. during kprobes reenter so that probes instruction can be
>> single stepped within the kprobe handler -exception- context.
>
> Does this mean that at the point the probed instruction is
> single-stepped there is nothing extra that has been pushed on on the
> kernel stack by any kprobes handling code? I just want to check that you
> aren't going to hit the problems that the 32-bit kprobes code is
> currently being fixed for [1].
>
> The simulated instructions in patch 2 don't access the stack, so they
> are safe from the problem.
>
> [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-November/303525.html
>
Took me a while to read through the background on this. I believe it is
true nothing extra is put on the stack in the single-step case.
-dl
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists