[prev in list] [next in list] [prev in thread] [next in thread]
List: linaro-kernel
Subject: Re: Re: [RFC v2] arm64: kgdb: fix single stepping
From: Gonghuan <gonghuan () huawei ! com>
Date: 2016-03-29 11:12:02
Message-ID: B9606315197F714496352CF9DAE0E33F830CDB37 () SZXEMA502-MBS ! china ! huawei ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
[Attachment #4 (text/plain)]
Hi Will
I have used Takahiro's patch to fix the single stepping problem of KGDB
on arm64. We had real hardware called Hi1610. The problem I had is
exactly the same as the description of Takahiro. We are working on
kernel4.1.
But It seems that the single stepping with kgdb doesn¡¯t work correctly,
'stepi' moves forward and stops at the next instruction just
after enable_dbg in el1_dbg, and never goes beyond that.
I want to know if anyone fix the issues already ?
The patch is like follows:
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi at \
> > linaro.org<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>>
> > ---
> > arch/arm64/kernel/kgdb.c | 60
> > +++++++++++++++++++++++++++++++++++-----------
> > 1 file changed, 46 insertions(+), 14 deletions(-)
> >
> > diff --git a/arch/arm64/kernel/kgdb.c b/arch/arm64/kernel/kgdb.c
> > index a0d10c5..81b5910 100644
> > --- a/arch/arm64/kernel/kgdb.c
> > +++ b/arch/arm64/kernel/kgdb.c
> > @@ -19,9 +19,13 @@
> > * along with this program. If not, see
> > <http://www.gnu.org/licenses/>.
> > */
> >
> > +#include <linux/cpumask.h>
> > #include <linux/irq.h>
> > +#include <linux/irq_work.h>
> > #include <linux/kdebug.h>
> > #include <linux/kgdb.h>
> > +#include <linux/percpu.h>
> > +#include <asm/ptrace.h>
> > #include <asm/traps.h>
> >
> > struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] = {
> > @@ -95,6 +99,9 @@ struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] = {
> > { "fpcr", 4, -1 },
> > };
> >
> > +static DEFINE_PER_CPU(unsigned int, kgdb_pstate);
> > +static DEFINE_PER_CPU(struct irq_work, kgdb_irq_work);
> > +
> > char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs)
> > {
> > if (regno >= DBG_MAX_REG_NUM || regno < 0)
> > @@ -176,18 +183,14 @@ int kgdb_arch_handle_exception(int
> > exception_vector, int signo,
> > * over and over again.
> > */
> > kgdb_arch_update_addr(linux_regs, remcom_in_buffer);
> > - atomic_set(&kgdb_cpu_doing_single_step, -1);
> > - kgdb_single_step = 0;
> > -
> > - /*
> > - * Received continue command, disable single step
> > - */
> > - if (kernel_active_single_step())
> > - kernel_disable_single_step();
> >
> > err = 0;
> > break;
> > case 's':
> > + /* mask interrupts while single stepping */
> > + __this_cpu_write(kgdb_pstate, linux_regs->pstate);
> > + linux_regs->pstate |= PSR_I_BIT;
> > +
> > /*
> > * Update step address value with address passed
> > * with step packet.
> > @@ -198,8 +201,6 @@ int kgdb_arch_handle_exception(int
> > exception_vector, int signo,
> > */
> > kgdb_arch_update_addr(linux_regs, remcom_in_buffer);
> > atomic_set(&kgdb_cpu_doing_single_step,
> > raw_smp_processor_id());
> > - kgdb_single_step = 1;
> > -
> > /*
> > * Enable single step handling
> > */
> > @@ -229,6 +230,18 @@ static int kgdb_compiled_brk_fn(struct pt_regs
> > *regs, unsigned int esr)
> >
> > static int kgdb_step_brk_fn(struct pt_regs *regs, unsigned int esr)
> > {
> > + unsigned int pstate;
> > +
> > + kernel_disable_single_step();
> > + atomic_set(&kgdb_cpu_doing_single_step, -1);
> > +
> > + /* restore interrupt mask status */
> > + pstate = __this_cpu_read(kgdb_pstate);
> > + if (pstate & PSR_I_BIT)
> > + regs->pstate |= PSR_I_BIT;
> > + else
> > + regs->pstate &= ~PSR_I_BIT;
> > +
> > kgdb_handle_exception(1, SIGTRAP, 0, regs);
> > return 0;
> > }
> > @@ -249,16 +262,27 @@ static struct step_hook kgdb_step_hook = {
> > .fn = kgdb_step_brk_fn
> > };
> >
> > -static void kgdb_call_nmi_hook(void *ignored)
> > +static void kgdb_roundup_hook(struct irq_work *work)
> > {
> > kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
> > }
> >
> > void kgdb_roundup_cpus(unsigned long flags)
> > {
> > - local_irq_enable();
> > - smp_call_function(kgdb_call_nmi_hook, NULL, 0);
> > - local_irq_disable();
> > + int cpu;
> > + struct cpumask mask;
> > + struct irq_work *work;
> > +
> > + mask = *cpu_online_mask;
> > + cpumask_clear_cpu(smp_processor_id(), &mask);
> > + cpu = cpumask_first(&mask);
> > + if (cpu >= nr_cpu_ids)
> > + return;
> > +
> > + for_each_cpu(cpu, &mask) {
> > + work = per_cpu_ptr(&kgdb_irq_work, cpu);
> > + irq_work_queue_on(work, cpu);
> > + }
> > }
> >
> > static int __kgdb_notify(struct die_args *args, unsigned long cmd)
> > @@ -299,6 +323,8 @@ static struct notifier_block kgdb_notifier = {
> > int kgdb_arch_init(void)
> > {
> > int ret = register_die_notifier(&kgdb_notifier);
> > + int cpu;
> > + struct irq_work *work;
> >
> > if (ret != 0)
> > return ret;
> > @@ -306,6 +332,12 @@ int kgdb_arch_init(void)
> > register_break_hook(&kgdb_brkpt_hook);
> > register_break_hook(&kgdb_compiled_brkpt_hook);
> > register_step_hook(&kgdb_step_hook);
> > +
> > + for_each_possible_cpu(cpu) {
> > + work = per_cpu_ptr(&kgdb_irq_work, cpu);
> > + init_irq_work(work, kgdb_roundup_hook);
> > + }
> > +
> > return 0;
> > }
[˵Ã÷: cid:image001.jpg@01D0F098.2F20FA50]
Gong Huan 00194563
2012 Lab-Euler Dept 6
£¨Programming Technologies Lab£©
Mobile£º15372050534
Tel.£º057163165
Seat No.£ºHangzhou Research Center Z9-3-B01
Our hi3 group£ºhttp://3ms.huawei.com/hi/group/1502151
[Attachment #5 (text/html)]
<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:΢ÈíÑźÚ;
panose-1:2 11 5 3 2 2 4 2 2 4;}
@font-face
{font-family:"\@΢ÈíÑźÚ";
panose-1:2 11 5 3 2 2 4 2 2 4;}
@font-face
{font-family:"\@ËÎÌå";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Ô¤Éè¸ñʽ Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:ËÎÌå;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Åú×¢¿òÎı¾ Char";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:9.0pt;
font-family:"Calibri","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.Char
{mso-style-name:"Åú×¢¿òÎı¾ Char";
mso-style-priority:99;
mso-style-link:Åú×¢¿òÎı¾;}
span.HTMLChar
{mso-style-name:"HTML Ô¤Éè¸ñʽ Char";
mso-style-priority:99;
mso-style-link:"HTML Ô¤Éè¸ñʽ";
font-family:ËÎÌå;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
/* Page Definitions */
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ZH-CN" link="blue" vlink="purple" style="text-justify-trim:punctuation">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi Will<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I have used Takahiro's patch to fix the \
single stepping problem of KGDB<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">on arm64. We had real hardware called Hi1610. The problem I had \
is<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">exactly the same as \
the description of Takahiro. We are working on<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">kernel4.1.<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">But It seems that the single stepping with kgdb \
doesn¡¯t work correctly,<o:p></o:p></span></p> <p class="MsoNormal" align="left" \
style="text-align:left"><span lang="EN-US">'stepi' moves forward and stops at the \
next instruction just<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">after enable_dbg in el1_dbg, and never goes beyond \
that.<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"><o:p> </o:p></span></p> <p class="MsoNormal"><span lang="EN-US">I \
want to know if anyone fix the issues already ? <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The patch is like \
follows:<o:p></o:p></span></p> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
Signed-off-by: AKASHI Takahiro <<a \
href="http://lists.infradead.org/mailman/listinfo/linux-arm-kernel"><span \
style="color:windowtext;text-decoration:none">takahiro.akashi at \
linaro.org</span></a>><o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
---<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
arch/arm64/kernel/kgdb.c | 60<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+++++++++++++++++& \
#43;+++++++++++++++++-----------<o:p></o:p></span></pre>
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
1 file changed, 46 insertions(+), 14 deletions(-)<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>><o:p> </o:p></span></pre>
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
diff --git a/arch/arm64/kernel/kgdb.c \
b/arch/arm64/kernel/kgdb.c<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
index a0d10c5..81b5910 100644<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
--- a/arch/arm64/kernel/kgdb.c<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+++ b/arch/arm64/kernel/kgdb.c<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
@@ -19,9 +19,13 @@<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
* along with this program. If not, see<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
<<a href="http://www.gnu.org/licenses/"><span \
style="color:windowtext;text-decoration:none">http://www.gnu.org/licenses/</span></a>>.<o:p></o:p></span></pre>
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
*/<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>><o:p> </o:p></span></pre>
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+#include <linux/cpumask.h><o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
#include <linux/irq.h><o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+#include <linux/irq_work.h><o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
#include <linux/kdebug.h><o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
#include <linux/kgdb.h><o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+#include <linux/percpu.h><o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+#include <asm/ptrace.h><o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
#include <asm/traps.h><o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>><o:p> </o:p></span></pre>
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] = {<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
@@ -95,6 +99,9 @@ struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] = \
{<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
{ "fpcr", 4, -1 },<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
};<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>><o:p> </o:p></span></pre>
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+static DEFINE_PER_CPU(unsigned int, kgdb_pstate);<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+static DEFINE_PER_CPU(struct irq_work, kgdb_irq_work);<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs)<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
{<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
if (regno >= DBG_MAX_REG_NUM || regno < 0)<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
@@ -176,18 +183,14 @@ int kgdb_arch_handle_exception(int<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
exception_vector, int signo,<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
* over and over again.<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
*/<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
kgdb_arch_update_addr(linux_regs, remcom_in_buffer);<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
- \
atomic_set(&kgdb_cpu_doing_single_step, -1);<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
- kgdb_single_step = \
0;<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
-<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
- /*<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
- * Received continue command, \
disable single step<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
- */<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
- if \
(kernel_active_single_step())<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
- \
kernel_disable_single_step();<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>><o:p> </o:p></span></pre>
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
err = 0;<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
break;<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
case 's':<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ /* mask interrupts while single \
stepping */<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ __this_cpu_write(kgdb_pstate, \
linux_regs->pstate);<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ linux_regs->pstate |= \
PSR_I_BIT;<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
/*<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
* Update step address value with address passed<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif& \
quot;">>> * \
with step packet.<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
@@ -198,8 +201,6 @@ int kgdb_arch_handle_exception(int<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
exception_vector, int signo,<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
*/<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
kgdb_arch_update_addr(linux_regs, remcom_in_buffer);<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
atomic_set(&kgdb_cpu_doing_single_step,<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
raw_smp_processor_id());<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
- kgdb_single_step = \
1;<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
-<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
/*<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
* Enable single step handling<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
*/<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
@@ -229,6 +230,18 @@ static int kgdb_compiled_brk_fn(struct \
pt_regs<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
*regs, unsigned int esr)<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>><o:p> </o:p></span></pre>
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
static int kgdb_step_brk_fn(struct pt_regs *regs, unsigned int \
esr)<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
{<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ unsigned int pstate;<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ kernel_disable_single_step();<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ atomic_set(&kgdb_cpu_doing_single_step, \
-1);<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ /* restore interrupt mask status */<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ pstate = \
__this_cpu_read(kgdb_pstate);<o:p></o:p></span></pre> <pre><span lang="EN-US" \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ regs->pstate |= \
PSR_I_BIT;<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ else<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ regs->pstate &= \
~PSR_I_BIT;<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
kgdb_handle_exception(1, SIGTRAP, 0, regs);<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
return 0;<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
}<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
@@ -249,16 +262,27 @@ static struct step_hook kgdb_step_hook = \
{<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
.fn = \
kgdb_step_brk_fn<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
};<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>><o:p> </o:p></span></pre>
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
-static void kgdb_call_nmi_hook(void *ignored)<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+static void kgdb_roundup_hook(struct irq_work *work)<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
{<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
}<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>><o:p> </o:p></span></pre>
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
void kgdb_roundup_cpus(unsigned long flags)<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
{<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
- local_irq_enable();<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
- smp_call_function(kgdb_call_nmi_hook, NULL, \
0);<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
- local_irq_disable();<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ int cpu;<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ struct cpumask mask;<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ struct irq_work *work;<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ mask = *cpu_online_mask;<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ cpumask_clear_cpu(smp_processor_id(), \
&mask);<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ cpu = cpumask_first(&mask);<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ if (cpu >= nr_cpu_ids)<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ return;<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ for_each_cpu(cpu, &mask) {<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ work = \
per_cpu_ptr(&kgdb_irq_work, cpu);<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ irq_work_queue_on(work, \
cpu);<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ }<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
}<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>><o:p> </o:p></span></pre>
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
static int __kgdb_notify(struct die_args *args, unsigned long \
cmd)<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
@@ -299,6 +323,8 @@ static struct notifier_block kgdb_notifier = \
{<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
int kgdb_arch_init(void)<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
{<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
int ret = register_die_notifier(&kgdb_notifier);<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ int cpu;<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ struct irq_work *work;<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>><o:p> </o:p></span></pre>
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
if (ret != 0)<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
return ret;<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
@@ -306,6 +332,12 @@ int kgdb_arch_init(void)<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
register_break_hook(&kgdb_brkpt_hook);<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
register_break_hook(&kgdb_compiled_brkpt_hook);<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
register_step_hook(&kgdb_step_hook);<o:p></o:p></span></pre> <pre><span \
lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ for_each_possible_cpu(cpu) {<o:p></o:p></span></pre> \
<pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ work = \
per_cpu_ptr(&kgdb_irq_work, cpu);<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ init_irq_work(work, \
kgdb_roundup_hook);<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+ }<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
+<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
return 0;<o:p></o:p></span></pre> <pre><span lang="EN-US" \
style="font-size:10.5pt;font-family:"Calibri","sans-serif"">>> \
}<o:p></o:p></span></pre> <p class="MsoNormal"><span \
lang="EN-US"><o:p> </o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"><o:p> </o:p></span></p> <div align="right">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" \
style="border-collapse:collapse"> <tbody>
<tr>
<td width="236" valign="top" style="width:176.9pt;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US"><img border="0" width="200" height="200" \
id="ͼƬ_x0020_2" src="cid:image001.jpg@01D189EB.7A43AB30" alt="˵Ã÷: \
cid:image001.jpg@01D0F098.2F20FA50"></span><span lang="EN-US"><o:p></o:p></span></p> \
</td> <td width="284" valign="top" style="width:212.65pt;padding:0cm 5.4pt 0cm \
5.4pt"> <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:14.0pt;font-family:"΢ÈíÑźÚ","sans-serif";color:#2BB0E8">Gong \
Huan</span><span lang="EN-US"> <span \
style="color:#8C8A8A">00194563</span><o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="font-size:8.0pt;font-family:"΢ÈíÑźÚ","sans-serif";color:#8F8F8F">2012 \
Lab-Euler Dept 6<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:8.0pt;font-family:"΢ÈíÑźÚ","sans-serif";color:#8F8F8F">£¨<span \
lang="EN-US">Programming Technologies Lab</span>£©<span \
lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:8.0pt;font-family:"΢ÈíÑźÚ","sans-serif";color:#8F8F8F"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:8.0pt;font-family:"΢ÈíÑźÚ","sans-serif";color:#8F8F8F">Mobile</span><span \
style="font-size:8.0pt;font-family:"΢ÈíÑźÚ","sans-serif";color:#8F8F8F">£º<span \
lang="EN-US">15372050534<o:p></o:p></span></span></p> <p class="MsoNormal"><span \
lang="EN-US" style="font-size:8.0pt;font-family:"΢ÈíÑźÚ","sans-serif";color:#8F8F8F">Tel.</span><span \
style="font-size:8.0pt;font-family:"΢ÈíÑźÚ","sans-serif";color:#8F8F8F">£º<span \
lang="EN-US">057163165<o:p></o:p></span></span></p> <p class="MsoNormal"><span \
lang="EN-US" style="font-size:8.0pt;font-family:"΢ÈíÑźÚ","sans-serif";color:#8F8F8F">Seat \
No.</span><span style="font-size:8.0pt;font-family:"΢ÈíÑźÚ","sans-serif";color:#8F8F8F">£º<span \
lang="EN-US">Hangzhou Research Center Z9-3-B01</span></span><span \
lang="EN-US"><o:p></o:p></span></p> </td>
</tr>
<tr>
<td width="519" colspan="2" valign="top" \
style="width:389.55pt;background:#2BB0E8;padding:0cm 5.4pt 0cm 5.4pt"> <p \
class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" \
style="font-size:7.5pt;font-family:"΢ÈíÑźÚ","sans-serif";color:white">Our \
hi3 group</span><span \
style="font-size:7.5pt;font-family:"΢ÈíÑźÚ","sans-serif";color:white">£º</span><span \
lang="EN-US" style="font-family:"΢ÈíÑźÚ","sans-serif""><a \
href="http://3ms.huawei.com/hi/group/1502151"><span \
style="font-size:7.5pt;color:white">http://3ms.huawei.com/hi/group/1502151</span></a></span><span \
lang="EN-US" style="font-family:"΢ÈíÑźÚ","sans-serif""><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>
["image001.jpg" (image/jpeg)]
[Attachment #7 (unknown)]
_______________________________________________
linaro-kernel mailing list
linaro-kernel@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/linaro-kernel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic