mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "liwei (GF)" <liwei391@huawei.com>
To: Julien Thierry <julien.thierry@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Marc Zyngier <marc.zyngier@arm.com>, <rostedt@goodmis.org>
Cc: <mark.rutland@arm.com>, <suzuki.poulose@arm.com>,
	<catalin.marinas@arm.com>, <will.deacon@arm.com>,
	<linux@armlinux.org.uk>, <linux-kernel@vger.kernel.org>,
	<mingo@redhat.com>, <james.morse@arm.com>,
	<wanghaibin.wang@huawei.com>,
	<linux-arm-kernel@lists.infradead.org>, <guohanjun@huawei.com>,
	"huawei.libin@huawei.com >> libin 00196512"
	<huawei.libin@huawei.com>
Subject: Re: [RFC PATCH] irqchip/gic-v3: Make gic_handle_irq() notrace
Date: Wed, 3 Apr 2019 23:23:29 +0800	[thread overview]
Message-ID: <73ec5893-ae0e-64a4-a914-18a09059a5ce@huawei.com> (raw)
In-Reply-To: <aad77b33-7eb0-57a6-2d60-1cb717c1e1c7@arm.com>

Hi Julien,

On 2019/4/2 22:00, Julien Thierry wrote:
I meet this issue by coincidence before too.

> I finally found out what happens.
> 
> When using interrupt priority masking, at the begining of
> gic_handle_irq(), we are in this awkward state where we still have the I
> bit set and PMR unmasked (this is because we cannot ack the interrupt
> that was signaled if it has lower priority than the current priority mask).
> 
> To try and keep things simple, we decided that local_irq_*() would only
> deal with PMR (when using priority masking). With one additional case
> being that, if PSR.I is set when saving flags, we'd represent it in the
> form of a value of PMR (i.e. GIC_PRIO_IRQOFF), so that irqs_disabled()
> and such would still accurately state that no interrupt could happen in
> those sections. The assumption was that in the few sections were we are
> having the PSR.I set, we wouldn't care about having interrupts disabled
> with PSR.I or PMR. And now that assumption appears to be wrong:
I am confused of the logic of the save and restore here, why can't we do the
save & restore exactly?

> trace_graph_entry(), called at the begining of gic_handle_irq() when
> enabling the tracer, does use local_irq_save/restore(). The save
> operation returns flags GIC_PRIO_IRQOFF (because PSR.I is set when we
> enter gic_handle_irq() ). The restore operation will then proceed to
> mask PMR, once we get back to gic_handle_irq() we can't acknowledge the
> interrupt we just received...
> 
> The function tracer does not appear to save/restore flags on function
> entry (I saw save/restore operations in the stack tracer but for some
> reason couldn't get them to trigger the issue).
> 
> To confirm this, I checked with the following diff (which is not a fix,
> it is better to mark gic_handle_irq() as notrace if I don't find
> something more suitable).
> 
I am convinced a notrace marking here will walkaround this issue,but i am
afraid there is still some trouble like this else.
I send my modification to solve this issue just now, it is tested ok so far,
but i am not particularly sure, could you please have a look?

Thanks,
Wei


      reply	other threads:[~2019-04-03 15:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-29 13:23 Zenghui Yu
2019-03-29 13:58 ` Marc Zyngier
2019-03-29 14:53   ` Steven Rostedt
2019-03-29 15:35     ` Zenghui Yu
2019-03-29 15:45       ` Steven Rostedt
2019-03-29 16:19         ` Zenghui Yu
2019-03-29 15:02   ` Zenghui Yu
2019-04-02 14:00     ` Julien Thierry
2019-04-03 15:23       ` liwei (GF) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73ec5893-ae0e-64a4-a914-18a09059a5ce@huawei.com \
    --to=liwei391@huawei.com \
    --cc=catalin.marinas@arm.com \
    --cc=guohanjun@huawei.com \
    --cc=huawei.libin@huawei.com \
    --cc=james.morse@arm.com \
    --cc=julien.thierry@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=suzuki.poulose@arm.com \
    --cc=wanghaibin.wang@huawei.com \
    --cc=will.deacon@arm.com \
    --cc=yuzenghui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®