All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alison Wang <alison.wang@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] armv8: aarch64: Fix the warning about x1-x3 nonzero issue
Date: Fri, 13 Jan 2017 08:23:12 +0000	[thread overview]
Message-ID: <DB6PR0401MB2584F38E2F1A79AE9D188EA7F4780@DB6PR0401MB2584.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <13709292-AF28-404D-9BDE-E7F4CEB00657@suse.de>

> > Am 13.01.2017 um 08:50 schrieb Alison Wang <b18965@freescale.com>:
> >
> > For 64-bit kernel, there is a warning about x1-x3 nonzero in
> violation
> > of boot protocol. x3 should be reset to zero before jumping to the
> > kernel.
> >
> > This patch will adjust the parameters to transfer and make sure x3 is
> > zero.
> >
> > Signed-off-by: Alison Wang <alison.wang@nxp.com>
> 
> If x3 is part of the boot protocol, please treat it as function
> argument rather than hard code it to 0.
> 
[Alison Wang] I think x3 need to set to 0. Refer to the codes for the warning in kernel,

        if (boot_args[1] || boot_args[2] || boot_args[3]) {
                pr_err("WARNING: x1-x3 nonzero in violation of boot protocol:\n"
                        "\tx1: %016llx\n\tx2: %016llx\n\tx3: %016llx\n"
                        "This indicates a broken bootloader or old kernel\n",
                        boot_args[1], boot_args[2], boot_args[3]);
        }
> 
> > ---
> > arch/arm/cpu/armv8/transition.S | 44
> > +++++++++++++++++++++++++++++++++++++----
> > 1 file changed, 40 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/arm/cpu/armv8/transition.S
> > b/arch/arm/cpu/armv8/transition.S index adb9f35..06b6664 100644
> > --- a/arch/arm/cpu/armv8/transition.S
> > +++ b/arch/arm/cpu/armv8/transition.S
> > @@ -26,9 +26,27 @@ ENTRY(armv8_switch_to_el2)
> >     * if CONFIG_ARMV8_SWITCH_TO_EL1 is defined.
> >          * When running in EL2 now, jump to the
> >     * address saved in x3.
> > +     *
> > +     * For 64-bit kernel, there is a warning about
> > +     * x1-x3 nonzero in violation of boot protocol.
> > +     * x3 should be reset to zero before jumping to
> > +     * the kernel. Use x4 instead of x3 as parameter.
> >     */
> > -    br x3
> > -1:    armv8_switch_to_el2_m x3, x4, x5
> > +    mov x4, x3
> > +    mov x3, #0
> > +    br x4
> > +1:
> > +    /*
> > +     * For 64-bit kernel, there is a warning about
> > +     * x1-x3 nonzero in violation of boot protocol.
> > +     * x3 should be reset to zero before jumping to
> > +     * the kernel. Use x4, x5, x6 instead of x3, x4,
> > +     * x5 as parameters.
> > +     */
> > +    mov x5, x4
> > +    mov x4, x3
> > +    mov x3, #0
> > +    armv8_switch_to_el2_m x4, x5, x6
> > ENDPROC(armv8_switch_to_el2)
> >
> > ENTRY(armv8_switch_to_el1)
> > @@ -36,9 +54,27 @@ ENTRY(armv8_switch_to_el1)
> > 0:
> >    /* x3 is kernel entry point. When running in EL1
> >     * now, jump to the address saved in x3.
> > +     *
> > +     * For 64-bit kernel, there is a warning about
> > +     * x1-x3 nonzero in violation of boot protocol.
> > +     * x3 should be reset to zero before jumping to
> > +     * the kernel. Use x4 instead of x3 as parameter.
> > +     */
> > +    mov x4, x3
> > +    mov x3, #0
> > +    br x4
> > +1:
> > +    /*
> > +     * For 64-bit kernel, there is a warning about
> > +     * x1-x3 nonzero in violation of boot protocol.
> > +     * x3 should be reset to zero before jumping to
> > +     * the kernel. Use x4, x5, x6 instead of x3, x4,
> > +     * x5 as parameters.
> >     */
> > -    br x3
> > -1:    armv8_switch_to_el1_m x3, x4, x5
> > +    mov x5, x4
> > +    mov x4, x3
> > +    mov x3, #0
> > +    armv8_switch_to_el1_m x4, x5, x6
> > ENDPROC(armv8_switch_to_el1)
> >
> > WEAK(armv8_el2_to_aarch32)
> > --
> > 2.1.0.27.g96db324
> >

Best Regards,
Alison Wang

  reply	other threads:[~2017-01-13  8:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13  7:50 [U-Boot] [PATCH] armv8: aarch64: Fix the warning about x1-x3 nonzero issue Alison Wang
2017-01-13  8:11 ` Alexander Graf
2017-01-13  8:23   ` Alison Wang [this message]
2017-01-13  8:33     ` Alexander Graf
2017-01-13  9:36       ` Alison Wang
2017-01-13  9:55         ` Alexander Graf
2017-01-16  6:31           ` Alison Wang
2017-01-13  8:16 ` Alison Wang
     [not found]   ` <CAD0U-hKbBx=cYCCK1Wqd2TQsrC-D92ae0LPbdSk+unm0Y4LvVQ@mail.gmail.com>
     [not found]     ` <CAD0U-hLZnrfFWdC55s2owGue6yS4uniQXMeQUwaeWMq-g4sP+g@mail.gmail.com>
2017-01-13  8:41       ` Ryan Harkin

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=DB6PR0401MB2584F38E2F1A79AE9D188EA7F4780@DB6PR0401MB2584.eurprd04.prod.outlook.com \
    --to=alison.wang@nxp.com \
    --cc=u-boot@lists.denx.de \
    /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.