qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Christophe DUBOIS <jcd@tribudubois.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v2 7/9] i.MX: Add i.MX6 SOC implementation.
Date: Mon, 29 Feb 2016 21:34:47 +0100	[thread overview]
Message-ID: <56D4AB67.6080506@tribudubois.net> (raw)
In-Reply-To: <CAFEAcA-4hxBUtRg6zstkkSyzm3OecZe_mCHQV6rONZTmKJKrBQ@mail.gmail.com>

Le 29/02/2016 18:58, Peter Maydell a écrit :
> On 19 February 2016 at 06:32, Jean-Christophe DUBOIS
> <jcd@tribudubois.net> wrote:
>> If I set has_el3 to false, I can boot the 4 cores without problem. With
>> has_el3 set to true (default value) I am getting the above behavior (boot OK
>> in uniprocessor mode, and misbehaving if -smp >= 2).
> I worked out why this happens -- it's because the secondary CPUs and
> the primary disagree about whether they're booting in Secure mode.
> You can either:
> (1) have the board code say "boot the primary in Secure mode":
> --- a/hw/arm/sabrelite.c
> +++ b/hw/arm/sabrelite.c
> @@ -85,6 +85,7 @@ static void sabrelite_init(MachineState *machine)
>       sabrelite_binfo.kernel_cmdline = machine->kernel_cmdline;
>       sabrelite_binfo.initrd_filename = machine->initrd_filename;
>       sabrelite_binfo.nb_cpus = smp_cpus;
> +    sabrelite_binfo.secure_boot = true;
>       sabrelite_binfo.write_secondary_boot = sabrelite_write_secondary;
>       sabrelite_binfo.secondary_cpu_reset_hook = sabrelite_reset_secondary;
>
> or (2) have the code in imx6_src.c tell the secondaries that
> they should start in non-secure mode:
>
> --- a/hw/misc/imx6_src.c
> +++ b/hw/misc/imx6_src.c
> @@ -144,6 +144,7 @@ static void imx6_src_cpu_on(uint32_t cpuid,
> uint32_t entry, uint32_t context_id)
>
>       target_cpu->env.regs[0] = context_id;
>       target_cpu->env.thumb = entry & 1;
> +    target_cpu->env.cp15.scr_el3 |= SCR_NS;
>
>       target_cpu_class->set_pc(target_cpu_state, entry);
>   }
>
> If you do either of these then the system will boot the kernel that
> you sent the link to.

Thanks Peter, It does work.

>
> To answer the question of "which of these is the correct thing to do"
> we need to look at what the real hardware does when it's running Linux:
> does it run Linux in Secure or Nonsecure?

i.MX6 is definitively able to boot in secure/trustzone mode (there are 
some demo out there about it) so I guess it might be booting in secure mode.

>
> thanks
> -- PMM
>

  reply	other threads:[~2016-02-29 20:34 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 22:08 [Qemu-devel] [PATCH v2 0/9] Add i.MX6 (Single/Dual/Quad) support Jean-Christophe Dubois
2016-02-08 22:08 ` [Qemu-devel] [PATCH v2 1/9] i.MX: Allow GPT timer to rollover Jean-Christophe Dubois
2016-02-16 15:19   ` Peter Maydell
2016-02-08 22:08 ` [Qemu-devel] [PATCH v2 2/9] i.MX: Rename CCM NOCLK to CLK_NONE for naming consistency Jean-Christophe Dubois
2016-02-16 15:20   ` Peter Maydell
2016-02-08 22:08 ` [Qemu-devel] [PATCH v2 3/9] i.MX: Remove CCM useless clock computation handling Jean-Christophe Dubois
2016-02-16 15:20   ` Peter Maydell
2016-02-08 22:08 ` [Qemu-devel] [PATCH v2 4/9] i.MX: Add the CLK_IPG_HIGH clock Jean-Christophe Dubois
2016-02-16 15:20   ` Peter Maydell
2016-02-08 22:08 ` [Qemu-devel] [PATCH v2 5/9] i.MX: Add i.MX6 CCM and ANALOG device Jean-Christophe Dubois
2016-02-16 15:21   ` Peter Maydell
2016-02-29 17:33   ` Peter Maydell
2016-02-29 20:15     ` Jean-Christophe DUBOIS
2016-02-08 22:08 ` [Qemu-devel] [PATCH v2 6/9] i.MX: Add i.MX6 System Reset Controller device Jean-Christophe Dubois
2016-02-16 15:35   ` Peter Maydell
2016-02-27 16:57     ` Jean-Christophe DUBOIS
2016-02-27 17:43       ` Peter Maydell
2016-02-28 12:00         ` Jean-Christophe DUBOIS
2016-02-08 22:08 ` [Qemu-devel] [PATCH v2 7/9] i.MX: Add i.MX6 SOC implementation Jean-Christophe Dubois
2016-02-16 15:31   ` Peter Maydell
2016-02-16 20:49     ` Jean-Christophe DUBOIS
2016-02-16 21:06       ` Peter Maydell
2016-02-16 21:47         ` Jean-Christophe DUBOIS
2016-02-16 21:57           ` Peter Maydell
2016-02-18 20:51             ` Jean-Christophe DUBOIS
2016-02-18 21:46               ` Peter Maydell
2016-02-19  6:32                 ` Jean-Christophe DUBOIS
2016-02-19  9:32                   ` Peter Maydell
2016-02-19 21:06                     ` Jean-Christophe DUBOIS
2016-02-20 10:55                       ` Jean-Christophe DUBOIS
2016-02-20 15:30                         ` Peter Crosthwaite
2016-02-20 18:03                           ` Jean-Christophe DUBOIS
2016-02-21  3:42                             ` Peter Crosthwaite
2016-02-21 13:42                               ` Jean-Christophe DUBOIS
2016-02-29 17:58                   ` Peter Maydell
2016-02-29 20:34                     ` Jean-Christophe DUBOIS [this message]
2016-02-29 21:14                       ` Peter Maydell
2016-02-29 21:32                         ` Jean-Christophe DUBOIS
2016-03-01 16:19                           ` Peter Maydell
2016-03-01 19:17                             ` Jean-Christophe DUBOIS
2016-02-08 22:08 ` [Qemu-devel] [PATCH v2 8/9] i.MX: Add sabrelite i.MX6 emulation Jean-Christophe Dubois
2016-02-16 15:25   ` Peter Maydell
2016-02-08 22:08 ` [Qemu-devel] [PATCH v2 9/9] i.MX: Add missing descriptions in devices Jean-Christophe Dubois
2016-02-16 15:21   ` Peter Maydell
2016-02-28 20:27 ` [Qemu-devel] [PATCH v2 0/9] Add i.MX6 (Single/Dual/Quad) support Jean-Christophe DUBOIS
2016-03-01 19:18   ` Jean-Christophe DUBOIS
2016-03-01 19:27     ` Peter Maydell

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=56D4AB67.6080506@tribudubois.net \
    --to=jcd@tribudubois.net \
    --cc=crosthwaite.peter@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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).