All of lore.kernel.org
 help / color / mirror / Atom feed
From: christoffer.dall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/7] ARM: KVM: fix vgic V7 assembler code to work in BE image
Date: Wed, 19 Mar 2014 18:10:44 -0700	[thread overview]
Message-ID: <20140320011044.GH1297@cbox> (raw)
In-Reply-To: <1392183693-21238-3-git-send-email-victor.kamensky@linaro.org>

On Tue, Feb 11, 2014 at 09:41:28PM -0800, Victor Kamensky wrote:
> The vgic h/w registers are little endian; when asm code reads/writes

when BE asm code...

> from/to them, it needs to do byteswap after/before. Byteswap code
> uses ARM_BE8 wrapper to add swap only if CONFIG_CPU_BIG_ENDIAN is
> configured.
> 
> Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
> ---
>  arch/arm/kvm/interrupts_head.S | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/arch/arm/kvm/interrupts_head.S b/arch/arm/kvm/interrupts_head.S
> index 6f18695..1e9be2f 100644
> --- a/arch/arm/kvm/interrupts_head.S
> +++ b/arch/arm/kvm/interrupts_head.S
> @@ -1,4 +1,5 @@
>  #include <linux/irqchip/arm-gic.h>
> +#include <asm/assembler.h>
>  
>  #define VCPU_USR_REG(_reg_nr)	(VCPU_USR_REGS + (_reg_nr * 4))
>  #define VCPU_USR_SP		(VCPU_USR_REG(13))
> @@ -412,6 +413,14 @@ vcpu	.req	r0		@ vcpu pointer always in r0
>  	ldr	r8, [r2, #GICH_ELRSR0]
>  	ldr	r9, [r2, #GICH_ELRSR1]
>  	ldr	r10, [r2, #GICH_APR]
> +ARM_BE8(rev	r3, r3	)
> +ARM_BE8(rev	r4, r4	)
> +ARM_BE8(rev	r5, r5	)
> +ARM_BE8(rev	r6, r6	)
> +ARM_BE8(rev	r7, r7	)
> +ARM_BE8(rev	r8, r8	)
> +ARM_BE8(rev	r9, r9	)
> +ARM_BE8(rev	r10, r10	)
>  
>  	str	r3, [r11, #VGIC_CPU_HCR]
>  	str	r4, [r11, #VGIC_CPU_VMCR]
> @@ -431,6 +440,7 @@ vcpu	.req	r0		@ vcpu pointer always in r0
>  	add	r3, r11, #VGIC_CPU_LR
>  	ldr	r4, [r11, #VGIC_CPU_NR_LR]
>  1:	ldr	r6, [r2], #4
> +ARM_BE8(rev	r6, r6	)
>  	str	r6, [r3], #4
>  	subs	r4, r4, #1
>  	bne	1b
> @@ -458,6 +468,9 @@ vcpu	.req	r0		@ vcpu pointer always in r0
>  	ldr	r3, [r11, #VGIC_CPU_HCR]
>  	ldr	r4, [r11, #VGIC_CPU_VMCR]
>  	ldr	r8, [r11, #VGIC_CPU_APR]
> +ARM_BE8(rev	r3, r3	)
> +ARM_BE8(rev	r4, r4	)
> +ARM_BE8(rev	r8, r8	)
>  
>  	str	r3, [r2, #GICH_HCR]
>  	str	r4, [r2, #GICH_VMCR]
> @@ -468,6 +481,7 @@ vcpu	.req	r0		@ vcpu pointer always in r0
>  	add	r3, r11, #VGIC_CPU_LR
>  	ldr	r4, [r11, #VGIC_CPU_NR_LR]
>  1:	ldr	r6, [r3], #4
> +ARM_BE8(rev	r6, r6  )
>  	str	r6, [r2], #4
>  	subs	r4, r4, #1
>  	bne	1b
> -- 
> 1.8.1.4
> 

Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>

  reply	other threads:[~2014-03-20  1:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-12  5:41 [PATCH v2 0/7] armv7 BE kvm support Victor Kamensky
2014-02-12  5:41 ` [PATCH v2 1/7] ARM: KVM: switch hypervisor into BE mode in case of BE host Victor Kamensky
2014-03-18 22:23   ` Christoffer Dall
2014-03-19  0:52     ` Victor Kamensky
2014-03-19  3:03     ` Christoffer Dall
2014-02-12  5:41 ` [PATCH v2 2/7] ARM: KVM: fix vgic V7 assembler code to work in BE image Victor Kamensky
2014-03-20  1:10   ` Christoffer Dall [this message]
2014-02-12  5:41 ` [PATCH v2 3/7] ARM: KVM: handle 64bit values passed to mrcc or from mcrr instructions in BE case Victor Kamensky
2014-03-20  1:11   ` Christoffer Dall
2014-02-12  5:41 ` [PATCH v2 4/7] ARM: KVM: __kvm_vcpu_run function return result fix " Victor Kamensky
2014-03-20  1:11   ` Christoffer Dall
2014-02-12  5:41 ` [PATCH v2 5/7] ARM: KVM: one_reg coproc set and get BE fixes Victor Kamensky
2014-02-12  7:07   ` Alexander Graf
2014-03-20  1:11   ` Christoffer Dall
2014-03-20  1:48     ` Victor Kamensky
2014-03-20  3:01       ` Christoffer Dall
2014-05-13 20:11     ` Victor Kamensky
2014-05-25 19:09       ` Christoffer Dall
2014-02-12  5:41 ` [PATCH v2 6/7] ARM: KVM: vgic mmio should hold data as LE bytes array in BE case Victor Kamensky
2014-03-20  1:12   ` Christoffer Dall
2014-02-12  5:41 ` [PATCH v2 7/7] ARM: KVM: MMIO support BE host running LE code Victor Kamensky
2014-03-20  1:12   ` 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=20140320011044.GH1297@cbox \
    --to=christoffer.dall@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 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.