Hi trusted service We can run a trusted service at S-EL1 with Hafnium based on trusted service project 1.0.0 library (libsp.a and libc.a) but we found that could cause unalignment stack access trap when call into newlib C library, it is because that you don't add -mstrict-align compile option while compile newlib project, could you add this compile option when you start to build newlib?
Thanks Carlos
Hi Carlos,
The TS build system will pass the value of the NEWLIB_CFLAGS_TARGET environment variable as extra compilation switches to newlib build. Alternatively a cmake cache variable with the same name can be set on the command line using -D NEWLIB_CFLAGS_TARGET =<value>.
/George
From: Carlos Liu via Trusted-services trusted-services@lists.trustedfirmware.org Date: Thursday, 14 March 2024 at 12:52 To: trusted-services@lists.trustedfirmware.org trusted-services@lists.trustedfirmware.org Subject: [Trusted-services] Built-in new lib does not include -mstrict-align gcc compile option Hi trusted service We can run a trusted service at S-EL1 with Hafnium based on trusted service project 1.0.0 library (libsp.a and libc.a) but we found that could cause unalignment stack access trap when call into newlib C library, it is because that you don't add -mstrict-align compile option while compile newlib project, could you add this compile option when you start to build newlib?
Thanks Carlos -- Trusted-services mailing list -- trusted-services@lists.trustedfirmware.org To unsubscribe send an email to trusted-services-leave@lists.trustedfirmware.org
Hi Carlos,
Alternativley you may consider setting SCTLR_EL1.A=0 in your S-EL1 startup code. This will turn off alginment checking. See: https://developer.arm.com/documentation/ddi0595/2021-12/AArch64-Registers/SC...
FYI: before VHE support was implemented in Hafnium the “sel1_shim” was used to allow running S-EL0 SPs under HF. This is now obsolete and discontinued, but might serve as an examle. See: https://gitlab.arm.com/arm-reference-solutions/sel1_shim/-/tree/master?ref_t...
/George
From: Gyorgy Szing via Trusted-services trusted-services@lists.trustedfirmware.org Date: Monday, 18 March 2024 at 13:26 To: carlos.liu@mediatek.com carlos.liu@mediatek.com, trusted-services@lists.trustedfirmware.org trusted-services@lists.trustedfirmware.org Subject: [Trusted-services] Re: Built-in new lib does not include -mstrict-align gcc compile option Hi Carlos,
The TS build system will pass the value of the NEWLIB_CFLAGS_TARGET environment variable as extra compilation switches to newlib build. Alternatively a cmake cache variable with the same name can be set on the command line using -D NEWLIB_CFLAGS_TARGET =<value>.
/George
From: Carlos Liu via Trusted-services trusted-services@lists.trustedfirmware.org Date: Thursday, 14 March 2024 at 12:52 To: trusted-services@lists.trustedfirmware.org trusted-services@lists.trustedfirmware.org Subject: [Trusted-services] Built-in new lib does not include -mstrict-align gcc compile option Hi trusted service We can run a trusted service at S-EL1 with Hafnium based on trusted service project 1.0.0 library (libsp.a and libc.a) but we found that could cause unalignment stack access trap when call into newlib C library, it is because that you don't add -mstrict-align compile option while compile newlib project, could you add this compile option when you start to build newlib?
Thanks Carlos -- Trusted-services mailing list -- trusted-services@lists.trustedfirmware.org To unsubscribe send an email to trusted-services-leave@lists.trustedfirmware.org -- Trusted-services mailing list -- trusted-services@lists.trustedfirmware.org To unsubscribe send an email to trusted-services-leave@lists.trustedfirmware.org
trusted-services@lists.trustedfirmware.org