[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140905100002.GJ13515@arm.com>
Date: Fri, 5 Sep 2014 11:00:02 +0100
From: Will Deacon <will.deacon@....com>
To: AKASHI Takahiro <takahiro.akashi@...aro.org>
Cc: Catalin Marinas <Catalin.Marinas@....com>,
"dsaxena@...aro.org" <dsaxena@...aro.org>,
"Vijaya.Kumar@...iumnetworks.com" <Vijaya.Kumar@...iumnetworks.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linaro-kernel@...ts.linaro.org" <linaro-kernel@...ts.linaro.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] arm64: kgdb: fix single stepping
On Fri, Sep 05, 2014 at 10:47:43AM +0100, AKASHI Takahiro wrote:
> I tried to verify kgdb in vanilla kernel on fast model, but it seems that
> the single stepping with kgdb doesn't work correctly since its first
> appearance at v3.15.
>
> On v3.15, 'stepi' command after breaking the kernel at some breakpoint
> steps forward to the next instruction, but the succeeding 'stepi' never
> goes beyond that.
> On v3.16, 'stepi' moves forward to the second instruction just after call of
> do_debug_execption() in el1_dbg, and never goes beyond that. This variance
> of behavior seems to come in with the following patch in v3.16:
>
> commit 2a2830703a23 ("arm64: debug: avoid accessing mdscr_el1 on fault
> paths where possible")
I don't think you should worry about this change -- from what you're saying,
the code has never worked.
> diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
> index 5901480..a345973 100644
> --- a/arch/arm64/include/asm/assembler.h
> +++ b/arch/arm64/include/asm/assembler.h
> @@ -87,6 +87,13 @@
> 9990:
> .endm
>
> + .macro enable_dbg_if_not_stepping, tmp
> + mrs \tmp, mdscr_el1
> + tbnz \tmp, #0, 9990f
> + enable_dbg
> +9990:
> + .endm
We really don't want to bring this back, as it makes KVM guests extremely
slow (the mdscr access traps to the hypervisor).
It sounds more to me like kgdb is expecting step to remain active, but
that's not the case unless you explicit rewind the state machine (like we do
for ptrace). Can you try issuing the call to set_regs_spsr_ss in
single_step_handler, even when the step hook claims to have handled the
exception?
Will
--
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