public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Dave.Martin@arm.com (Dave Martin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] arm: hyp: fix macro parameterisation
Date: Tue, 9 Jul 2013 17:29:56 +0100	[thread overview]
Message-ID: <20130709162956.GB2911@localhost.localdomain> (raw)
In-Reply-To: <1373379366-15689-2-git-send-email-mark.rutland@arm.com>

On Tue, Jul 09, 2013 at 03:16:04PM +0100, Mark Rutland wrote:
> Currently, compare_cpu_mode_with_primary uses a mixture of macro
> arguments and hardcoded registers, and does so incorrectly, as it
> stores (__boot_cpu_mode_offset | BOOT_CPU_MODE_MISMATCH) to
> (__boot_cpu_mode + &__boot_cpu_mode_offset), which could corrupt an
> arbitrary portion of memory.
> 
> This patch fixes up compare_cpu_mode_with_primary to use the macro
> arguments, correctly updating __boot_cpu_mode.
> 
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Dave Martin <dave.martin@arm.com>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: Christoffer Dall <cdall@cs.columbia.edu>

May bad originally my the looks of it.  Thanks for spotting this.

Acked-by: Dave Martin <Dave.Martin@arm.com>

> ---
>  arch/arm/kernel/hyp-stub.S | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S
> index 1315c4c..bda76ce 100644
> --- a/arch/arm/kernel/hyp-stub.S
> +++ b/arch/arm/kernel/hyp-stub.S
> @@ -56,8 +56,8 @@ ENTRY(__boot_cpu_mode)
>  	ldr	\reg3, [\reg2]
>  	ldr	\reg1, [\reg2, \reg3]
>  	cmp	\mode, \reg1		@ matches primary CPU boot mode?
> -	orrne	r7, r7, #BOOT_CPU_MODE_MISMATCH
> -	strne	r7, [r5, r6]		@ record what happened and give up
> +	orrne	\reg1, \reg1, #BOOT_CPU_MODE_MISMATCH
> +	strne	\reg1, [\reg2, \reg3]	@ record what happened and give up
>  	.endm
>  
>  #else	/* ZIMAGE */
> -- 
> 1.8.1.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2013-07-09 16:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09 14:16 [PATCH 0/3] arm/arm64: a trio of boot mode detection fixes Mark Rutland
2013-07-09 14:16 ` [PATCH 1/3] arm: hyp: fix macro parameterisation Mark Rutland
2013-07-09 16:29   ` Dave Martin [this message]
2013-07-09 14:16 ` [PATCH 2/3] arm: virt: ensure visibility of __boot_cpu_mode Mark Rutland
2013-07-09 16:32   ` Dave Martin
2013-07-09 14:16 ` [PATCH 3/3] arm64: " Mark Rutland
2013-07-18 15:26 ` [PATCH 0/3] arm/arm64: a trio of boot mode detection fixes Marc Zyngier
2013-07-18 16:25   ` Mark Rutland
2013-07-23 10:01     ` Catalin Marinas

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=20130709162956.GB2911@localhost.localdomain \
    --to=dave.martin@arm.com \
    --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