All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"Tim (Xen.org)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH 4/5] xen: arm: reorder registers in struct cpu_user_regs.
Date: Tue, 18 Dec 2012 18:35:32 +0000	[thread overview]
Message-ID: <alpine.DEB.2.02.1212181835260.17523@kaball.uk.xensource.com> (raw)
In-Reply-To: <1355849376-26652-4-git-send-email-ian.campbell@citrix.com>

On Tue, 18 Dec 2012, Ian Campbell wrote:
> Primarily this is so that they are ordered in the same way as the
> mapping from arm64 x0..x31 registers to the arm32 registers, which is
> just less confusing for everyone going forward.
> 
> It also makes the implementation of select_user_regs in the next patch
> slightly simpler.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

>  xen/arch/arm/entry.S          |    4 ++--
>  xen/arch/arm/io.h             |    1 +
>  xen/arch/arm/traps.c          |    2 +-
>  xen/include/public/arch-arm.h |   11 +++++++----
>  4 files changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/xen/arch/arm/entry.S b/xen/arch/arm/entry.S
> index cbd1c48..3611427 100644
> --- a/xen/arch/arm/entry.S
> +++ b/xen/arch/arm/entry.S
> @@ -12,7 +12,7 @@
>          RESTORE_ONE_BANKED(SP_##mode) ; RESTORE_ONE_BANKED(LR_##mode) ; RESTORE_ONE_BANKED(SPSR_##mode)
>  
>  #define SAVE_ALL                                                        \
> -        sub sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */      \
> +        sub sp, #(UREGS_SP_usr - UREGS_sp); /* SP, LR, SPSR, PC */      \
>          push {r0-r12}; /* Save R0-R12 */                                \
>                                                                          \
>          mrs r11, ELR_hyp;               /* ELR_hyp is return address. */\
> @@ -115,7 +115,7 @@ ENTRY(return_to_hypervisor)
>          ldr r11, [sp, #UREGS_cpsr]
>          msr SPSR_hyp, r11
>          pop {r0-r12}
> -        add sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */
> +        add sp, #(UREGS_SP_usr - UREGS_sp); /* SP, LR, SPSR, PC */
>          eret
>  
>  /*
> diff --git a/xen/arch/arm/io.h b/xen/arch/arm/io.h
> index 9a507f5..0933aa8 100644
> --- a/xen/arch/arm/io.h
> +++ b/xen/arch/arm/io.h
> @@ -21,6 +21,7 @@
>  
>  #include <xen/lib.h>
>  #include <asm/processor.h>
> +#include <asm/regs.h>
>  
>  typedef struct
>  {
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index 19e2081..096dc0b 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -43,7 +43,7 @@
>   * stack) must be doubleword-aligned in size.  */
>  static inline void check_stack_alignment_constraints(void) {
>      BUILD_BUG_ON((sizeof (struct cpu_user_regs)) & 0x7);
> -    BUILD_BUG_ON((offsetof(struct cpu_user_regs, r8_fiq)) & 0x7);
> +    BUILD_BUG_ON((offsetof(struct cpu_user_regs, sp_usr)) & 0x7);
>      BUILD_BUG_ON((sizeof (struct cpu_info)) & 0x7);
>  }
>  
> diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
> index ff02d15..d8788f2 100644
> --- a/xen/include/public/arch-arm.h
> +++ b/xen/include/public/arch-arm.h
> @@ -119,12 +119,15 @@ struct cpu_user_regs
>  
>      /* Outer guest frame only from here on... */
>  
> -    uint32_t r8_fiq, r9_fiq, r10_fiq, r11_fiq, r12_fiq;
> -
>      uint32_t sp_usr; /* LR_usr is the same register as LR, see above */
>  
> -    uint32_t sp_svc, sp_abt, sp_und, sp_irq, sp_fiq;
> -    uint32_t lr_svc, lr_abt, lr_und, lr_irq, lr_fiq;
> +    uint32_t sp_irq, lr_irq;
> +    uint32_t sp_svc, lr_svc;
> +    uint32_t sp_abt, lr_abt;
> +    uint32_t sp_und, lr_und;
> +
> +    uint32_t r8_fiq, r9_fiq, r10_fiq, r11_fiq, r12_fiq;
> +    uint32_t sp_fiq, lr_fiq;
>  
>      uint32_t spsr_svc, spsr_abt, spsr_und, spsr_irq, spsr_fiq;
>  
> -- 
> 1.7.2.5
> 

  reply	other threads:[~2012-12-18 18:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-18 16:49 [PATCH 0/5] xen: arm: fix guest register access bug Ian Campbell
2012-12-18 16:49 ` [PATCH 1/5] xen: arm: fix long lines in entry.S Ian Campbell
2012-12-18 18:17   ` Stefano Stabellini
2012-12-19 10:16     ` Ian Campbell
2012-12-18 16:49 ` [PATCH 2/5] xen: arm: remove hard tabs from asm code Ian Campbell
2012-12-18 18:18   ` Stefano Stabellini
2012-12-18 16:49 ` [PATCH 3/5] xen: arm: head.S PT_DEV is unused, drop and rename PT_DEV_L3 Ian Campbell
2012-12-18 18:33   ` Stefano Stabellini
2012-12-19 10:20     ` Ian Campbell
2012-12-19 10:49       ` Tim Deegan
2012-12-19 11:22         ` Ian Campbell
2012-12-19 14:54           ` Ian Campbell
2012-12-20 11:21             ` Tim Deegan
2012-12-20 11:24               ` Ian Campbell
2012-12-20 11:54                 ` Ian Campbell
2013-01-04 15:59                 ` Ian Campbell
2012-12-18 16:49 ` [PATCH 4/5] xen: arm: reorder registers in struct cpu_user_regs Ian Campbell
2012-12-18 18:35   ` Stefano Stabellini [this message]
2012-12-18 16:49 ` [PATCH 5/5] xen: arm: fix guest register access Ian Campbell
2012-12-18 18:40   ` Stefano Stabellini
2012-12-18 20:52     ` Ian Campbell
2012-12-19 14:07 ` [PATCH 0/5] xen: arm: fix guest register access bug Ian Campbell

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=alpine.DEB.2.02.1212181835260.17523@kaball.uk.xensource.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.