public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: Christoffer Dall <christoffer.dall@linaro.org>
Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org
Subject: Re: [PATCH 17/17] arm: vectors support
Date: Tue, 4 Feb 2014 08:12:03 +0100	[thread overview]
Message-ID: <20140204071202.GA24399@hawk.usersys.redhat.com> (raw)
In-Reply-To: <20140203211926.GK4167@cbox>

On Mon, Feb 03, 2014 at 01:19:26PM -0800, Christoffer Dall wrote:
> On Mon, Feb 03, 2014 at 05:50:20PM +0100, Andrew Jones wrote:
> > On Sat, Feb 01, 2014 at 06:29:27PM -0800, Christoffer Dall wrote:
> > > On Tue, Jan 21, 2014 at 05:22:03PM +0100, Andrew Jones wrote:
> > > > Add support for tests to use exception handlers.
> > > > 
> > > > v2 -> v3:
> > > > - squashed in 'arm: Simplify exceptions_init in cstart.S' from
> > > >   Christoffer Dall
> > > > - suggested function name changes and comment additions [Christoffer Dall]
> > > > - fix a bug with stack restore from usr mode exceptions that Christoffer
> > > >   pointed out. Add a get_sp() accessor too.
> > > 
> > > hmmm, how did you address this, the only change I can see is using r6
> > > instead of r2, which I'm not sure how changes anything.
> > 
> > It also adds
> > 
> > 	/* make sure we restore sp_svc and lr_svc on mode change */
> > 	str	r6, [sp, #S_SP]
> > 	str	lr, [sp, #S_LR]
> > 
> > lower down. Needed to switch to r6 from r2 for that
> > 
> > > 
> > > The problem is that your ldmia is replacing the usr sp, not the svc sp,
> > > so maybe you need to do ldmia sp!, [ r0 - pc ]^ (don't remember if that
> > > particular combination works) or you need to do something more fancy...
> > 
> > I'm not sure about the magic ! + ^ stuff, but what I've done does fix
> > the problem. I tested before/after the fix (actually that's why I also
> > added the get_sp).
> > 
> 
> Ah, I know, my original comment was wrong, what you were in fact doing
> was restoring the user sp to the svc reg, the write to the CPSR from the
> SPSR happens after restoring all the other regs (except the PC)
> according to the ldm exception return pseudocode.
> 
> ok, I think it's correct now, except for the bit about the lr, see
> below.

I agree the lr restore is unnecessary, and I didn't test anything related
to that. I threw it in to balance the switch to sp_usr,lr_usr above, but
can replace that balancing with a comment instead.

  reply	other threads:[~2014-02-04  7:12 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-21 16:21 [PATCH 00/17] kvm-unit-tests/arm: initial drop Andrew Jones
2014-01-21 16:21 ` [PATCH 01/17] remove unused files Andrew Jones
2014-01-21 16:21 ` [PATCH 02/17] makefile and run_tests tweaks Andrew Jones
2014-01-21 16:21 ` [PATCH 03/17] clean root dir of all x86-ness Andrew Jones
2014-01-21 16:21 ` [PATCH 04/17] gitignore: Ignore more Andrew Jones
2014-01-21 16:21 ` [PATCH 05/17] add 'make cscope' support Andrew Jones
2014-02-02  2:22   ` Christoffer Dall
2014-02-03 13:25     ` Andrew Jones
2014-01-21 16:21 ` [PATCH 06/17] Add halt() and some error codes Andrew Jones
2014-02-02  2:23   ` Christoffer Dall
2014-01-21 16:21 ` [PATCH 07/17] move x86's simple heap management to common code Andrew Jones
2014-02-02  2:23   ` Christoffer Dall
2014-01-21 16:21 ` [PATCH 08/17] Introduce libio to common code for io read/write Andrew Jones
2014-02-02  2:24   ` Christoffer Dall
2014-02-03 13:51     ` Andrew Jones
2014-02-03 16:30       ` Christoffer Dall
2014-01-21 16:21 ` [PATCH 10/17] libfdt: get libfdt to build Andrew Jones
2014-02-02  2:25   ` Christoffer Dall
2014-02-03 13:57     ` Andrew Jones
2014-01-21 16:21 ` [PATCH 11/17] add support for device trees Andrew Jones
2014-02-02  2:27   ` Christoffer Dall
2014-02-03 15:31     ` Andrew Jones
2014-02-03 16:36       ` Christoffer Dall
2014-01-21 16:21 ` [PATCH 12/17] Introduce virtio-testdev Andrew Jones
2014-02-02  2:27   ` Christoffer Dall
2014-02-03 15:44     ` Andrew Jones
2014-02-03 16:41       ` Christoffer Dall
2014-01-21 16:21 ` [PATCH 13/17] arm: initial drop Andrew Jones
2014-02-02  2:28   ` Christoffer Dall
2014-02-03 15:55     ` Andrew Jones
2014-01-21 16:22 ` [PATCH 14/17] arm: Add IO accessors to avoid register-writeback Andrew Jones
2014-01-21 16:22 ` [PATCH 15/17] printf: support field padding Andrew Jones
2014-02-02  2:28   ` Christoffer Dall
2014-01-21 16:22 ` [PATCH 16/17] arm: add useful headers from the linux kernel Andrew Jones
2014-02-02  2:29   ` Christoffer Dall
2014-02-03 16:46     ` Andrew Jones
2014-02-03 17:38       ` Christoffer Dall
2014-01-21 16:22 ` [PATCH 17/17] arm: vectors support Andrew Jones
2014-02-02  2:29   ` Christoffer Dall
2014-02-03 16:50     ` Andrew Jones
2014-02-03 21:19       ` Christoffer Dall
2014-02-04  7:12         ` Andrew Jones [this message]
     [not found] ` <CABWnSnPMc_CrH8N28TScBVvQmCk+XD-bVWvdmJAxxVczHsVx_g@mail.gmail.com>
2014-01-29 15:35   ` [PATCH 00/17] kvm-unit-tests/arm: initial drop Andrew Jones
2014-02-02  2:22 ` Christoffer Dall
2014-02-03 13:24   ` Andrew Jones
     [not found]     ` <CALxX4v-h+gOCZDukCnGK_GUQepu07KYw4BGjzjGNgA0SdDcLNw@mail.gmail.com>
2014-02-04  8:33       ` Andrew Jones
     [not found] ` <1390321323-1855-10-git-send-email-drjones@redhat.com>
2014-02-02  2:25   ` [PATCH 09/17] libfdt: Import libfdt source Christoffer Dall

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=20140204071202.GA24399@hawk.usersys.redhat.com \
    --to=drjones@redhat.com \
    --cc=christoffer.dall@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    /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