<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Kazu</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Just removed redundant commit log message in the previous patch:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
0001-arm64-Support-overflow-stack-panic-v6.patch<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hong</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Hong YANG3 杨红 <hong.yang3@nio.com><br>
<b>Sent:</b> Monday, November 22, 2021 18:40<br>
<b>To:</b> HAGIO KAZUHITO(萩尾 一仁) <k-hagio-ab@nec.com><br>
<b>Cc:</b> Discussion list for crash utility usage, maintenance and development <crash-utility@redhat.com>; kazuhito.hagio@gmail.com <kazuhito.hagio@gmail.com><br>
<b>Subject:</b> Re: arm64: Support overflow stack panic</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hi Kazu</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Please help to review the squashed version of the patch.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thanks</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hong</div>
<div id="x_appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> HAGIO KAZUHITO(萩尾 一仁) <k-hagio-ab@nec.com><br>
<b>Sent:</b> Monday, November 22, 2021 8:00<br>
<b>To:</b> Hong YANG3 杨红 <hong.yang3@nio.com><br>
<b>Cc:</b> Discussion list for crash utility usage, maintenance and development <crash-utility@redhat.com>; kazuhito.hagio@gmail.com <kazuhito.hagio@gmail.com><br>
<b>Subject:</b> RE: arm64: Support overflow stack panic</font>
<div> </div>
</div>
<div class="x_BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="x_PlainText">注意:此封邮件来自于公司外部,请注意信息安全!<br>
Attention: This email comes from outside of the company, please pay attention to the information security!<br>
<br>
-----Original Message-----<br>
> Hi Kazu<br>
><br>
> Thanks for your time to review the patches and all the detailed comments, the 3rd patch attached with all<br>
> the refinement.<br>
<br>
Thanks, it looks good.<br>
<br>
><br>
> By the way, do I need to squash all the 3 patches as one before them get accepted?<br>
<br>
yes, that'll be better.<br>
<br>
Thanks,<br>
Kazu<br>
<br>
><br>
> Thanks<br>
> Hong<br>
> ________________________________<br>
><br>
> From: HAGIO KAZUHITO(萩尾 一仁) <k-hagio-ab@nec.com><br>
> Sent: Friday, November 19, 2021 16:21<br>
> To: Hong Yang3 杨红 <hong.yang3@nio.com><br>
> Cc: Discussion list for crash utility usage, maintenance and development <crash-utility@redhat.com><br>
> Subject: RE: arm64: Support overflow stack panic<br>
><br>
> 注意:此封邮件来自于公司外部,请注意信息安全!<br>
> Attention: This email comes from outside of the company, please pay attention to the information security!<br>
><br>
> Hi Hong,<br>
><br>
> Thanks for the refinement.<br>
><br>
> > +     if (symbol_exists("overflow_stack") &&<br>
> > +         (sp = per_cpu_symbol_search("overflow_stack")) &&<br>
> > +         get_symbol_type("overflow_stack", NULL, req)) {<br>
> > +             if (CRASHDEBUG(1)) {<br>
> > +                     fprintf(fp, "overflow_stack: \n");<br>
> > +                     fprintf(fp, "  type: %x, %s\n",<br>
> > +                             (int)req->typecode,<br>
> > +                             (req->typecode == TYPE_CODE_PTR) ?<br>
> > +                                             "TYPE_CODE_PTR" : "other");<br>
><br>
> Given that overflow_stack is array, TYPE_CODE_ARRAY would be better.<br>
><br>
> > @@ -2673,6 +2724,12 @@ arm64_back_trace_cmd(struct bt_info *bt)<br>
> >                       bt->hp->eip : GET_STACK_ULONG(bt->hp->esp);<br>
> >               stackframe.sp = bt->hp->esp + 8;<br>
> >               bt->flags &= ~BT_REGS_NOT_FOUND;<br>
> > +     } else if (arm64_on_overflow_stack(bt->tc->processor, bt->frameptr)) {<br>
> > +             arm64_set_overflow_stack(bt);<br>
> > +             bt->flags |= BT_OVERFLOW_STACK;<br>
><br>
> I would prefer to place this into the else block below<br>
><br>
> > +             stackframe.sp = bt->stkptr;<br>
> > +             stackframe.pc = bt->instptr;<br>
> > +             stackframe.fp = bt->frameptr;<br>
><br>
> then we can remove these three lines.<br>
><br>
> >       } else {<br>
> >               if (arm64_on_irq_stack(bt->tc->processor, bt->frameptr)) {<br>
> >                       arm64_set_irq_stack(bt);<br>
><br>
> > +static int<br>
> > +arm64_in_alternate_stack(int cpu, ulong stkptr)<br>
> > +{<br>
> > +     struct machine_specific *ms = machdep->machspec;<br>
> > +<br>
> > +     return arm64_in_alternate_stackv(cpu, stkptr,<br>
> > +                     ms->irq_stacks, ms->irq_stack_size);<br>
> > +}<br>
><br>
> Given that in_alternate_stack() should check if it's in non-process stacks,<br>
> I think we should check also for overflow_stacks here.  So how about making<br>
> these function like this?<br>
><br>
> arm64_in_alternate_stack<br>
>   arm64_on_irq_stack<br>
>   arm64_on_overflow_stack<br>
><br>
> arm64_on_irq_stack<br>
>   arm64_in_alternate_stackv(irq_stacks)<br>
><br>
> arm64_on_overflow_stack<br>
>   arm64_in_alternate_stackv(overflow_stacks)<br>
><br>
> Thanks,<br>
> Kazu<br>
><br>
> -----Original Message-----<br>
> > Hi Kazu<br>
> ><br>
> > Here are the latest patches for supporting to run bt command against a core dump with kernel stack overflow<br>
> > exception for arm64.<br>
> ><br>
> > Please help to review and advise if any further change needed.<br>
> ><br>
> > Tested bt command with options:<br>
> ><br>
> > bt<br>
> > bt -a<br>
> > bt -c 3<br>
> ><br>
> > By the way, 'mach' command also updated to show overflow stacks info as same as IRQ stacks.<br>
> ><br>
> > Thanks<br>
> > Hong<br>
> > ________________________________<br>
> ><br>
> > From: HAGIO KAZUHITO(萩尾 一仁) <k-hagio-ab@nec.com><br>
> > Sent: Wednesday, November 17, 2021 15:23<br>
> > To: Hong Yang3 杨红 <hong.yang3@nio.com><br>
> > Cc: Discussion list for crash utility usage, maintenance and development <crash-utility@redhat.com><br>
> > Subject: RE: arm64: Support overflow stack panic<br>
> ><br>
> > 注意:此封邮件来自于公司外部,请注意信息安全!<br>
> > Attention: This email comes from outside of the company, please pay attention to the information security!<br>
> ><br>
> > Hi Hong,<br>
> ><br>
> > Thank you for the patch and sending it to this list.<br>
> ><br>
> > -----Original Message-----<br>
> > > Hi Crash<br>
> > ><br>
> > > I'll keep refining the patch before it get approved:<br>
> ><br>
> > OK, so we will wait for the refined patch.<br>
> ><br>
> > Thanks,<br>
> > Kazu<br>
> ><br>
> > ><br>
> > ><br>
> > > 1.    Fix the error in arm64_overflow_stack_init() which saved the overflow stack address into<br>
> > > ms->irqstacks[], which would cause bt command crash on other cpus. The normal IRQ stacks should be used<br>
> > > for bt command for other cpus.<br>
> > > 2.    In addition to unwind on the overflow stack, try to go through the IRQ stack to find more useful<br>
> > > information<br>
> > ><br>
> > > Kernel stack overflow case would be rarely but I'd like to sharp the crash to cover this kind of issue.<br>
> > ><br>
> > > Best regards<br>
> > > Hong<br>
> > > ________________________________<br>
> > ><br>
> > > From: Hong Yang3 杨红<br>
> > > Sent: Tuesday, November 16, 2021 9:55<br>
> > > To: crash-utility@redhat.com <crash-utility@redhat.com><br>
> > > Subject: arm64: Support overflow stack panic<br>
> > ><br>
> > > Hi All<br>
> > ><br>
> > > When I was trying to open a core of an overflow stack panic result, the bt command caused a segment<br>
> fault,<br>
> > > after a while I figured out the overflow stack is not supported by crash utility.<br>
> > ><br>
> > > This patch is trying to initialize the overflow stack information on startup stage, and the bt command<br>
> > works<br>
> > > as expected to dump the correct call trace in the overflow stack, currently  it only apply to arm64<br>
> target.<br>
> > ><br>
> > > I'm not sure if any other sub command also need to be fixed for full support for the overflow stack,<br>
> please<br>
> > > advise and I'll try to improve the patch.<br>
> > ><br>
> > > Thanks<br>
> > > Hong YANG<br>
><br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>