From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ryan Harkin Date: Fri, 13 Jan 2017 08:41:11 +0000 Subject: [U-Boot] [PATCH] armv8: aarch64: Fix the warning about x1-x3 nonzero issue In-Reply-To: References: <1484293816-23554-1-git-send-email-b18965@freescale.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Alison, I'll wait for a new version based on Alex's feedback before I test. The change looks like it should work, so I'm happy to wait, unless you feel thjere is a need to test it sooner. Thanks for the quick response. Regards, Ryan. On 13 Jan 2017 08:16, "Alison Wang" wrote: Hi, Ryan, This patch is to fix the issue about a warning for ARMv8 64-bit kernel you reported before. I have tested on my LayerScape boards. Please review and try on your boards too. Thanks. Best Regards, Alison Wang > -----Original Message----- > From: Alison Wang [mailto:b18965 at freescale.com] > Sent: Friday, January 13, 2017 3:50 PM > To: york sun ; ryan.harkin at linaro.org; agraf at suse.de; > Scott Wood ; Stuart Yoder ; > Leo Li ; fenghua at phytium.com.cn; > linus.walleij at linaro.org; u-boot at lists.denx.de > Cc: Jason Jin ; Alison Wang > Subject: [PATCH] armv8: aarch64: Fix the warning about x1-x3 nonzero > issue > > 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 > --- > 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