On 11/10/2020 19:23, Biju Das wrote:
Hi Biju,
Found the root cause, the new changes corrupting the registers used by console.S. So I have fixed the issue. Please find the attached patch.
Good find for the source of the register corruption, but unfortunately this patch won't cut it:
- I am not sure you are actually allowed to call a C function from this context. I need to check back with the team tomorrow to find the reason these console_*_register functions are all in assembly. I don't see any assembly callers, but there is (was?) surely a reason behind this. I think this was meant to be called either early in the game (before we have a SP), or during a crash, again with no C context.
- Since this function is called *from* C, you need to adhere to the AAPCS(64) standard, which means your function must preserve x19-x28. So you would need to save x24 and x25 to the stack. If we have one already at this point (see above).
Cheers, Andre
Marek or Andre,
I have tested this patch only on RZ/G2 platform and currently I don't have access to R-Car board. So please test this patch on R-Car boards and if it is OK, please apply to renesas tree.
Cheers, Biju
-----Original Message----- From: André Przywara andre.przywara@arm.com Sent: 11 October 2020 17:38 To: Biju Das biju.das.jz@bp.renesas.com; TF-A@lists.trustedfirmware.org; Madhukar Pappireddy madhukar.pappireddy@arm.com; Joanna.Farley@arm.com Cc: Chris Paterson Chris.Paterson2@renesas.com; Prabhakar Mahadev Lad prabhakar.mahadev-lad.rj@bp.renesas.com; Marek Vasut marek.vasut@gmail.com; Marek Vasut marek.vasut+renesas@gmail.com Subject: Re: commit 75fab6496e5fce9a11 ("libc: memset: improve performance by avoiding single byte writes") causing BL31 boot failure on Renesas RZ/G2 platforms.
On 11/10/2020 14:13, Biju Das wrote:
Hi Andre,
Looks like the issue is related to unhandled Exception in EL3. I have enabled
serial prints in BL31, that is pointing to this.
Please see the below logs. Any ideas??
INFO: SPSR = 0x3cd Unhandled Exception in EL3.
So this is happening before the first output of BL31?
Thanks for the hint.
Unfortunately the information in the crash dump below is not very helpful, other than some NULL pointer sneaking into the PC somehow (ELR_EL3 is NULL). But LR is 0 as well, and ESR says "unknown reason". You could go through the list of possible situations listed in the ARMv8 ARM, D13.2.38 "ESR_EL3, Exception Syndrome Register (EL3)", under "ISS encoding for exceptions with an unknown reason".
This made me to think that there is register corruption.
Regards, Biju