From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alison Wang Date: Fri, 13 Jan 2017 09:36:00 +0000 Subject: [U-Boot] [PATCH] armv8: aarch64: Fix the warning about x1-x3 nonzero issue In-Reply-To: <90bfea37-7340-380c-c2d0-24bc800502c0@suse.de> References: <1484293816-23554-1-git-send-email-b18965@freescale.com> <13709292-AF28-404D-9BDE-E7F4CEB00657@suse.de> <90bfea37-7340-380c-c2d0-24bc800502c0@suse.de> 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 > On 01/13/2017 09:23 AM, Alison Wang wrote: > >>> Am 13.01.2017 um 08:50 schrieb Alison Wang : > >>> > >>> 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 > >> 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]); > > } > > Yes, that merely means that the kernel doesn't take 3 arguments, it > takes 4. Today args[1..3] have to be 0, but I don't want to iron that > out in u-boot code. > > So in pseudo-code, what we do today is we call > > entry(dt_addr, 0, 0); > > and instead we should be calling > > entry(dt_addr, 0, 0, 0); > > So in U-Boot code that means we should change the prototype for our > switch function from > > void armv8_switch_to_el2(u64 args, u64 mach_nr, u64 fdt_addr, > u64 entry_point, u64 es_flag); > > to > > void armv8_switch_to_el2(u64 args, u64 mach_nr, u64 fdt_addr, > u64 arg4, u64 entry_point, u64 es_flag); > > and adapt the macros accordingly to use x5/x6 instead of x4/5. > [Alison Wang] I understand your meaning. Actually, I thought that method too. Well, my concern is that there are more changes. Not only armv8_switch_to_el2 and armv8_switch_to_el1, all the places calling them need to change too. It may cause more problems. With this concern, I choose a simple way to fix this issue before. Best Regards, Alison Wang