linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/7] ARM: virt: allow the kernel to be entered in HYP mode
Date: Mon, 8 Oct 2012 13:36:56 -0700	[thread overview]
Message-ID: <20121008203655.GA13011@atomide.com> (raw)
In-Reply-To: <5072B9EF.1020005@arm.com>

* Marc Zyngier <marc.zyngier@arm.com> [121008 04:34]:
> On 08/10/12 12:01, Dave Martin wrote:
> > 
> > In an attempt to narrow this down...
> > 
> > Can you follow this (i.e., _after_ a known successful switch to SVC mode)
> > 
> > (a)
> > 	mrs	\reg, cpsr
> > 	msr	spsr_cxsf, \reg
> > 	adr	\reg, 3f
> > 	movs	pc, lr
> > 3:
> > 
> > and (b)
> > 
> > 	mrs	\reg, cpsr
> > 	orr	\reg, \reg, #CPSR_A_BIT
> > 	msr	cpsr_cxsf, \reg
> > 
> > and (c)
> > 
> > 	mrs	\reg, cpsr
> > 	orr	\reg, \reg, #CPSR_A_BIT
> > 	msr	spsr_cxsf, \reg
> > 	adr	\reg, 3f
> > 	movs	pc, lr
> > 3:
> > 
> > 
> > 
> > 
> > If only (a) works, this would suggest that the attempt to set the A bit
> > is causing the problem.
> > 
> > If only (b) works, this suggests that the A bit is OK but that some
> > invalid hardware state, or something else we don't understand, is causing
> > exception returns to fail in general.
> > 
> > If (a) and (b) work but (c) fails, this suggests that specifically
> > trying to set the A bit via an exception return is problematic.
> > 
> > If all of them work then this suggests some invalid hardware state or
> > something else we don't understand, but which is cleared by the initial
> > msr cpsr_c which clobbers the processor mode.

Thanks it does not seem to be the A bit..
 
> Playing with an Integrator-CP with a 1136 tile, the only way I could
> cause the thing to fail was to boot the thing in SYSTEM mode.
> 
> Tony, can you possibly also try the attached patch?

Yup you figured it out n800 is in system mode while 2430sdp is not..
I verified it with printhex2.

Your patch fails to compile with:

arch/arm/kernel/head.S: Assembler messages:
arch/arm/kernel/head.S:336: Error: symbol `omgsys' is already defined

Probably because it's included twice. Also, shouldn't it
be bne omgsys instead of beq?

Regards,

Tony

> diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
> index 683a1e6..7714ec7 100644
> --- a/arch/arm/include/asm/assembler.h
> +++ b/arch/arm/include/asm/assembler.h
> @@ -253,6 +253,8 @@
>  	mrs	\reg , cpsr
>  	mov	lr , \reg
>  	and	lr , lr , #MODE_MASK
> +	cmp	lr , #SYSTEM_MODE	/* Yet another braindead platform? */
> +	beq	omgsys
>  	cmp	lr , #HYP_MODE
>  	orr	\reg , \reg , #PSR_A_BIT | PSR_I_BIT | PSR_F_BIT
>  	bic	\reg , \reg , #MODE_MASK
> @@ -264,6 +266,7 @@ THUMB(	orr	\reg , \reg , #PSR_T_BIT	)
>  	__MSR_ELR_HYP(14)
>  	__ERET
>  1:	movs	pc, lr
> +omgsys: msr	cpsr_c, \reg
>  2:
>  .endm
>  

  reply	other threads:[~2012-10-08 20:36 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-07 16:55 [PATCH v2 0/7] Allow the kernel to be booted in HYP mode Marc Zyngier
2012-09-07 16:55 ` [PATCH v2 1/7] ARM: opcodes: add __ERET/__MSR_ELR_HYP instruction encoding Marc Zyngier
2012-09-07 16:55 ` [PATCH v2 2/7] ARM: virt: allow the kernel to be entered in HYP mode Marc Zyngier
2012-10-05 20:08   ` Tony Lindgren
2012-10-05 23:09     ` Russell King - ARM Linux
2012-10-05 23:23       ` Tony Lindgren
2012-10-05 23:50         ` Tony Lindgren
2012-10-06  1:32           ` Nicolas Pitre
2012-10-06  3:06             ` Tony Lindgren
2012-10-06 10:18     ` Marc Zyngier
2012-10-06 14:06       ` Nicolas Pitre
2012-10-06 14:44         ` Tony Lindgren
2012-10-06 14:47         ` Marc Zyngier
2012-10-06 14:42       ` Tony Lindgren
2012-10-06 15:32         ` Nicolas Pitre
2012-10-06 15:40           ` Tony Lindgren
2012-10-06 16:06             ` Marc Zyngier
2012-10-06 15:42           ` Russell King - ARM Linux
2012-10-06 16:00       ` Tony Lindgren
2012-10-08 11:01         ` Dave Martin
2012-10-08 11:33           ` Marc Zyngier
2012-10-08 20:36             ` Tony Lindgren [this message]
2012-10-08 11:33           ` Dave Martin
2012-09-07 16:55 ` [PATCH v2 3/7] ARM: zImage/virt: hyp mode entry support for the zImage loader Marc Zyngier
2012-09-07 16:55 ` [PATCH v2 4/7] ARM: virt: Update documentation for hyp mode entry support Marc Zyngier
2012-09-07 16:55 ` [PATCH v2 5/7] ARM: virt: Add boot-time diagnostics Marc Zyngier
2012-09-07 16:55 ` [PATCH v2 6/7] ARM: virt: Add CONFIG_ARM_VIRT_EXT option Marc Zyngier
2012-09-07 16:55 ` [PATCH v2 7/7] ARM: virt: arch_timers: enable access to physical timers 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=20121008203655.GA13011@atomide.com \
    --to=tony@atomide.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;
as well as URLs for NNTP newsgroup(s).