Is there way of disabling the flag using pragma in the source file????

 

From: Soby Mathew <Soby.Mathew@arm.com>
Sent: Thursday, May 26, 2022 6:22 AM
To: Manish Badarkhe <Manish.Badarkhe@arm.com>; Bartus, Dan <Dan.Bartus@analog.com>; Gyorgy Szing <Gyorgy.Szing@arm.com>; tf-a@lists.trustedfirmware.org
Cc: Neely, Brian <Brian.Neely@analog.com>; nd <nd@arm.com>
Subject: RE: Floating point math

 

[External]

 

One of the issues currently in the build is that there is a global CFlags which all BL images use. Perhaps having a per-BL CFlag which is initialized from the common global C Flag might help. The platforms can then edit the per-BL Cflag.

 

Best Regards

Soby Mathew

 

From: Manish Badarkhe <Manish.Badarkhe@arm.com>
Sent: 26 May 2022 10:14
To: Bartus, Dan <Dan.Bartus@analog.com>; Gyorgy Szing <Gyorgy.Szing@arm.com>; Soby Mathew <Soby.Mathew@arm.com>; tf-a@lists.trustedfirmware.org
Cc: Neely, Brian <Brian.Neely@analog.com>; nd <nd@arm.com>
Subject: Re: Floating point math

 

Hi Dan,

 

Changes you suggested work only if you build BL2 separately. FPU gets enabled for all BLs (BL2, BL31, BL32, etc) if you trigger the build for *all* BLs
for example - "make all", or if you trigger the build for *multiple* BLs for example - "make bl2 bl31"

If you remove the 'mgeneral-regs-only' flag from TF_CFLAGS_aarch64 in case of BL2, it is then removed for all following BL builds triggered after BL2. 

 

@Gyorgy Szing Cmake work is ongoing, and it is not yet complete. As part of that effort, we'll see if BL2 can be built separately.

.

 

Thanks,
Manish Badarkhe

From: Bartus, Dan <Dan.Bartus@analog.com>
Date: Wednesday, 25 May 2022 at 19:13
To: Gyorgy Szing <Gyorgy.Szing@arm.com>, Manish Badarkhe <Manish.Badarkhe@arm.com>, Soby Mathew <Soby.Mathew@arm.com>, tf-a@lists.trustedfirmware.org <tf-a@lists.trustedfirmware.org>
Cc: Neely, Brian <Brian.Neely@analog.com>, nd <nd@arm.com>
Subject: RE: Floating point math

This seemed to take care of the issue

 

 

ifdef BL2_SOURCES

TF_CFLAGS_aarch64 := $(subst -mgeneral-regs-only,,${TF_CFLAGS_aarch64})

Endif

 

Do you think this is acceptable?

 

From: Gyorgy Szing <Gyorgy.Szing@arm.com>
Sent: Wednesday, May 25, 2022 1:07 PM
To: Manish Badarkhe <Manish.Badarkhe@arm.com>; Soby Mathew <Soby.Mathew@arm.com>; Bartus, Dan <Dan.Bartus@analog.com>; tf-a@lists.trustedfirmware.org
Cc: Neely, Brian <Brian.Neely@analog.com>; nd <nd@arm.com>
Subject: RE: Floating point math

 

[External]

 

Hi,

 

What is the status of the cmake build system? Could that be used to allow building BL2 as a separate component?

 

/George

 

From: Manish Badarkhe via TF-A <tf-a@lists.trustedfirmware.org>
Sent: 25 May 2022 17:22
To: Soby Mathew <Soby.Mathew@arm.com>; Bartus, Dan <Dan.Bartus@analog.com>; tf-a@lists.trustedfirmware.org
Cc: Neely, Brian <Brian.Neely@analog.com>
Subject: [TF-A] Re: Floating point math

 

Hi Dan,

 

In TF-A build system, there is no easy way to disable this flag only for BL2 at the moment. This flag can be either be enabled or disabled for all BL components of the platform.

This is a technical use case, and we have not encountered it as a priority item. Are you expecting performance gains if the FPU is enabled in BL2?

We would be interested in hearing more about the specific use case if you are willing discuss it in the open-forum.

 

Thanks,

Manish Badarkhe

 

From: Soby Mathew via TF-A <tf-a@lists.trustedfirmware.org>
Date: Wednesday, 25 May 2022 at 11:41
To: Bartus, Dan <Dan.Bartus@analog.com>, tf-a@lists.trustedfirmware.org <tf-a@lists.trustedfirmware.org>
Cc: Neely, Brian <Brian.Neely@analog.com>
Subject: [TF-A] Re: Floating point math

Hi Dan,

I am a bit rusty on the build system and someone from the core TF-A team will be able to advise on makefile changes. One more thing that you would need to do is set cptr_el3.tfp=0 & cpacr_el1.fpen=0b11  (TF-A disables FP by default at runtime).

 

Best Regards

Soby Mathew

 

From: Bartus, Dan <Dan.Bartus@analog.com>
Sent: 24 May 2022 18:03
To: Soby Mathew <Soby.Mathew@arm.com>; tf-a@lists.trustedfirmware.org
Cc: Neely, Brian <Brian.Neely@analog.com>
Subject: RE: Floating point math

 

Can u suggest a method to disable that flag in BL2 and no where else in platform.mk>?? Possibly using the an ifdef BL2_SOURCES?

 

 

From: Soby Mathew <Soby.Mathew@arm.com>
Sent: Tuesday, May 24, 2022 4:51 AM
To: Bartus, Dan <Dan.Bartus@analog.com>; tf-a@lists.trustedfirmware.org
Cc: Neely, Brian <Brian.Neely@analog.com>
Subject: RE: Floating point math

 

[External]

 

Hi Dan

Just my 2 cents,
Theoretically it should be possible to use FPU at BL2. BL2 does not context switch between worlds and hence all that is probably required is to enable compiler to use FP.  The current build system in TF-A may be a bit unwieldy because it may not allow remove C flags for a particular BL image , as I remember. The runtime firmware , BL31 should not use FP and hence any changes done to BL2 to enable it to use FP should not affect the BL31 compiler flags.

 

Best Regards

Soby Mathew

 

From: Bartus, Dan via TF-A <tf-a@lists.trustedfirmware.org>
Sent: 23 May 2022 21:50
To: tf-a@lists.trustedfirmware.org
Cc: Neely, Brian <Brian.Neely@analog.com>
Subject: [TF-A] Floating point math

 

We are using an arm ARCH-64  (A55) and we need to do some floating point math in BL2.  It seems this is not enabled. Is there a reason why I cannot do FP math (security issue?) and if I can, how do I enable it?

 

I am seeing this error when I use floats “-mgeneral-regs-only”

 

 

thanks