linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: Cortex-M and zImage
Date: Wed, 17 Sep 2014 09:47:19 +0100	[thread overview]
Message-ID: <20140917084719.GP12361@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20140917061110.GM3755@pengutronix.de>

On Wed, Sep 17, 2014 at 08:11:10AM +0200, Uwe Kleine-K?nig wrote:
> I was able to compile a zImage with the patch below. For the
> "Conflicting architecture profiles" error the most relevant hunk is the
> first. And of course this needs some #ifdefs.

However, when I see crap like this, I really have to say something.

> @@ -145,7 +145,7 @@ start:
>  		 * FIQs/IRQs (numeric definitions from angel arm.h source).
>  		 * We only do this if we were in user mode on entry.
>  		 */
> -		mrs	r2, cpsr		@ get current mode
> +		@mrs	r2, cpsr		@ get current mode
>  		tst	r2, #3			@ not user?
>  		bne	not_angel

This *reads* into r2, which is then tested, and the path through the code
changes according to the value read.  You've commented out the read, so
now r2 is effective uninitialised.  How do you know which path will be
used?

>  		mov	r0, #0x17		@ angel_SWIreason_EnterSVC
> @@ -153,7 +153,7 @@ start:
>   THUMB(		svc	0xab		)	@ angel_SWI_THUMB
>  not_angel:
>  		safe_svcmode_maskall r0
> -		msr	spsr_cxsf, r9		@ Save the CPU boot mode in
> +		@msr	spsr_cxsf, r9		@ Save the CPU boot mode in
>  						@ SPSR
>  		/*
>  		 * Note that some cache flushing and other stuff may
> @@ -366,7 +366,7 @@ dtb_check_done:
>  
>  /* Relocate the hyp vector base if necessary */
>  #ifdef CONFIG_ARM_VIRT_EXT
> -		mrs	r0, spsr
> +		@mrs	r0, spsr
>  		and	r0, r0, #MODE_MASK
>  		cmp	r0, #HYP_MODE
>  		bne	1f

Same here.

> @@ -500,7 +500,7 @@ not_relocated:	mov	r0, #0
>  		mov	r2, r8			@ restore atags pointer
>  
>  #ifdef CONFIG_ARM_VIRT_EXT
> -		mrs	r0, spsr		@ Get saved CPU boot mode
> +		@mrs	r0, spsr		@ Get saved CPU boot mode
>  		and	r0, r0, #MODE_MASK
>  		cmp	r0, #HYP_MODE		@ if not booted in HYP mode...
>  		bne	__enter_kernel		@ boot kernel directly

And here.

> @@ -791,7 +791,7 @@ call_cache_fn:	adr	r12, proc_types
>  #ifdef CONFIG_CPU_CP15
>  		mrc	p15, 0, r9, c0, c0	@ get processor ID
>  #else
> -		ldr	r9, =CONFIG_PROCESSOR_ID
> +		@ldr	r9, =CONFIG_PROCESSOR_ID

And here.

Please, don't post such utter trash, and don't post such utter trash for
others to possibly use either.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

      parent reply	other threads:[~2014-09-17  8:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-16 20:25 Cortex-M and zImage Joachim Eastwood
2014-09-17  6:11 ` Uwe Kleine-König
2014-09-17  6:55   ` Joachim Eastwood
2014-09-17  7:05     ` Uwe Kleine-König
2014-09-17 21:06       ` Joachim Eastwood
2014-09-17  8:47   ` Russell King - ARM Linux [this message]

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=20140917084719.GP12361@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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).