linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: dave.martin@linaro.org (Dave Martin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM: hyp: simplify __hyp_stub_install epilog
Date: Mon, 7 Jan 2013 13:49:06 +0000	[thread overview]
Message-ID: <20130107134906.GC2050@linaro.org> (raw)
In-Reply-To: <50EACD57.5000001@arm.com>

On Mon, Jan 07, 2013 at 01:27:51PM +0000, Marc Zyngier wrote:
> On 07/01/13 12:18, Dave Martin wrote:
> > On Fri, Jan 04, 2013 at 05:44:15PM +0000, Marc Zyngier wrote:
> >> __hyp_stub_install duplicates quite a bit of safe_svcmode_maskall
> >> by forcing the CPU back to SVC. This is unnecessary, as
> >> safe_svcmode_maskall is called just after.
> >>
> >> Furthermore, the way we build SPSR_hyp is buggy as we fail to mask
> >> the interrupts, leading to interesting behaviours on TC2 + UEFI.
> >>
> >> The fix is to simply remove this code and rely on safe_svcmode_maskall
> >> to do the right thing.
> >>
> >> Cc: Dave Martin <dave.martin@linaro.org>
> >> Reported-by: Harry Liebel <harry.liebel@arm.com>
> >> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> > 
> > Although there is clearly a bug here, it looks like interrupts will
> > promptly get masked afterwards due to save_svcmode_maskall.  This would
> > only fail if there is an interrupts asserted during this hazard ...?
> 
> That's exactly the failure case. It's been observed on TC2 with UEFI,
> where the secondaries are woken up with a SGI. When they get out of WFI,
> the interrupt is still pending. After reaching this code and doing an
> eret, the interrupt fires immediately, with deadly consequences.

Ah right.  In which case we also have good evidence that the proposed
fix fixes it.

Sounds good

Cheers
---Dave

  reply	other threads:[~2013-01-07 13:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-04 17:44 [PATCH 0/2] HYP boot mode fixes Marc Zyngier
2013-01-04 17:44 ` [PATCH 1/2] ARM: hyp: boot secondary CPUs through the right entry point Marc Zyngier
2013-01-07 12:26   ` Dave Martin
2013-01-04 17:44 ` [PATCH 2/2] ARM: hyp: simplify __hyp_stub_install epilog Marc Zyngier
2013-01-07 12:18   ` Dave Martin
2013-01-07 13:27     ` Marc Zyngier
2013-01-07 13:49       ` Dave Martin [this message]
2013-01-09 14:46 ` [PATCH 0/2] HYP boot mode fixes Will Deacon
2013-01-09 14:48   ` Marc Zyngier

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=20130107134906.GC2050@linaro.org \
    --to=dave.martin@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).