TL;DR: move Mandatory features to be runtime checked (value 2)
Month ago there was changeset from Govindraj Raja merged [1]. The plan was to enable all mandatory features based on architecture version set by plaform (using ARM_ARCH_{MAJOR,MINOR} variables).
1. https://review.trustedfirmware.org/q/topic:%22gr/build_refactor%22
The idea is nice. But only for final products. If you are working on silicon bring up or on virtualization platform (QEMU or other) then you got hit badly...
I am working on SBSA Reference Platform in QEMU. It can have one of several cpu models. From old v8.0 cores up to v9.0 ones. And then there is also 'max' core which cannot be mapped to any architecture level because it contains all Arm cpu features QEMU can emulate. We need to support all of them in one TF-A binary. Whenever something fails we have some cpu cores in non-bootable state.
We had to enable FGT to get 'max' boot Linux. Now we have to move DIT to be runtime checked to boot anything below Neoverse-V1 at all. And HCX to get 'max' boot Linux again.
At current state of TF-A we cannot handle it. Toplevel Makefile includes platform.mk which sets ARM_ARCH_{MAJOR,MINOR} and then make_helpers/arch_features.mk enables mandatory options by setting them to value "1" which means "present, no need to check".
Due to this we have those changes in Gerrit:
DIT: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/24870 TRF: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/23648
And instead of sending another one to switch FGT, RNG and HCX I decided to write this email.
I have spent half of day today bisecting TF-A, booting several tools and operating systems to check how we are and where the problem is. Still have to get Neoverse-N2 booting properly but other than then I got to the point where all cpu cores boot into Linux.
We need to change make_helpers/arch_features.mk to stop enabling mandatory features as "present, no need to check" (value '1') but to use runtime check (value '2') instead. This way any platform which contains CPU not yet fully developed can boot TF-A. Or platform where one firmware can boot different cpu models.
I am sorry that I bring it so late in release cycle but was unable to use computer for a development for some time.
On Mon, 13 Nov 2023 18:01:08 +0100 Marcin Juszkiewicz via TF-A tf-a@lists.trustedfirmware.org wrote:
Hi Marcin,
TL;DR: move Mandatory features to be runtime checked (value 2)
Month ago there was changeset from Govindraj Raja merged [1]. The plan was to enable all mandatory features based on architecture version set by plaform (using ARM_ARCH_{MAJOR,MINOR} variables).
The idea is nice. But only for final products. If you are working on silicon bring up or on virtualization platform (QEMU or other) then you got hit badly...
I am working on SBSA Reference Platform in QEMU. It can have one of several cpu models. From old v8.0 cores up to v9.0 ones. And then there is also 'max' core which cannot be mapped to any architecture level because it contains all Arm cpu features QEMU can emulate. We need to support all of them in one TF-A binary. Whenever something fails we have some cpu cores in non-bootable state.
We had to enable FGT to get 'max' boot Linux. Now we have to move DIT to be runtime checked to boot anything below Neoverse-V1 at all. And HCX to get 'max' boot Linux again.
At current state of TF-A we cannot handle it. Toplevel Makefile includes platform.mk which sets ARM_ARCH_{MAJOR,MINOR} and then make_helpers/arch_features.mk enables mandatory options by setting them to value "1" which means "present, no need to check".
Due to this we have those changes in Gerrit:
DIT: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/24870 TRF: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/23648
And instead of sending another one to switch FGT, RNG and HCX I decided to write this email.
I have spent half of day today bisecting TF-A, booting several tools and operating systems to check how we are and where the problem is. Still have to get Neoverse-N2 booting properly but other than then I got to the point where all cpu cores boot into Linux.
We need to change make_helpers/arch_features.mk to stop enabling mandatory features as "present, no need to check" (value '1') but to use runtime check (value '2') instead. This way any platform which contains CPU not
But using runtime checking *for flexible platforms* was the plan all along. We did the groundwork for the FVP, feature by feature, check commit 6503ff2910ae5ed for an example. For all flexible platforms, the idea is that the default architecture revision stays at v8.0 (to cover "-cpu cortex-a57", for instance), but all(?) features get promoted to a runtime check (=2). Check the current version of plat/arm/board/fvp/platform.mk.
The same problem hits the Arm FPGA, which is a very simple platform sporting the newest cores in development. Check commit b321c243423b93, which enabled all relevant features to do a runtime check.
So please just push a patch similar to that, and we should be good?
Cheers, Andre
yet fully developed can boot TF-A. Or platform where one firmware can boot different cpu models.
I am sorry that I bring it so late in release cycle but was unable to use computer for a development for some time.
W dniu 13.11.2023 o 18:23, Andre Przywara pisze:
But using runtime checking for flexible platforms was the plan all along. We did the groundwork for the FVP, feature by feature, check commit 6503ff2910ae5ed for an example. For all flexible platforms, the idea is that the default architecture revision stays at v8.0 (to cover "-cpu cortex-a57", for instance), but all(?) features get promoted to a runtime check (=2). Check the current version of plat/arm/board/fvp/platform.mk.
The same problem hits the Arm FPGA, which is a very simple platform sporting the newest cores in development. Check commit b321c243423b93, which enabled all relevant features to do a runtime check.
So please just push a patch similar to that, and we should be good?
Thanks for suggestion. Looks like you went with reverse approach then is present for qemu platforms.
I tried your approach. Made v8.0 default and then enabled all v8.1-v8.7 flags as 'check at runtime'. Quick check shown that Linux boots fine on A57/N1/V1/max.
Will send patch once my testing script finish and I compare results.
W dniu 13.11.2023 o 18:55, Marcin Juszkiewicz pisze:
W dniu 13.11.2023 o 18:23, Andre Przywara pisze:
But using runtime checking for flexible platforms was the plan all along. We did the groundwork for the FVP, feature by feature, check commit 6503ff2910ae5ed for an example. For all flexible platforms, the idea is that the default architecture revision stays at v8.0 (to cover "-cpu cortex-a57", for instance), but all(?) features get promoted to a runtime check (=2). Check the current version of plat/arm/board/fvp/platform.mk.
The same problem hits the Arm FPGA, which is a very simple platform sporting the newest cores in development. Check commit b321c243423b93, which enabled all relevant features to do a runtime check.
So please just push a patch similar to that, and we should be good?
Thanks for suggestion. Looks like you went with reverse approach then is present for qemu platforms.
I tried your approach. Made v8.0 default and then enabled all v8.1-v8.7 flags as 'check at runtime'. Quick check shown that Linux boots fine on A57/N1/V1/max.
Will send patch once my testing script finish and I compare results.
https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/24870 is the result.
Tested with BSA/SBSA ACS and Debian Linux 6.5 kernel. No visible changes.
Hi Marchin,
Will take this patch for the release.
To answer Leif's question,
The reason for this was to ensure that a fixed platform does not miss on a mandatory feature just because the firmware integrator forgets to enable it. This makes the life easier for integrator and at the same time avoids any programming mistake.
For variable platforms like (FVP etc) the best way is to keep all features to be dynamically detected.
Thanks Manish ________________________________ From: Marcin Juszkiewicz via TF-A tf-a@lists.trustedfirmware.org Sent: 13 November 2023 18:16 To: Andre Przywara Andre.Przywara@arm.com; Marcin Juszkiewicz via TF-A tf-a@lists.trustedfirmware.org Cc: Leif Lindholm quic_llindhol@quicinc.com; Jean-Philippe Brucker jean-philippe@linaro.org; Govindraj Raja Govindraj.Raja@arm.com Subject: [TF-A] Re: We cannot force Arm features for platforms
W dniu 13.11.2023 o 18:55, Marcin Juszkiewicz pisze:
W dniu 13.11.2023 o 18:23, Andre Przywara pisze:
But using runtime checking for flexible platforms was the plan all along. We did the groundwork for the FVP, feature by feature, check commit 6503ff2910ae5ed for an example. For all flexible platforms, the idea is that the default architecture revision stays at v8.0 (to cover "-cpu cortex-a57", for instance), but all(?) features get promoted to a runtime check (=2). Check the current version of plat/arm/board/fvp/platform.mk.
The same problem hits the Arm FPGA, which is a very simple platform sporting the newest cores in development. Check commit b321c243423b93, which enabled all relevant features to do a runtime check.
So please just push a patch similar to that, and we should be good?
Thanks for suggestion. Looks like you went with reverse approach then is present for qemu platforms.
I tried your approach. Made v8.0 default and then enabled all v8.1-v8.7 flags as 'check at runtime'. Quick check shown that Linux boots fine on A57/N1/V1/max.
Will send patch once my testing script finish and I compare results.
https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/24870 is the result.
Tested with BSA/SBSA ACS and Debian Linux 6.5 kernel. No visible changes. -- TF-A mailing list -- tf-a@lists.trustedfirmware.org To unsubscribe send an email to tf-a-leave@lists.trustedfirmware.org
(I should remember to respond to this as well.)
Hi André,
On Mon, Nov 13, 2023 at 17:23:58 +0000, Andre Przywara wrote:
We need to change make_helpers/arch_features.mk to stop enabling mandatory features as "present, no need to check" (value '1') but to use runtime check (value '2') instead. This way any platform which contains CPU not
But using runtime checking *for flexible platforms* was the plan all along. We did the groundwork for the FVP, feature by feature, check commit 6503ff2910ae5ed for an example. For all flexible platforms, the idea is that the default architecture revision stays at v8.0 (to cover "-cpu cortex-a57", for instance), but all(?) features get promoted to a runtime check (=2). Check the current version of plat/arm/board/fvp/platform.mk.
Ah, that intended usage-pattern was not clear to me. Would it be worth adding a sentence to the FEATURE_DETECTION section of build-options.rst?
Thanks for explaining!
Regards,
Leif
The same problem hits the Arm FPGA, which is a very simple platform sporting the newest cores in development. Check commit b321c243423b93, which enabled all relevant features to do a runtime check.
So please just push a patch similar to that, and we should be good?
Cheers, Andre
yet fully developed can boot TF-A. Or platform where one firmware can boot different cpu models.
I am sorry that I bring it so late in release cycle but was unable to use computer for a development for some time.
On Wed, 15 Nov 2023 17:15:35 +0000 Leif Lindholm quic_llindhol@quicinc.com wrote:
Hi,
(I should remember to respond to this as well.)
Hi André,
On Mon, Nov 13, 2023 at 17:23:58 +0000, Andre Przywara wrote:
We need to change make_helpers/arch_features.mk to stop enabling mandatory features as "present, no need to check" (value '1') but to use runtime check (value '2') instead. This way any platform which contains CPU not
But using runtime checking *for flexible platforms* was the plan all along. We did the groundwork for the FVP, feature by feature, check commit 6503ff2910ae5ed for an example. For all flexible platforms, the idea is that the default architecture revision stays at v8.0 (to cover "-cpu cortex-a57", for instance), but all(?) features get promoted to a runtime check (=2). Check the current version of plat/arm/board/fvp/platform.mk.
Ah, that intended usage-pattern was not clear to me.
Yeah, sorry, I wanted to communicate this to people caring about the QEMU port, but this was somehow missed.
Would it be worth adding a sentence to the FEATURE_DETECTION section of build-options.rst?
Mmh, skimming over this makes me think this stanza deserves some rewrite anyway. I will try to send a patch after the release. But I am not sure this is the right place for the explanation, since FEATURE_DETECTION is only a loosely related debug feature, and you get the runtime detection when setting something to =2 regardless. Will try to address this.
Thanks, Andre
Thanks for explaining!
Regards,
Leif
The same problem hits the Arm FPGA, which is a very simple platform sporting the newest cores in development. Check commit b321c243423b93, which enabled all relevant features to do a runtime check.
So please just push a patch similar to that, and we should be good?
Cheers, Andre
yet fully developed can boot TF-A. Or platform where one firmware can boot different cpu models.
I am sorry that I bring it so late in release cycle but was unable to use computer for a development for some time.
On 2023-11-13 17:01, Marcin Juszkiewicz wrote:
TL;DR: move Mandatory features to be runtime checked (value 2)
Just to pitch in with Marcin; I fully agree with this.
But I did want to ask - was the current mechanism implemented that way with a specific functional intent, or was it done like that to minimise behavioral change for existing platforms?
/ Leif
Month ago there was changeset from Govindraj Raja merged [1]. The plan was to enable all mandatory features based on architecture version set by plaform (using ARM_ARCH_{MAJOR,MINOR} variables).
The idea is nice. But only for final products. If you are working on silicon bring up or on virtualization platform (QEMU or other) then you got hit badly...
I am working on SBSA Reference Platform in QEMU. It can have one of several cpu models. From old v8.0 cores up to v9.0 ones. And then there is also 'max' core which cannot be mapped to any architecture level because it contains all Arm cpu features QEMU can emulate. We need to support all of them in one TF-A binary. Whenever something fails we have some cpu cores in non-bootable state.
We had to enable FGT to get 'max' boot Linux. Now we have to move DIT to be runtime checked to boot anything below Neoverse-V1 at all. And HCX to get 'max' boot Linux again.
At current state of TF-A we cannot handle it. Toplevel Makefile includes platform.mk which sets ARM_ARCH_{MAJOR,MINOR} and then make_helpers/arch_features.mk enables mandatory options by setting them to value "1" which means "present, no need to check".
Due to this we have those changes in Gerrit:
DIT: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/24870 TRF: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/23648
And instead of sending another one to switch FGT, RNG and HCX I decided to write this email.
I have spent half of day today bisecting TF-A, booting several tools and operating systems to check how we are and where the problem is. Still have to get Neoverse-N2 booting properly but other than then I got to the point where all cpu cores boot into Linux.
We need to change make_helpers/arch_features.mk to stop enabling mandatory features as "present, no need to check" (value '1') but to use runtime check (value '2') instead. This way any platform which contains CPU not yet fully developed can boot TF-A. Or platform where one firmware can boot different cpu models.
I am sorry that I bring it so late in release cycle but was unable to use computer for a development for some time.
Hi Marcin / All,
not sure if runtime check for mandatory features is the right way considering most platforms will have them enabled and check to see if they are enabled would not be optimal.
For time being (until we find a better option) I will add a patch which would make mandatory with '?=' thus providing a bit more room for any platform or build option overrides still possible.
--
Thanks,
Govindraj R
________________________________ From: Leif Lindholm quic_llindhol@quicinc.com Sent: Monday, November 13, 2023 11:24 To: Marcin Juszkiewicz marcin.juszkiewicz@linaro.org; tf-a@lists.trustedfirmware.org tf-a@lists.trustedfirmware.org Cc: Jens Wiklander jens.wiklander@linaro.org; Jean-Philippe Brucker jean-philippe@linaro.org; Govindraj Raja Govindraj.Raja@arm.com; Sandrine Bailleux Sandrine.Bailleux@arm.com; Manish Pandey2 Manish.Pandey2@arm.com; Andre Przywara Andre.Przywara@arm.com Subject: Re: We cannot force Arm features for platforms
On 2023-11-13 17:01, Marcin Juszkiewicz wrote:
TL;DR: move Mandatory features to be runtime checked (value 2)
Just to pitch in with Marcin; I fully agree with this.
But I did want to ask - was the current mechanism implemented that way with a specific functional intent, or was it done like that to minimise behavioral change for existing platforms?
/ Leif
Month ago there was changeset from Govindraj Raja merged [1]. The plan was to enable all mandatory features based on architecture version set by plaform (using ARM_ARCH_{MAJOR,MINOR} variables).
The idea is nice. But only for final products. If you are working on silicon bring up or on virtualization platform (QEMU or other) then you got hit badly...
I am working on SBSA Reference Platform in QEMU. It can have one of several cpu models. From old v8.0 cores up to v9.0 ones. And then there is also 'max' core which cannot be mapped to any architecture level because it contains all Arm cpu features QEMU can emulate. We need to support all of them in one TF-A binary. Whenever something fails we have some cpu cores in non-bootable state.
We had to enable FGT to get 'max' boot Linux. Now we have to move DIT to be runtime checked to boot anything below Neoverse-V1 at all. And HCX to get 'max' boot Linux again.
At current state of TF-A we cannot handle it. Toplevel Makefile includes platform.mk which sets ARM_ARCH_{MAJOR,MINOR} and then make_helpers/arch_features.mk enables mandatory options by setting them to value "1" which means "present, no need to check".
Due to this we have those changes in Gerrit:
DIT: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/24870 TRF: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/23648
And instead of sending another one to switch FGT, RNG and HCX I decided to write this email.
I have spent half of day today bisecting TF-A, booting several tools and operating systems to check how we are and where the problem is. Still have to get Neoverse-N2 booting properly but other than then I got to the point where all cpu cores boot into Linux.
We need to change make_helpers/arch_features.mk to stop enabling mandatory features as "present, no need to check" (value '1') but to use runtime check (value '2') instead. This way any platform which contains CPU not yet fully developed can boot TF-A. Or platform where one firmware can boot different cpu models.
I am sorry that I bring it so late in release cycle but was unable to use computer for a development for some time.
tf-a@lists.trustedfirmware.org