Hi all,
We are pleased to announce the formal release of Trusted Firmware-A version 2.6, Trusted Firmware-A Tests version 2.6, Hafnium version 2.6 and TF-A OpenCI Scripts 2.6 Releases involving the tagging of multiple sub repositories.
These went live on 24th November 2021.
Notable Features of the Version 2.6 Release across repositories are as follows:
* v8-R64 Upstream support, trusted-boot (BL1) only
* RME patches (4 world support)
* Hunter & Hayes CPU support
* Demeter (Makalu ELP for Infra) CPU support
* ARM v9.0-A ETE V1.0
* ARM v9.1-A ETE V1.1
* Armv9 RME support
* Generic Firmware Update support
* Measured Boot Enhancements
* MPMM AMU support SME (Mortlach) for non-secure world (FEAT_SME)
* Security hardening LLVM/clang support.
* FF-A v1.1 notifications support.
* FF-A v1.1 interrupt handling support.
* S-EL0 partitions (through VHE in the secure world).
* SPM support for saving/restoring the normal world SVE live state.
* Build system update to LLVM/Clang 12.
* Updates to FF-A Setup and discovery.
* FF-A compliance fixes.
* Threat model introduced for SPMC at SEL2
* Eight new partner and Arm platforms support added
Please refer to the TF-A [1], Hafnium [2] and TF-A Tests [3] changelogs for the complete summary of changes the previous release.
The test plan and results [4] for the v2.6 release captures the release test activities.
TF-A [5], TF-A Test [6], Hafnium [7] and TF-A OpenCI Scripts [8] repositories are available
[1] https://trustedfirmware-a.readthedocs.io/en/v2.6/
[2] https://review.trustedfirmware.org/plugins/gitiles/hafnium/hafnium/+/HEAD/d…
[3] https://trustedfirmware-a-tests.readthedocs.io/en/v2.6/
[4] https://confluence.arm.com/display/BSGSoftware/TF-A+v2.6+Test+Plan+and+Resu…
[5] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/tag/?h=v2.6
[6] https://git.trustedfirmware.org/TF-A/tf-a-tests.git/tag/?h=v2.6
[7] https://git.trustedfirmware.org/hafnium/hafnium.git/tag/?h=v2.6
[8] https://git.trustedfirmware.org/ci/tf-a-ci-scripts.git/tag/?h=v2.6
Thanks & best regards,
[cid:image001.jpg@01D7E120.C34F0DA0]
Bipin Ravi | Principal Design Engineer
Bipin.Ravi(a)arm.com<mailto:Bipin.Ravi@arm.com> | Skype: Bipin.Ravi.ARM
Direct: +1-512-225 -1071 | Mobile: +1-214-212-0794
5707 Southwest Parkway, Suite 100, Austin, TX 78735
Hi.
I'm trying to run on our new platform Linux as BL33, preloaded to DDR.
currently simulated over QEMU.
I think that BL31 started BL33 in EL0, which cause problems:
QEMU outputs this message: (complete log below)
Exception return from AArch64 EL3 to AArch64 EL0 PC 0x800080000
What could I have done wrong in the configuration that caused it ?
What should I check ?
Thanks !
Ramon.
NOTICE: Booting Trusted Firmware
NOTICE: BL1: v2.5(debug):v2.5-61-g84d7d6a30-dirty
NOTICE: BL1: Built : 14:53:02, Nov 21 2021
INFO: BL1: RAM 0x15500000 - 0x15513000
WARNING: BL1: neoverse_n1: CPU workaround for 1946160 was missing!
INFO: BL1: Loading BL2
INFO: Using mmap
INFO: Using FIP
INFO: Loading image id=1 at address 0x14300000
INFO: Image id=1 loaded: 0x14300000 - 0x143052d1
INFO: bl1_mem_layout->total_base = 0x14000000x
NOTICE: BL1: Booting BL2
INFO: Entry point address = 0x14300000
INFO: SPSR = 0x3c5
Exception return from AArch64 EL3 to AArch64 EL1 PC 0x14300000
INFO: BL1 inherited memory layout: 0x14000000 [size = 22020096]
NOTICE: BL2: v2.5(debug):v2.5-61-g84d7d6a30-dirty
NOTICE: BL2: Built : 14:53:02, Nov 21 2021
INFO: BL2: Skip loading image id 23
INFO: BL2: Doing platform setup
INFO: BL2: Loading image id 3
INFO: Using mmap
INFO: Using FIP
INFO: Loading image id=3 at address 0x800000000
INFO: Image id=3 loaded: 0x800000000 - 0x8000080a9
INFO: BL2: Skip loading image id 5
Taking exception 13 [Secure Monitor Call]
...from EL1 to EL3
...with ESR 0x17/0x5e000000
...with ELR 0x14302a04
...to EL3 PC 0x5400 PSTATE 0x3cd
NOTICE: BL1: Booting BL31
INFO: Entry point address = 0x800000000
INFO: SPSR = 0x3cd
Exception return from AArch64 EL3 to AArch64 EL3 PC 0x800000000
INFO: Boot BL33 from 0x800080000 for 0 Bytes
NOTICE: BL31: v2.5(debug):v2.5-61-g84d7d6a30-dirty
NOTICE: BL31: Built : 14:53:04, Nov 21 2021
INFO: GICv3 without legacy support detected.
INFO: ARM GICv3 driver initialized in EL3
INFO: Maximum SPI INTID supported: 63
INFO: BL31: Initializing runtime services
WARNING: BL31: neoverse_n1: CPU workaround for 1946160 was missing!
INFO: BL31: Preparing for EL3 exit to normal world
INFO: Entry point address = 0x800080000
INFO: SPSR = 0x0
Exception return from AArch64 EL3 to AArch64 EL0 PC 0x800080000
Taking exception 1 [Undefined Instruction]
...from EL0 to EL1
...with ESR 0x18/0x6232c061
...with ELR 0x8000b7164
...to EL1 PC 0x400 PSTATE 0x3c5
Taking exception 4 [Data Abort]
This event has been canceled with this note:
"Cancelling TF-A Tech Forum this week as the team have nothing to present.
We expect to have a topic for December 2nd."
Title: TF-A Tech Forum
We run an open technical forum call for anyone to participate and it is not
restricted to Trusted Firmware project members. It will operate under the
guidance of the TF TSC. Feel free to forward this invite to
colleagues. Invites are via the TF-A mailing list and also published on the
Trusted Firmware website. Details are
here: https://www.trustedfirmware.org/meetings/tf-a-technical-forum/Tr…
Firmware is inviting you to a scheduled Zoom meeting.Join Zoom
Meetinghttps://zoom.us/j/9159704974Meeting ID: 915 970 4974One tap
mobile+16465588656,,9159704974# US (New York)+16699009128,,9159704974# US
(San Jose)Dial by your location +1 646 558
8656 US (New York) +1 669 900
9128 US (San Jose) 877 853 5247 US
Toll-free 888 788 0099 US Toll-freeMeeting ID:
915 970 4974Find your local
number: https://zoom.us/u/ad27hc6t7h
When: Thu Nov 18, 2021 4pm – 5pm United Kingdom Time
Calendar: tf-a(a)lists.trustedfirmware.org
Who:
* Bill Fletcher - creator
* marek.bykowski(a)gmail.com
* okash.khawaja(a)gmail.com
* tf-a(a)lists.trustedfirmware.org
Invitation from Google Calendar: https://calendar.google.com/calendar/
You are receiving this courtesy email at the account
tf-a(a)lists.trustedfirmware.org because you are an attendee of this event.
To stop receiving future updates for this event, decline this event.
Alternatively you can sign up for a Google account at
https://calendar.google.com/calendar/ and control your notification
settings for your entire calendar.
Forwarding this invitation could allow any recipient to send a response to
the organizer and be added to the guest list, or invite others regardless
of their own invitation status, or to modify your RSVP. Learn more at
https://support.google.com/calendar/answer/37135#forwarding
Hi Pali,
My understanding of the errata reporting mechanism is that some erratas are always checked during CPU boot. If the corresponding MACRO (ERRATA_A53_*) is disabled, then the ERRATA_MISSING code is reported.
I would be concerned if the CPU is affected by the errata. If the errata needs to be enabled, the fix would be to enable the ERRATA_A53_* from the platform makefile.
Hope this helps.
-Varun
-----Original Message-----
From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org> On Behalf Of Pali Rohár via TF-A
Sent: Wednesday, July 7, 2021 9:11 PM
To: Olivier Deprez <Olivier.Deprez(a)arm.com>; Bipin Ravi <Bipin.Ravi(a)arm.com>; tf-a(a)lists.trustedfirmware.org
Cc: Konstantin Porotchkin <kostap(a)marvell.com>; Marek Behún <marek.behun(a)nic.cz>
Subject: Re: [TF-A] Missing CPU workaround warning message
External email: Use caution opening links or attachments
Hello! Could somebody from TF-A helps with these two topics? I would really need to know if "missing errata warnings" debug message is some critical and needs to be fixed (and how?) or it is just a debug message and therefore should not be a warning...
On Monday 28 June 2021 17:11:18 Pali Rohár wrote:
> On Monday 28 June 2021 14:03:06 Olivier Deprez wrote:
> > Hi,
> >
> > Is the question strictly related to this platform not implementing the mentioned errata (for which a platform change can be emitted)?
>
> Hello! The first question is if this is an issue that CPU workaround
> is missing. And if yes (which seems to be) how big issue it is? And
> how to resolve it?
>
> > Or is it more generally that those "missing errata warnings" are not printed in release mode?
> > Assuming the latter, it looks to me it is the integrator mistake to not include the appropriate mitigations at development phase (hence while using debug mode for building TF-A).
> > Then when the device is deployed (hence most often built for release mode), if this message is printed it is an indication for a malicious agent that such attack vector through mis-implemented errata is possible. So the consequence is possibly even worst than just "missing" to include the errata.
> >
> > Other TF-Aers (Bipin?) may have other opinions?
>
> And this is a second question. If missing CPU workaround is an issue,
> should not be it printed also in release build?
>
> Also I see that in release builds are omitted not only messages about
> missing CPU workarounds, but basically _all_ warning messages. But
> notice messages are _not_ omitted. Which seems strange as in most
> cases notice message has lower priority than warning message.
>
> >
> > Regards,
> > Olivier.
> >
> > ________________________________________
> > From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org> on behalf of
> > Pali Rohár via TF-A <tf-a(a)lists.trustedfirmware.org>
> > Sent: 28 June 2021 15:36
> > To: tf-a(a)lists.trustedfirmware.org
> > Cc: Konstantin Porotchkin; Marek Behún
> > Subject: [TF-A] Missing CPU workaround warning message
> >
> > Hello! If TF-A for Marvell Armada 3720 platform is compiled in debug
> > mode then at runtime it prints following warning messages:
> >
> > WARNING: BL1: cortex_a53: CPU workaround for 855873 was missing!
> > WARNING: BL1: cortex_a53: CPU workaround for 1530924 was missing!
> >
> > These lines are not printed in non-debug mode. It is an issue?
> > --
> > TF-A mailing list
> > TF-A(a)lists.trustedfirmware.org
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
> > sts.trustedfirmware.org%2Fmailman%2Flistinfo%2Ftf-a&data=04%7C01
> > %7Cvwadekar%40nvidia.com%7Cb3605175f552468740e708d941836783%7C43083d
> > 15727340c1b7db39efd9ccc17a%7C0%7C0%7C637612854914595696%7CUnknown%7C
> > TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJX
> > VCI6Mn0%3D%7C1000&sdata=%2FW6HuFPYQCD5ECIA%2FZZxhm5ti5HYILNlsWTz
> > moJ7L8E%3D&reserved=0
--
TF-A mailing list
TF-A(a)lists.trustedfirmware.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.tru…
<Adding TF-A mailing list to the discussion>
Thanks, Soby. I agree that this needs to be re-evaluated for platforms. I think we should introduce an option to disable them, if required.
We plan to try some more experiments and hopefully remove the locks at least for Tegra platforms.
Looking forward to the elaborate answer.
From: Soby Mathew <Soby.Mathew(a)arm.com>
Sent: Tuesday, 2 November 2021 10:18 AM
To: Varun Wadekar <vwadekar(a)nvidia.com>; Manish Pandey2 <Manish.Pandey2(a)arm.com>; Dan Handley <Dan.Handley(a)arm.com>
Cc: Joanna Farley <Joanna.Farley(a)arm.com>; Matteo Carlini <Matteo.Carlini(a)arm.com>
Subject: RE: PSCI lock contention
External email: Use caution opening links or attachments
Hi Varun,
The short answer is that the locks are used to differentiate the last-CPU-to-suspend and similarly first-CPU-to-powerup at a given power domain level. Now, recent CPU features like DynamIQ means that we don't need to do this differentiation upto cluster level which TF-A hasn't optimized for yet AFAICS. I am happy to elaborate further , but could you please send the query to the TF-A mailing list as I would prefer this discussion to happen in the open if possible.
Best Regards
Soby Mathew
From: Varun Wadekar <vwadekar(a)nvidia.com<mailto:vwadekar@nvidia.com>>
Sent: 01 November 2021 20:14
To: Soby Mathew <Soby.Mathew(a)arm.com<mailto:Soby.Mathew@arm.com>>; Manish Pandey2 <Manish.Pandey2(a)arm.com<mailto:Manish.Pandey2@arm.com>>; Dan Handley <Dan.Handley(a)arm.com<mailto:Dan.Handley@arm.com>>
Cc: Joanna Farley <Joanna.Farley(a)arm.com<mailto:Joanna.Farley@arm.com>>; Matteo Carlini <Matteo.Carlini(a)arm.com<mailto:Matteo.Carlini@arm.com>>
Subject: PSCI lock contention
Hi,
We were trying performance benchmarking for CPU_SUSPEND on Tegra platforms. We take all CPU cores to CPU_SUSPEND and then wake them up with IPI - all at once and in serial order. From the numbers, we see that the CPUs powering up later take more time than the first one. We have narrowed the most time consumed to the PSCI locks - documented at docs/perf/psci-performance-juno.rst.
Can you please help me understand why these locks were added? As a quick experiment we tried the same benchmarking *without* the locks and the firmware does not blow up, but I would like to understand the impact from the analysis on Juno (docs/perf/psci-performance-juno.rst)
Happy to hop on a call to discuss further.
Thanks.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
TF-A Community,
Just a reminder we are looking to freeze the tree for release activities starting Monday.
Thanks
Joanna
From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org> on behalf of Joanna Farley via TF-A <tf-a(a)lists.trustedfirmware.org>
Reply to: Joanna Farley <Joanna.Farley(a)arm.com>
Date: Monday, 1 November 2021 at 12:41
To: Joanna Farley via TF-A <tf-a(a)lists.trustedfirmware.org>
Subject: [TF-A] Trusted Firmware-A v2.6 release activities in November
TF-A Community,
This is to notify that we are planning to target the Trusted Firmware-A 2.6 release during the fourth week of Nov 2021 as part of the regular 6 month cadence.
The aim is to consolidate all TF-A work since the 2.5 release. As part of this, a release candidate tag will be created and release activities will commence from 15th November 2021 across all TF-A repositories.
Essentially we will not merge any major enhancements from this date until the release is made.
Please ensure any patches desired to make the 2.6 release are submitted in good time to be complete by 12th November 2021.
Any major enhancement patches still open after that date will not be merged until after the release.
This will involve the various repositories making up the broader TF-A project including the TF-A mainline, TF-A Tests, Hafnium, TF-A CI Scripts and TF-A CI Jobs.
We will endeavour minimise the disruption on patch merging and complete release activities ASAP after we start.
Thanks
Joanna
This event has been canceled with this note:
"No TF-A Tech Forum scheduled this week so cancelling."
Title: TF-A Tech Forum
We run an open technical forum call for anyone to participate and it is not
restricted to Trusted Firmware project members. It will operate under the
guidance of the TF TSC. Feel free to forward this invite to
colleagues. Invites are via the TF-A mailing list and also published on the
Trusted Firmware website. Details are
here: https://www.trustedfirmware.org/meetings/tf-a-technical-forum/Tr…
Firmware is inviting you to a scheduled Zoom meeting.Join Zoom
Meetinghttps://zoom.us/j/9159704974Meeting ID: 915 970 4974One tap
mobile+16465588656,,9159704974# US (New York)+16699009128,,9159704974# US
(San Jose)Dial by your location +1 646 558
8656 US (New York) +1 669 900
9128 US (San Jose) 877 853 5247 US
Toll-free 888 788 0099 US Toll-freeMeeting ID:
915 970 4974Find your local
number: https://zoom.us/u/ad27hc6t7h
When: Thu Nov 4, 2021 4pm – 5pm United Kingdom Time
Calendar: tf-a(a)lists.trustedfirmware.org
Who:
* Bill Fletcher - creator
* marek.bykowski(a)gmail.com
* okash.khawaja(a)gmail.com
* tf-a(a)lists.trustedfirmware.org
Invitation from Google Calendar: https://calendar.google.com/calendar/
You are receiving this courtesy email at the account
tf-a(a)lists.trustedfirmware.org because you are an attendee of this event.
To stop receiving future updates for this event, decline this event.
Alternatively you can sign up for a Google account at
https://calendar.google.com/calendar/ and control your notification
settings for your entire calendar.
Forwarding this invitation could allow any recipient to send a response to
the organizer and be added to the guest list, or invite others regardless
of their own invitation status, or to modify your RSVP. Learn more at
https://support.google.com/calendar/answer/37135#forwarding
Forwarded on to TF-A Mail list. Seems postings from people with gmail.com email domains get automatically rejected, sorry Ramon not sure if that can be addressed.
Joanna
On 03/11/2021, 14:20, "Ramon Fried" <rfried.dev(a)gmail.com> wrote:
Hi.
I'm trying to run the example in TF-A documentation.
I found two problems.
First, the files: "tee-header_v2.bin, tee-pager_v2.bin,
tee-pageable_v2.bin" are not provided as binary downloads, and
instructions on how to get them are missing. turn's out you need to
build optee, but this step is skipped if you choose to download the
QEMU_EFI.fd from Linaro.
Second,
after following the instructions step by step resulted in the following error:
qemu-system-aarch64 -nographic -machine virt,secure=on -cpu cortex-a57
-kernel Image -no-acpi -append
'console=ttyAMA0,38400 keep_bootcon' -initrd rootfs.cpio.gz -smp
2 -m 1024 -bios flash.bin -d unimp
NOTICE: Booting Trusted Firmware
NOTICE: BL1: v2.5(release):v2.5-60-g7737fdf0e
NOTICE: BL1: Built : 13:12:39, Nov 3 2021
NOTICE: BL1: Booting BL2
NOTICE: BL2: v2.5(release):v2.5-60-g7737fdf0e
NOTICE: BL2: Built : 13:12:42, Nov 3 2021
NOTICE: BL1: Booting BL31
NOTICE: BL31: v2.5(release):v2.5-60-g7737fdf0e
NOTICE: BL31: Built : 13:12:45, Nov 3 2021
read access to unsupported AArch64 system register op0:3 op1:0 crn:12
crm:12 op2:4
This occurs on Qemu 5.0 and also 6.0
Thanks,
Ramon.
TF-A Community,
This is to notify that we are planning to target the Trusted Firmware-A 2.6 release during the fourth week of Nov 2021 as part of the regular 6 month cadence.
The aim is to consolidate all TF-A work since the 2.5 release. As part of this, a release candidate tag will be created and release activities will commence from 15th November 2021 across all TF-A repositories.
Essentially we will not merge any major enhancements from this date until the release is made.
Please ensure any patches desired to make the 2.6 release are submitted in good time to be complete by 12th November 2021.
Any major enhancement patches still open after that date will not be merged until after the release.
This will involve the various repositories making up the broader TF-A project including the TF-A mainline, TF-A Tests, Hafnium, TF-A CI Scripts and TF-A CI Jobs.
We will endeavour minimise the disruption on patch merging and complete release activities ASAP after we start.
Thanks
Joanna
Hi all,
What is the resolution for secure memory space with the Trust zone?
Is it dependent on the MMU resolution? Means, for example, If my MMU can set a range of 16 KB so can I set that range as a trusted zone as well?
P.S. I have ARM A35 (I am not sure but I think my MMU supports a resolution of 32KB)
You are welcome to comment if I have any mistakes
Thanks a lot,
Boaz.
________________________________
The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Nuvoton is strictly prohibited; and any information in this email irrelevant to the official business of Nuvoton shall be deemed as neither given nor endorsed by Nuvoton.
I want to know if we have a chance to support the compiler-based CFI(eg clang cfi, kernel support it.) function in tf-a.
I want to know that is anyone doing this, or if everyone is interested in this?
Cheers,
Feng
Hi HPChen
1. Can try setting PLATFORM_MAX_AFFLVL to MPIDR_AFFLVL2? I am assuming your platform has 1 cluster with 2 cores.
2. The project currently supports a limited number of platforms. The default test suite[1] contains several smaller test suites. The tests are designed to auto-detect critical features supported by the platform. Rather than fail, tftf will skip tests if a feature is not supported.
Please refer to the documentation for the tf-a-tests project here: https://trustedfirmware-a-tests.readthedocs.io/en/latest/index.html
[1] https://git.trustedfirmware.org/TF-A/tf-a-tests.git/tree/tftf/tests/tests-s…
Thanks,
Madhukar
-----Original Message-----
From: TF-A <mailman-bounces(a)lists.trustedfirmware.org> On Behalf Of MS10 HPChen0
Sent: Tuesday, October 12, 2021 10:43 PM
To: tf-a-owner(a)lists.trustedfirmware.org
Subject: TFA affinity power level
Hi,
I'm Nuvoton software engineer. We have an A35 dual core platform. I ported the TFA for this platform.
Now I want test the TFA on test suite. I have some questions. Please help to answer. Thanks!
1. If define 'PLATFORM_MAX_AFFLVL' to MPIDR_AFFLVL1. The tftf test only identify single core no matter 'PLATFORM_CORES_PER_CLUSTER' define to 2.
How should I define 'PLATFORM_MAX_AFFLVL'?
2. How to select the test items? Should our platform need to pass all test items? Now I only test the tftf.
I'm new for TFA. Please help. Thanks!
Best regards,
HPChen
________________________________
________________________________
The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Nuvoton is strictly prohibited; and any information in this email irrelevant to the official business of Nuvoton shall be deemed as neither given nor endorsed by Nuvoton.
I noticed TF-A currently supports passing in 4 parameters and returning
up to 8. But SMCCC 1.1+ supports passing up to 18 and returning 18 in
AArch64 mode, and passing in/out 8 in AArch32.
I was wondering if there are any plans to add support for handling the
full set of parameters?
--
Rebecca Cran
Hi
I'm new to TF-A and OP Tee.
While I am using qemu to start TF-A, I got BL1 detected and failed to load
BL2, due to BL2 size out of bounds.
I changed TF-A BL1 source code to show more information:
diff --git a/common/bl_common.c b/common/bl_common.c
index 2fcb5385d9..a6239a5257 100644
--- a/common/bl_common.c
+++ b/common/bl_common.c
@@ -110,7 +111,7 @@ static int load_image(unsigned int image_id,
image_info_t *image_data)
/* Check that the image size to load is within limit */
if (image_size > image_data->image_max_size) {
- WARN("Image id=%u size out of bounds\n", image_id);
+ WARN("Image id=%u size(%lu, %u) out of bounds\n", image_id,
image_size, image_data->image_max_size);
io_result = -EFBIG;
goto exit;
}
the log shows:
NOTICE: Booting Trusted Firmware
NOTICE: BL1: v2.3():v2.3-dirty
NOTICE: BL1: Built : 15:56:43, Apr 20 2020
INFO: BL1: RAM 0xe04e000 - 0xe056000
VERBOSE: BL1: cortex_a57: CPU workaround for 806969 was not applied
WARNING: BL1: cortex_a57: CPU workaround for 813419 was missing!
VERBOSE: BL1: cortex_a57: CPU workaround for 813420 was not applied
VERBOSE: BL1: cortex_a57: CPU workaround for 814670 was not applied
WARNING: BL1: cortex_a57: CPU workaround for 817169 was missing!
INFO: BL1: cortex_a57: CPU workaround for disable_ldnp_overread was
applied
WARNING: BL1: cortex_a57: CPU workaround for 826974 was missing!
WARNING: BL1: cortex_a57: CPU workaround for 826977 was missing!
WARNING: BL1: cortex_a57: CPU workaround for 828024 was missing!
WARNING: BL1: cortex_a57: CPU workaround for 829520 was missing!
WARNING: BL1: cortex_a57: CPU workaround for 833471 was missing!
WARNING: BL1: cortex_a57: CPU workaround for 859972 was missing!
INFO: BL1: cortex_a57: CPU workaround for cve_2017_5715 was applied
INFO: BL1: cortex_a57: CPU workaround for cve_2018_3639 was applied
INFO: BL1: Loading BL2
VERBOSE: Using Memmap
WARNING: Firmware Image Package header check failed.
VERBOSE: Trying alternative IO
VERBOSE: Using Semi-hosting IO
INFO: Loading image id=1 at address 0xe01b000
WARNING: Image id=1 size(4294967295, 151552) out of bounds
ERROR: Failed to load BL2 firmware.
I'm using yocto (dunfell) + meta-arm to build / test TF-A + OP TEE under
qemuarm64.
meta-arm rev: c4f04f3fb66f8f4365b08b553af8206372e90a63
variables defined inside conf/local.conf ( for test )
23 MACHINE ?= "qemuarm64"
25
26 INSANE_SKIP_pn-optee-examples = "ldflags"
27 COMPATIBLE_MACHINE_pn-optee-examples = "qemuarm64"
28 COMPATIBLE_MACHINE_pn-optee-os = "qemuarm64"
29 COMPATIBLE_MACHINE_pn-optee-client = "qemuarm64"
30 COMPATIBLE_MACHINE_pn-trusted-firmware-a = "qemuarm64"
31
32 TFA_PLATFORM = "qemu"
33 TFA_UBOOT = "1"
34 TFA_DEBUG = "1"
35 TFA_SPD = "opteed"
36 TFA_BUILD_TARGET = "bl1 bl2 bl31"
37
38 OPTEEMACHINE:qemuarm64 = "vexpress-qemu_armv8a"
39 OPTEEOUTPUTMACHINE:qemuarm64 = "vexpress"
40
41 UBOOT_MACHINE_qemuarm64 = "qemu_arm64_defconfig"
I started qemu using following command line:
BIOS=tmp/deploy/images/qemuarm64/bl1.bin \
KERNEL=tmp/deploy/images/qemuarm64/Image-qemuarm64.bin \
runqemu mydefined-image-core-image-dev-optee nographic -d \
qemuparams=" \
-machine secure=on \
-m 4096 \
-d unimp -semihosting -semihosting-config enable=on,target=native \
"
Thanks
Hi all,
We made a few changes to the UFS driver. The proposed patches are posted
here:
https://review.trustedfirmware.org/q/topic:%22ufs_patches%22+(status:open%2…
.
The patches mainly consist of the below changes:
1. Delete asserts. Return error values instead.
2. Add retry logic and timeouts.
3. Reuse ufshc_send_uic_cmd() for DME_GET and DME_SET commands.
Any feedback/comments on these patches would be greatly appreciated.
Thanks!
Jorge Troncoso
+ TF-A ML (for the benefit of other trying to use firmware encryption
feature)
Hi Promod,
On Fri, 8 Oct 2021 at 00:09, pramod kumar <pramod.jnumca04(a)gmail.com> wrote:
> Hi Sumit,
>
> This is Pramod, Presently working in Amazon Lab126. I'm working in ATF and
> was going through your patch which provides f/w image encryption/decryption
> support.
>
> commit 7cda17bb0f92db39d123a4f2a1732c9978556453
> Author: Sumit Garg <sumit.garg(a)linaro.org>
> Date: Fri Nov 15 10:43:00 2019 +0530
>
> drivers: crypto: Add authenticated decryption framework
>
> Add framework for autheticated decryption of data. Currently this
> patch optionally imports mbedtls library as a backend if build option
> "DECRYPTION_SUPPORT = aes_gcm" is set to perform authenticated
> decryption
> using AES-GCM algorithm.
>
> Signed-off-by: Sumit Garg <sumit.garg(a)linaro.org>
> Change-Id: I2966f0e79033151012bf4ffc66f484cd949e7271
>
> I see that this support comes under DECRYPTION_SUPPORT macro hence can't
> be used dynamically. I see the TBBR spec provides a flag for this which
> could be used to exercise this feature dynamically-
> [image: image.png]
>
>
> Just wanted to understand that did you see any limitation to use this flag
> for making this feature support dynamically? Or do you have any plan to
> push follow up patches for this?
>
>
Actually there are security concerns associated if we use an unsigned
encryption flag in the header (see earlier discussions [1]).
> If this feature is made available, with the help of "disable_auth" flag,
> BL1 would be able to boot plane images even when TRUSTED_BOARD_BOOT is
> enabled in development mode.
>
I agree here that it would be useful to have such a flag in development
mode. For TRUSTED_BOARD_BOOT in development mode, I guess you are referring
to DYN_DISABLE_AUTH. If yes then I think such a macro makes sense for
encryption as well in order to disable decryption at runtime in development
mode, patches are very much welcome.
[1]
https://lists.trustedfirmware.org/pipermail/tf-a/2020-February/000288.html
-Sumit
> Regards,
> Pramod
>
Hi All,
We have refactored/redesigned the existing measured boot driver present in the TF-A repo to support it with multiple backend driver(s) (for example, TCG Event Log, physical TPM, etc) instead of it being strongly coupled with the TCG Event Log driver.
Proposed refactored patches are posted here: https://review.trustedfirmware.org/q/topic:%22refactor-mb%22+(status:open%2…
Any feedback/comments on these patches are much appreciated.
These patches mainly consist of the below changes:
1. Move image measurement in the generic layer, just after loading and authentication of the image. Previously, the platform layer was responsible for the measurement. For example, the Arm FVP platform layer was doing it as part of the post-load hook operation.
2. Measurement and recording of the images loaded by BL1. Previously, DTB config files loaded by BL1 were not part of measured at all. Also, it looks safer and cleaner approach to record the measurement taken by BL1 straightaway in TCG Event log buffer/physical TPM/any other TPM backend instead of deferring these recordings to BL2.
3. Pass Event Log buffer information from BL1 to BL2 so that the TCG Event Log buffer initialised by BL1 extended further with the measurements taken by BL2.
Note: These patches neither add any new functional backend driver for measured boot nor update any existing backend driver functionality (i.e. TCG Event Log driver). These changes only structured the measured boot code to provide a space to plug in any new backend driver(s) in future for the measured boot.
Thanks,
Manish Badarkhe
This event has been canceled with this note:
"Cancelling this weeks TF-A Tech Forum as we have no subjects/topics to
present for this meeting.
The TF-A project community is always looking for subjects/topics so if you
have something to present/discuss please do reach out to me and we can
schedule a session.
Thanks all."
Title: TF-A Tech Forum
We run an open technical forum call for anyone to participate and it is not
restricted to Trusted Firmware project members. It will operate under the
guidance of the TF TSC. Feel free to forward this invite to
colleagues. Invites are via the TF-A mailing list and also published on the
Trusted Firmware website. Details are
here: https://www.trustedfirmware.org/meetings/tf-a-technical-forum/Tr…
Firmware is inviting you to a scheduled Zoom meeting.Join Zoom
Meetinghttps://zoom.us/j/9159704974Meeting ID: 915 970 4974One tap
mobile+16465588656,,9159704974# US (New York)+16699009128,,9159704974# US
(San Jose)Dial by your location +1 646 558
8656 US (New York) +1 669 900
9128 US (San Jose) 877 853 5247 US
Toll-free 888 788 0099 US Toll-freeMeeting ID:
915 970 4974Find your local
number: https://zoom.us/u/ad27hc6t7h
When: Thu Oct 7, 2021 4pm – 5pm United Kingdom Time
Calendar: tf-a(a)lists.trustedfirmware.org
Who:
* Bill Fletcher - creator
* marek.bykowski(a)gmail.com
* okash.khawaja(a)gmail.com
* tf-a(a)lists.trustedfirmware.org
Invitation from Google Calendar: https://calendar.google.com/calendar/
You are receiving this courtesy email at the account
tf-a(a)lists.trustedfirmware.org because you are an attendee of this event.
To stop receiving future updates for this event, decline this event.
Alternatively you can sign up for a Google account at
https://calendar.google.com/calendar/ and control your notification
settings for your entire calendar.
Forwarding this invitation could allow any recipient to send a response to
the organizer and be added to the guest list, or invite others regardless
of their own invitation status, or to modify your RSVP. Learn more at
https://support.google.com/calendar/answer/37135#forwarding
Hi all,
I tried submitting a change for review at https://review.trustedfirmware.org,
but I ran into authentication issues.
1. First try (https):
$ git push origin HEAD:refs/for/integration
Username for 'https://review.trustedfirmware.org': jatron
Password for 'https://jatron@review.trustedfirmware.org':
remote: Unauthorized
fatal: Authentication failed for '
https://review.trustedfirmware.org/TF-A/trusted-firmware-a/'
I tried clicking "GENERATE NEW PASSWORD" in
https://review.trustedfirmware.org/settings/, but I got the following
error message:
An error occurred
Error 500 (Server Error): Internal server error
Endpoint: /accounts/self/password.http
2. Second try (ssh):
I got the following error message when I tried registering a new SSH key
for use with Gerrit. This happened when I clicked "ADD NEW SSH KEY" in
https://review.trustedfirmware.org/settings/.
An error occurred
Error 500 (Server Error): Internal server error
Endpoint: /accounts/self/sshkeys
The error message didn't stop the GUI from recording my key though. My new
key was listed under "SSH keys" after the change. When I ran a git push
command using ssh, I got the following error.
$ git push ssh://jatron@review.trustedfirmware.org/TF-A/trusted-firmware-a
HEAD:refs/for/integration
jatron(a)review.trustedfirmware.org: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Am I doing something incorrectly? Any help would be much appreciated. If
this is not the mailing list for these types of questions, please let me
know so I can reroute my email to the proper destination.
Thanks,
Jorge Troncoso
Hi all,
I'm planning to submit a series of patches that aim to improve the
robustness and reusability of the UFS code. The impacted files
are drivers/ufs/ufs.c and include/drivers/ufs.h. The patches mainly consist
of the below changes:
1. Delete asserts. Return error values instead.
2. Add retry logic and timeouts.
3. Remove infinite loops.
4. Reuse ufshc_send_uic_cmd() for DME_GET and DME_SET commands.
5. Add a function ufs_send_cmd() that can be reused in other places.
ufs_send_cmd() calls four functions in
sequence: get_utrd(&utrd), ufs_prepare_cmd(&utrd,
...), ufs_send_request(utrd.task_tag), and ufs_check_resp(&utrd,
RESPONSE_UPIU).
I wanted to give everyone visibility of what is coming up and hopefully
start a discussion around this work. Any early input to help shape the
design would be much appreciated.
Thanks,
Jorge Troncoso
Hi all,
I want to write a TA which will be called from the Normal World and be
handled by a specific Trusted OS. Currently, I am using 3 Cactus OS
(provided by TF-A-Tests) in SEL1, and a Hafnium in SEL2. Here is my partial
building cmd
make CROSS_COMPILE=aarch64-none-elf- SPD=spmd CTX_INCLUDE_EL2_REGS=1
ARM_ARCH_MINOR=4 PLAT=fvp DEBUG=1
BL33=../tf-a-tests/build/fvp/debug/tftf.bin
BL32=../hafnium/out/reference/secure_aem_v8a_fvp_clang/hafnium.bin
SP_LAYOUT_FILE=../tf-a-tests/build/fvp/debug/sp_layout.json all fip
I have created some EL3 services at services/std_svc, but have not created
a TA.
In my view, to call the TA, I think I should pass (1) the ID of the TA (but
I am not sure how to get the ID) (2) several parameters, which may be
loaded into registers. Here may be a calling process.
ldr x0,=0xdeadbeef // loading ID
ldr x1,=0x11111 // input parameters
ldr x2,=0x22222 // input parameters
smc #0
Then I think I should write a corresponding handler (of the TA) in Cactus
OS. When we call "smc #0", EL3 will trap it, and route it to a specific TA.
However, I don't know how to do it. Can you provide some useful examples?
Sincerely,
Wang Chenxu
Hello,
Last Thursday we got an issue on our @foss.st.com mail server,
preventing us from receiving mails.
The issue was corrected, and I can now correctly receive mails, except
the ones from trustedfirmware.org.
Is there some kind of filtering on trustedfirmware.org side, as those
addresses got error replies?
I've tried to delete my yann.gautier(a)foss.st.com in the trusted firmware
gerrit settings, to re-enter it again, but I cannot receive the
verification e-mail.
Could you check if @foss.st.com addresses are rejected somewhere?
Thanks,
Yann
Hi,
Please find the latest report on new defect(s) introduced to ARM-software/arm-trusted-firmware found with Coverity Scan.
3 new defect(s) introduced to ARM-software/arm-trusted-firmware found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 3 of 3 defect(s)
** CID 373165: Code maintainability issues (UNUSED_VALUE)
/plat/mediatek/mt8195/drivers/spm/mt_spm_vcorefs.c: 467 in spm_vcorefs_get_vcore()
________________________________________________________________________________________________________
*** CID 373165: Code maintainability issues (UNUSED_VALUE)
/plat/mediatek/mt8195/drivers/spm/mt_spm_vcorefs.c: 467 in spm_vcorefs_get_vcore()
461 int spm_vcorefs_get_vcore(unsigned int gear)
462 {
463 int ret_val;
464
465 switch (gear) {
466 case 3:
>>> CID 373165: Code maintainability issues (UNUSED_VALUE)
>>> Assigning value from "vcore_opp_0_uv" to "ret_val" here, but that stored value is overwritten before it can be used.
467 ret_val = vcore_opp_0_uv;
468 case 2:
469 ret_val = vcore_opp_1_uv;
470 case 1:
471 ret_val = vcore_opp_2_uv;
472 case 0:
** CID 373164: Code maintainability issues (UNUSED_VALUE)
/plat/mediatek/mt8195/drivers/spm/mt_spm_vcorefs.c: 471 in spm_vcorefs_get_vcore()
________________________________________________________________________________________________________
*** CID 373164: Code maintainability issues (UNUSED_VALUE)
/plat/mediatek/mt8195/drivers/spm/mt_spm_vcorefs.c: 471 in spm_vcorefs_get_vcore()
465 switch (gear) {
466 case 3:
467 ret_val = vcore_opp_0_uv;
468 case 2:
469 ret_val = vcore_opp_1_uv;
470 case 1:
>>> CID 373164: Code maintainability issues (UNUSED_VALUE)
>>> Assigning value from "vcore_opp_2_uv" to "ret_val" here, but that stored value is overwritten before it can be used.
471 ret_val = vcore_opp_2_uv;
472 case 0:
473 default:
474 ret_val = vcore_opp_3_uv;
475 }
476 return ret_val;
** CID 373163: Code maintainability issues (UNUSED_VALUE)
/plat/mediatek/mt8195/drivers/spm/mt_spm_vcorefs.c: 469 in spm_vcorefs_get_vcore()
________________________________________________________________________________________________________
*** CID 373163: Code maintainability issues (UNUSED_VALUE)
/plat/mediatek/mt8195/drivers/spm/mt_spm_vcorefs.c: 469 in spm_vcorefs_get_vcore()
463 int ret_val;
464
465 switch (gear) {
466 case 3:
467 ret_val = vcore_opp_0_uv;
468 case 2:
>>> CID 373163: Code maintainability issues (UNUSED_VALUE)
>>> Assigning value from "vcore_opp_1_uv" to "ret_val" here, but that stored value is overwritten before it can be used.
469 ret_val = vcore_opp_1_uv;
470 case 1:
471 ret_val = vcore_opp_2_uv;
472 case 0:
473 default:
474 ret_val = vcore_opp_3_uv;
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P…
Hi all,
I have a little question, how can I disable the hypervisor mode so EL2 will be just bridge to EL1 ns?
(I mean without touching common ARM code only the platform-oriented code)
Thanks,
Boaz.
________________________________
The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Nuvoton is strictly prohibited; and any information in this email irrelevant to the official business of Nuvoton shall be deemed as neither given nor endorsed by Nuvoton.
This event has been canceled with this note:
"No subjects to present this week so cancelling."
Title: TF-A Tech Forum
We run an open technical forum call for anyone to participate and it is not
restricted to Trusted Firmware project members. It will operate under the
guidance of the TF TSC. Feel free to forward this invite to
colleagues. Invites are via the TF-A mailing list and also published on the
Trusted Firmware website. Details are
here: https://www.trustedfirmware.org/meetings/tf-a-technical-forum/Tr…
Firmware is inviting you to a scheduled Zoom meeting.Join Zoom
Meetinghttps://zoom.us/j/9159704974Meeting ID: 915 970 4974One tap
mobile+16465588656,,9159704974# US (New York)+16699009128,,9159704974# US
(San Jose)Dial by your location +1 646 558
8656 US (New York) +1 669 900
9128 US (San Jose) 877 853 5247 US
Toll-free 888 788 0099 US Toll-freeMeeting ID:
915 970 4974Find your local
number: https://zoom.us/u/ad27hc6t7h
When: Thu Sep 9, 2021 4pm – 5pm United Kingdom Time
Calendar: tf-a(a)lists.trustedfirmware.org
Who:
* Bill Fletcher - creator
* marek.bykowski(a)gmail.com
* okash.khawaja(a)gmail.com
* tf-a(a)lists.trustedfirmware.org
Invitation from Google Calendar: https://calendar.google.com/calendar/
You are receiving this courtesy email at the account
tf-a(a)lists.trustedfirmware.org because you are an attendee of this event.
To stop receiving future updates for this event, decline this event.
Alternatively you can sign up for a Google account at
https://calendar.google.com/calendar/ and control your notification
settings for your entire calendar.
Forwarding this invitation could allow any recipient to send a response to
the organizer and be added to the guest list, or invite others regardless
of their own invitation status, or to modify your RSVP. Learn more at
https://support.google.com/calendar/answer/37135#forwarding
Hi,
When I check the tf-static-checks for the FIP/FCONF series I pushed for
STM32MP1, I have a failure:
1d204ee4a:plat/st/common/bl2_io_storage.c:
['tools_share/firmware_image_package.h
should be in project group, after system group']
First I didn't understand the issue, as the file is in project group.
But the issue is due to previous include:
#include <plat/common/platform.h>
As it is inside include/plat directory, it is seen as a platform include.
For me the files in this include/plat/common directory are more project,
but what is your point of view?
If they are platform files, I should modify my series to reflect that.
If they are project files, then the check-include-order.py script should
be updated.
Here is what could be the correction:
diff --git a/script/static-checks/check-include-order.py
b/script/static-checks/check-include-order.py
index aaf84f1..53d355b 100755
--- a/script/static-checks/check-include-order.py
+++ b/script/static-checks/check-include-order.py
@@ -87,6 +87,8 @@ def inc_order_is_correct(inc_list, path, commit_hash=""):
incs = collections.defaultdict(list)
error_msgs = []
plat_incs = dir_include_paths("plat") |
dir_include_paths("include/plat")
+ plat_common_incs = dir_include_paths("include/plat/common")
+ plat_incs.difference_update(plat_common_incs)
libc_incs = dir_include_paths("include/lib/libc")
Best regards,
Yann
On 7/28/21 10:50 AM, guillaume pivetta via TF-A wrote:
> Hi, I’m trying to implement a secure boot on a STM32MP1 without using
> the FIP file.
>
Hi Guillaume,
Sorry for this very late reply.
> For now , I am not able to use FIP format during the boot process so I
> use a depreciated boot process with TF-Av2.2 as FSBL and U-Boot as SSBL
> to boot my Board.
>
That's quite an old software.
If you can, I'd suggest you update the software to the version delivered
by ST, based on a v2.4 label.
The sources are available there:
https://github.com/STMicroelectronics/arm-trusted-firmware
And you should take the v2.4-stm32mp branch.
In this software, FIP is available, and with a better support for
TUSTED_BOARD_BOOT.
> My boot process do Romcode -> TF-A (BL2) -> SP_min (BL32) -> U-Boot
> (BL33) -> Linux kernel
>
> I succefully implemented signature authentification between U-Boot and
> Linux image, but between TF-A and U-Boot it’s a little bit harder.
>
> I learned on ST wiki how to sign my u-boot binary with the
> STM32MP_SigningTool_CLI, but when I sign my binary with a custom private
> key, TF-A don’t authentified it on boot, even if i tryed to pass my key
> to TF-A at compilation time with the BL33_KEY argument, which i think is
> dedicated to the FIP usage.
>
> I found, in the sources of TF-A, what I think being a developpement key,
> named « arm_rotpk_ecdsa.pem ».
>
> And when I sign my binary with this key, I am able to perform the
> signature check and continu my boot process. So I tryed to change this
> key with a custom one and recompile TF-A to update the key in the final
> binary, but it seem that it is not so simple.
>
> I found yesterday that the auth_mod_init() function wasn’t call because
> I had forgotten the TUSTED_BOARD_BOOT=1 compilation argument. But when I
> activate it, the compilation doesn’t work and i see
>
> « build/arm-trusted-firmware-v2.2/bl2/bl2_main.c:91: undefined reference
> to `auth_mod_init' »
>
> Whitch traditionnaly append when linker don’t find the .o where the
> functions are implemented.
>
> I would like to know if it is possible to implement some kind of
> authentification with custom keys without FIP and if yes where can i
> find some hints/ressources/tutorial ?
>
> I don’t find a lot of ressources about secure boot without FIP so I hope
> you will be able to help me.
>
>
If you can switch to a newer software with FIP, you can check:
https://wiki.st.com/stm32mpu/wiki/How_to_configure_TF-A_FIP
Else, the page that could help you is there:
https://wiki.st.com/stm32mpu-ecosystem-v2/wiki/STM32MP15_secure_boot
If you need more help, the better is to use the links given at the
bottom of the wiki pages:
ST Support Center (https://community.st.com/s/onlinesupport) or ST
Community MPU Forum
(https://community.st.com/s/topic/0TO0X0000003u2AWAQ/stm32-mpus).
Best regards,
Yann
This event has been canceled with this note:
"Cancelling TF-A Tech forum this week as we have no scheduled topic."
Title: TF-A Tech Forum
We run an open technical forum call for anyone to participate and it is not
restricted to Trusted Firmware project members. It will operate under the
guidance of the TF TSC. Feel free to forward this invite to
colleagues. Invites are via the TF-A mailing list and also published on the
Trusted Firmware website. Details are
here: https://www.trustedfirmware.org/meetings/tf-a-technical-forum/Tr…
Firmware is inviting you to a scheduled Zoom meeting.Join Zoom
Meetinghttps://zoom.us/j/9159704974Meeting ID: 915 970 4974One tap
mobile+16465588656,,9159704974# US (New York)+16699009128,,9159704974# US
(San Jose)Dial by your location +1 646 558
8656 US (New York) +1 669 900
9128 US (San Jose) 877 853 5247 US
Toll-free 888 788 0099 US Toll-freeMeeting ID:
915 970 4974Find your local
number: https://zoom.us/u/ad27hc6t7h
When: Thu Aug 26, 2021 4pm – 5pm United Kingdom Time
Calendar: tf-a(a)lists.trustedfirmware.org
Who:
* Bill Fletcher - creator
* marek.bykowski(a)gmail.com
* okash.khawaja(a)gmail.com
* tf-a(a)lists.trustedfirmware.org
Invitation from Google Calendar: https://calendar.google.com/calendar/
You are receiving this courtesy email at the account
tf-a(a)lists.trustedfirmware.org because you are an attendee of this event.
To stop receiving future updates for this event, decline this event.
Alternatively you can sign up for a Google account at
https://calendar.google.com/calendar/ and control your notification
settings for your entire calendar.
Forwarding this invitation could allow any recipient to send a response to
the organizer and be added to the guest list, or invite others regardless
of their own invitation status, or to modify your RSVP. Learn more at
https://support.google.com/calendar/answer/37135#forwarding
Hi,
I did the test report SDEI to kernel with fatal severity in APEI / CPER while EL3 received
SEA(SCR_EL3.EA = 1). Kernel will panic and print calltrace, but this calltrace was not the
position where error occured(another word where throw SEA), instead calltrace in ghes.c.
How can SDEI solution let kernel print calltrace at right position?
For issue analysis, the right position calltrace is very useful. For ACPI firmware-first,
we set SCR_EL3.EA = 1, although the solution rethrow EA back to kernel will suffer from some
problems, but this solution can let kernel print calltrace at right position.
Best Regards,
Ming Huang
On 5/25/21 8:08 PM, James Morse via TF-A wrote:
> Hi Pali,
>
> I assume the aborts you are ignoring are precise! SError can be imprecise.
> I guess these are due to some integration issue with the PCIe root-complex. You shouldn't
> get aborts outside a RAS error. PCIe has DPC/eDPC and AER for signalling RAS errors - I
> guess these aren't supported on your platform.
>
>
> To emulte the synchronous/asynchronous exceptions means emulating what the CPU would do if
> SCR_EL3.EA weren't set. I'm not sure how familiar you are with the CPU's exception model
> and all its routing/masking controls. A short tour of what is involved:
> (the numbered references are for DDI0487G.a, they may have moved in your version)
>
>
> To emulate an exception you need to copy ESR_EL3, SPSR_EL3 and ELR_EL3 to the ESR, SPSR
> and ELR of the target EL. You need to calculated new PSTATE and PC for SPSR_EL3 and
> ELR_EL3. The way the CPU does this is described in the psuedocode in the arm-arm. See
> AArch64.TakeException. This will involve reading SCTLR of the target EL.
> For Synchronous-External-Abort, if the FnV bit is clear, you should copy FAR_EL3 to FAR of
> the target EL too.
>
> There is a GPL implementation of some of these bits in the kernel's KVM code, but that is
> probably of limited use due to the license.
>
>
> To determine the target EL you need to examine the routing controls set by the lower ELs.
> Synchronous Exceptions are the easiest as they can't be masked:
> The routing rules are describe in D1.12.4 "Routing synchronous External Aborts" is a
> little terse. It glosses over HCR_EL2.TGE that would also route the exception to EL2.
>
> For a synchronous-external-abort triggered by EL1 where HCR_EL2.TERR is not supported, or
> clear: If the fault was at stage1, it goes to EL1, if the fault was at stage2, it goes to
> EL2. There is nothing the ESR to tell you which it was as the CPU indicates this with the
> target EL, which was overridden by SCR_EL3.EA. (The architecture doesn't expect you to be
> re-injecting exceptions from EL3).
> Pragmatically the best option is to allow HCR_EL2.AMO to route synchronous exceptions to
> EL2 too. (this is a big hint that a hypervisor is managing errors for this exception
> level). If ELR_EL3.S1PTW is set, this is definitely a stage2 fault, EL1 should never see
> this bit set.
> (Synchronous Exceptions can't be routed to a lower EL).
>
>
> Synchronous errors were the easy one. Asynchronous error routing is described in D1.13.1
> "Asynchronous exception routing". You want to take note of HCR_EL2.{AMO, TGE}. But it can
> also be masked by PSTATE.A of the target EL. (See D1.13.2 "Asynchronous exception masking"):
> If SPSR_EL3.M is the target EL, SPSR_EL3.A would have masked SError. You cannot emulate
> the exception if this bit is set.
> If SPSR_EL3.M is lower than the target EL, then you can emulate the exception to the
> target EL.
> If SPSR_EL3.M is higher than the target EL, then SError is effectively masked, and you
> cannot emulate the exception.
>
>
> (I don't think HPFAR_EL2 needs to be set for these cases, but I'd need to check)
>
>
> Finally, you still need something to do if you can't emulate the exception. Updating a
> system log if you have one and rebooting is the only real option.
>
>
>
> Thanks,
>
> James
>
>
> On 25/05/2021 11:08, Pali Rohár wrote:
>> Hello!
>>
>> Platform is not ACPI based. PCIe core in some cases sends External
>> Aborts to kernel which needs to be masked/ignored. I have not found a
>> way how to reconfigure PCIE core to not send these aborts.
>>
>> In mentioned review is a link to kernel list where was discussion about
>> custom kernel handlers to ignore some of EA. But this approach was
>> rejected with information that TF-A should handle these aborts and
>> ignores those which should not be propagated back to kernel.
>>
>> If I clear SCR_EL3.EA then aborts (including those which should be
>> ignored) are sent to kernel and kernel makes them fatal. So this is not
>> a solution.
>>
>> If I do not clear SCR_EL3.EA then in TF-A board/platform code I can
>> implement check for aborts which needs to be ignored. But remaining
>> aborts are not delivered to kernel and TF-A makes them fatal. Which is
>> not correct too.
>>
>> So, what I need, is to route all External Aborts to TF-A, implement
>> logic which ignores specific PCIE aborts and all remaining aborts needs
>> to be propagated back to kernel like if SCR_EL3.EA is clear.
>>
>> So it means to implement some logic of abort injection.
>>
>> On Tuesday 25 May 2021 11:00:09 James Morse wrote:
>>> Hi Guys,
>>>
>>> Does this platform need external-aborts to be routed to EL3? If not, you can clear
>>> SCR_EL3.EA and be done with it. This allows the EL2 OS/Hypervisor to take control of the
>>> routing of these exceptions. (which sounds like what you want)
>>>
>>>
>>> Otherwise:
>>> As Soby describes, the choices are SDEI or emulate the exception according to the arm-arm
>>> psuedocode as if EL3 weren't implemented. This is best avoided as its difficult to get
>>> right: you have to create a new PSTATE for the target exception level, and read the
>>> routing controls to work out which exception level that is.
>>>
>>> As Achin says, emulating the exception isn't always possible as Asynchronous exceptions
>>> can be masked. The hardware does this automatically when it takes an exception (e.g. irq).
>>> (Linux unmask it again once its read the CPU state).
>>>
>>> This can leave you holding what may be an imprecise-asynchronous-abort in EL3, unable to
>>> emulate the exception or proceed without causing any RAS error to become uncontained.
>>> If you can't inject the emulated exception, the error still has to be handled at EL3. If
>>> this is an ACPI system you can do a soft restart of the normal-world and present the error
>>> via ACPI's BERT (boot error record table) which describes an error that happened in a
>>> previous life.
>>>
>>>
>>> If your platform is ACPI firmware-first, using SDEI will make life easier. You still need
>>> to handle the 'SDEI masked' case, but it is a lot less likely to happen. Linux only does
>>> this over power-management events that (may) disable the MMU.
>>>
>>>
>>> (EL2 doesn't have any of these problems as errors are almost always contained by stage2,
>>> and it has hardware features for injecting asynchronous exceptions, which cope with the
>>> masking and deferring)
>>>
>>>
>>> Thanks,
>>>
>>> James
>>>
>>>
>>> On 25/05/2021 10:08, Achin Gupta wrote:
>>>> Hi,
>>>>
>>>> The last time I checked injecting an SError from a higher to lower EL is a bad
>>>> idea since the latter could be running with SErrors masked.
>>>>
>>>> EL3 could check this before injecting but then there is no consistent contract
>>>> with the lower EL about reporting of these errors. SDEI does not suffer from the
>>>> same problem.
>>>>
>>>> +James who knows more from the OS/Hypervisor perspective.
>>>>
>>>> cheers,
>>>> Achin
>>>> --------------------------------------------------------------------------------
>>>> *From:* TF-A <tf-a-bounces(a)lists.trustedfirmware.org> on behalf of Soby Mathew
>>>> via TF-A <tf-a(a)lists.trustedfirmware.org>
>>>> *Sent:* 25 May 2021 09:59
>>>> *To:* Pali Rohár <pali(a)kernel.org>
>>>> *Cc:* kabel(a)kernel.org <kabel(a)kernel.org>; tf-a(a)lists.trustedfirmware.org
>>>> <tf-a(a)lists.trustedfirmware.org>
>>>> *Subject:* Re: [TF-A] Rethrow SError from EL3 to kernel on arm64
>>>> [+tf-a list]
>>>> Hi Pali,
>>>> There are 2 philosophies for handing SError in the system, kernel first and
>>>> firmware first. Assuming you want to stick with firmware first handling (i.e
>>>> scr_el3.ea is set to 1), then as you mentioned, there are 2 ways to notify the
>>>> kernel for delegating the error handling: SDEI and SError injection back to
>>>> kernel. Upstream TF-A only supports SDEI at the moment.
>>>>
>>>> For SError injection back to lower EL, you have to setup the hardware state via
>>>> software at higher EL in such a way that it appears that the fault was taken to
>>>> the exception vector at the lower exception level. The pseudocode function
>>>> AArch64.TakeException() in ARM ARM shows the behavior when the PE takes an
>>>> exception to an Exception level using AArch64 in Non-debug state. This behaviour
>>>> has to replicated and it involves the higher EL setting up the PSTATE registers
>>>> correctly and values in other registers for the lower EL (spsr, elr and fault
>>>> syndrome registers) and jumping to the right offset point to by the vbar_elx of
>>>> the lower EL. To the lower EL is appears as a SError has triggered at its
>>>> exception vector and it can proceed with the fault handling.
>>>>
>>>> Best Regards
>>>> Soby Mathew
>>>>
>>>>> -----Original Message-----
>>>>> From: Pali Rohár <pali(a)kernel.org>
>>>>> Sent: Monday, May 24, 2021 6:07 PM
>>>>> To: Soby Mathew <Soby.Mathew(a)arm.com>
>>>>> Subject: Rethrow SError from EL3 to kernel on arm64
>>>>>
>>>>> Hello Soby!
>>>>>
>>>>> I have found following discussion in Armada 3720 PCIe SError issue:
>>>>> https://review.trustedfirmware.org/c/TF-A/trusted-firmware-
>>>> <https://review.trustedfirmware.org/c/TF-A/trusted-firmware->
>>>>> a/+/1541/comment/ca882427_d142bde2/
>>>>>
>>>>> TF-A on Armada 3720 redirects all SErrors to EL3 and panic in TF-A handler.
>>>>> You wrote in that discussion:
>>>>>
>>>>> Ideally you need to signal the SError back to kernel from EL3 using
>>>>> SDEI or inject the SError to the lower EL and the kernel can decide to
>>>>> die or not.
>>>>>
>>>>> And I would like to ask you, could you help me with implementation of this
>>>>> SError rethrow functionality? Because I have absolutely no idea how to do it
>>>>> and catching all SErrors in EL3 is causing issues because some of them can be
>>>>> handled and recovered by kernel.
>>>> --
>>>> TF-A mailing list
>>>> TF-A(a)lists.trustedfirmware.org
>>>> https://lists.trustedfirmware.org/mailman/listinfo/tf-a
>>>> <https://lists.trustedfirmware.org/mailman/listinfo/tf-a>
>>>>
>>>
>
Hi Andrew,
I have submitted the change as you have passed it through the ML as a base for the discussion.
https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/11002
The issue is acknowledged, we had a brief discussion internally as to how best to refactor if need be.
It looks to us the main problem is that SPM-MM (pre-dating FF-A) has aged a bit and mixes standard and impdef func ids.
e.g. MM is an Arm standard and only defines two func ids (0x84000040, 0x84000041) so it may just be a matter of updating SPM_MM_FID_MAX_VALUE to 0x41 such that MM related services go through.
The other ids 0xX4000060, 61, 64, 65 are purely impdef for the SPM-MM to/from SP communication. Thus we may define SP_MM_FID_MIN_VALUE/SP_MM_FID_MAX_VALUE and a corresponding is_sp_mm_fid macro.
This would avoid the clash with TRNG IDs (0xX4000050, 51, 52, 53).
What do you reckon?
Btw out of curiosity how did you discover this? Do you have a setup enabling both SPM_MM and TRNG_SUPPORT option? Or maybe this is because of Trusty SPD reuse of spm_mm_smc_handler?
Regards,
Olivier.
________________________________________
From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org> on behalf of Andrew Scull via TF-A <tf-a(a)lists.trustedfirmware.org>
Sent: 04 August 2021 22:50
To: Manish Pandey2
Cc: tf-a(a)lists.trustedfirmware.org; Jimmy Brisson; Andre Przywara
Subject: Re: [TF-A] TRNG SMCs intercepted by SPM-MM
I'm seeing server errors when I try "Generate Password" or setting the ssh key so I'm not sure how to push and authenticate. I've sent the patch directly to you, Manish, so the formatting doesn't get messed up and I don't know how to make git-send-email add it to a thread nicely..
On Wed, 4 Aug 2021 at 05:51, Manish Pandey2 <Manish.Pandey2(a)arm.com<mailto:Manish.Pandey2@arm.com>> wrote:
Hi Andrew,
Thanks for reporting the bug, "DEN0060A_ARM_MM_Interface_Specification.pdf" does not talk about range for SPM_MM but don't know how it's mentioned in the comments.
Will you be able to push a patch following instructions at https://trustedfirmware-a.readthedocs.io/en/latest/process/contributing.htm…
5. Contributor’s Guide — Trusted Firmware-A documentation<https://trustedfirmware-a.readthedocs.io/en/latest/process/contributing.htm…>
5. Contributor’s Guide¶ 5.1. Getting Started¶. Make sure you have a Github account and you are logged on both developer.trustedfirmware.org<http://developer.trustedfirmware.org> and review.trustedfirmware.org<http://review.trustedfirmware.org>. If you plan to contribute a major piece of work, it is usually a good idea to start a discussion around it on the mailing list.
trustedfirmware-a.readthedocs.io<http://trustedfirmware-a.readthedocs.io>
Repository: https://review.trustedfirmware.org/admin/repos/TF-A/trusted-firmware-a , you will be able to login to gerrit using github credentials.
TF-A/trusted-firmware-a · Gerrit Code Review<https://review.trustedfirmware.org/admin/repos/TF-A/trusted-firmware-a>
Gerrit Code Review
review.trustedfirmware.org<http://review.trustedfirmware.org>
If not, then could you please send me the patch file (it appears copying directly from email generates corrupt patch file)
Thanks
Manish
________________________________
From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org<mailto:tf-a-bounces@lists.trustedfirmware.org>> on behalf of Andrew Scull via TF-A <tf-a(a)lists.trustedfirmware.org<mailto:tf-a@lists.trustedfirmware.org>>
Sent: 03 August 2021 22:32
To: tf-a(a)lists.trustedfirmware.org<mailto:tf-a@lists.trustedfirmware.org> <tf-a(a)lists.trustedfirmware.org<mailto:tf-a@lists.trustedfirmware.org>>
Cc: Andre Przywara <Andre.Przywara(a)arm.com<mailto:Andre.Przywara@arm.com>>; Jimmy Brisson <Jimmy.Brisson(a)arm.com<mailto:Jimmy.Brisson@arm.com>>
Subject: [TF-A] TRNG SMCs intercepted by SPM-MM
I've failed to figure out how to upload a CL so I'm resorting to this,
it's more of a bug report anyway. There seems to be a conflict in how
the standard SMCs are claimed with the TRNG SMCs claimed by SPM-MM
before TRNG would get a chance to handle them properly.
The patch below might fix the issue but I've not tested it or even
built against ToT.
----
The TRNG SMCs use 0x84000050 to 0x84000053 which is in the range that
SPM-MM claims for itself. Resolve this conflict by making SMC-MM much
more selective about the SMCs it claims for itself.
Signed-off-by: Andrew Scull <ascull(a)google.com<mailto:ascull@google.com>>
Change-Id: If86b0d6a22497d34315c61fe72645b642c6e35f3
---
include/services/spm_mm_svc.h | 12 ++----------
services/std_svc/spm_mm/spm_mm_main.c | 12 ++++++++++++
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/include/services/spm_mm_svc.h b/include/services/spm_mm_svc.h
index 3148beb80..4247c95a1 100644
--- a/include/services/spm_mm_svc.h
+++ b/include/services/spm_mm_svc.h
@@ -38,17 +38,8 @@
#define SPM_MM_VERSION_COMPILED
SPM_MM_VERSION_FORM(SPM_MM_VERSION_MAJOR, \
SPM_MM_VERSION_MINOR)
-/* These macros are used to identify SPM-MM calls using the SMC function ID */
-#define SPM_MM_FID_MASK U(0xffff)
-#define SPM_MM_FID_MIN_VALUE U(0x40)
-#define SPM_MM_FID_MAX_VALUE U(0x7f)
-#define is_spm_mm_fid(_fid) \
- ((((_fid) & SPM_MM_FID_MASK) >= SPM_MM_FID_MIN_VALUE) && \
- (((_fid) & SPM_MM_FID_MASK) <= SPM_MM_FID_MAX_VALUE))
-
/*
* SMC IDs defined in [1] for accessing MM services from the Non-secure world.
- * These FIDs occupy the range 0x40 - 0x5f.
* [1] DEN0060A_ARM_MM_Interface_Specification.pdf
*/
#define MM_VERSION_AARCH32 U(0x84000040)
@@ -59,7 +50,6 @@
* SMC IDs defined for accessing services implemented by the Secure Partition
* Manager from the Secure Partition(s). These services enable a partition to
* handle delegated events and request privileged operations from the manager.
- * They occupy the range 0x60-0x7f.
*/
#define SPM_MM_VERSION_AARCH32 U(0x84000060)
#define MM_SP_EVENT_COMPLETE_AARCH64 U(0xC4000061)
@@ -94,6 +84,8 @@
int32_t spm_mm_setup(void);
+bool is_spm_mm_fid(uint32_t smc_fid);
+
uint64_t spm_mm_smc_handler(uint32_t smc_fid,
uint64_t x1,
uint64_t x2,
diff --git a/services/std_svc/spm_mm/spm_mm_main.c
b/services/std_svc/spm_mm/spm_mm_main.c
index 14c0038ba..07226b0fb 100644
--- a/services/std_svc/spm_mm/spm_mm_main.c
+++ b/services/std_svc/spm_mm/spm_mm_main.c
@@ -266,6 +266,18 @@ static uint64_t mm_communicate(uint32_t smc_fid,
uint64_t mm_cookie,
SMC_RET1(handle, rc);
}
+/* Predicate indicating that a function id is part of SPM-MM */
+bool is_spm_mm_fid(uint32_t smc_fid)
+{
+ return ((smc_fid == MM_VERSION_AARCH32) ||
+ (smc_fid == MM_COMMUNICATE_AARCH32) ||
+ (smc_fid == MM_COMMUNICATE_AARCH64) ||
+ (smc_fid == SPM_MM_VERSION_AARCH32) ||
+ (smc_fid == MM_SP_EVENT_COMPLETE_AARCH64) ||
+ (smc_fid == MM_SP_MEMORY_ATTRIBUTES_GET_AARCH64) ||
+ (smc_fid == MM_SP_MEMORY_ATTRIBUTES_SET_AARCH64));
+}
+
/*******************************************************************************
* Secure Partition Manager SMC handler.
******************************************************************************/
--
2.32.0.554.ge1b32706d8-goog
--
TF-A mailing list
TF-A(a)lists.trustedfirmware.org<mailto:TF-A@lists.trustedfirmware.org>
https://lists.trustedfirmware.org/mailman/listinfo/tf-a
Hi Andrew,
Thanks for reporting the bug, "DEN0060A_ARM_MM_Interface_Specification.pdf" does not talk about range for SPM_MM but don't know how it's mentioned in the comments.
Will you be able to push a patch following instructions at https://trustedfirmware-a.readthedocs.io/en/latest/process/contributing.htm…
5. Contributor’s Guide — Trusted Firmware-A documentation<https://trustedfirmware-a.readthedocs.io/en/latest/process/contributing.htm…>
5. Contributor’s Guide¶ 5.1. Getting Started¶. Make sure you have a Github account and you are logged on both developer.trustedfirmware.org and review.trustedfirmware.org. If you plan to contribute a major piece of work, it is usually a good idea to start a discussion around it on the mailing list.
trustedfirmware-a.readthedocs.io
Repository: https://review.trustedfirmware.org/admin/repos/TF-A/trusted-firmware-a , you will be able to login to gerrit using github credentials.
TF-A/trusted-firmware-a · Gerrit Code Review<https://review.trustedfirmware.org/admin/repos/TF-A/trusted-firmware-a>
Gerrit Code Review
review.trustedfirmware.org
If not, then could you please send me the patch file (it appears copying directly from email generates corrupt patch file)
Thanks
Manish
________________________________
From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org> on behalf of Andrew Scull via TF-A <tf-a(a)lists.trustedfirmware.org>
Sent: 03 August 2021 22:32
To: tf-a(a)lists.trustedfirmware.org <tf-a(a)lists.trustedfirmware.org>
Cc: Andre Przywara <Andre.Przywara(a)arm.com>; Jimmy Brisson <Jimmy.Brisson(a)arm.com>
Subject: [TF-A] TRNG SMCs intercepted by SPM-MM
I've failed to figure out how to upload a CL so I'm resorting to this,
it's more of a bug report anyway. There seems to be a conflict in how
the standard SMCs are claimed with the TRNG SMCs claimed by SPM-MM
before TRNG would get a chance to handle them properly.
The patch below might fix the issue but I've not tested it or even
built against ToT.
----
The TRNG SMCs use 0x84000050 to 0x84000053 which is in the range that
SPM-MM claims for itself. Resolve this conflict by making SMC-MM much
more selective about the SMCs it claims for itself.
Signed-off-by: Andrew Scull <ascull(a)google.com>
Change-Id: If86b0d6a22497d34315c61fe72645b642c6e35f3
---
include/services/spm_mm_svc.h | 12 ++----------
services/std_svc/spm_mm/spm_mm_main.c | 12 ++++++++++++
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/include/services/spm_mm_svc.h b/include/services/spm_mm_svc.h
index 3148beb80..4247c95a1 100644
--- a/include/services/spm_mm_svc.h
+++ b/include/services/spm_mm_svc.h
@@ -38,17 +38,8 @@
#define SPM_MM_VERSION_COMPILED
SPM_MM_VERSION_FORM(SPM_MM_VERSION_MAJOR, \
SPM_MM_VERSION_MINOR)
-/* These macros are used to identify SPM-MM calls using the SMC function ID */
-#define SPM_MM_FID_MASK U(0xffff)
-#define SPM_MM_FID_MIN_VALUE U(0x40)
-#define SPM_MM_FID_MAX_VALUE U(0x7f)
-#define is_spm_mm_fid(_fid) \
- ((((_fid) & SPM_MM_FID_MASK) >= SPM_MM_FID_MIN_VALUE) && \
- (((_fid) & SPM_MM_FID_MASK) <= SPM_MM_FID_MAX_VALUE))
-
/*
* SMC IDs defined in [1] for accessing MM services from the Non-secure world.
- * These FIDs occupy the range 0x40 - 0x5f.
* [1] DEN0060A_ARM_MM_Interface_Specification.pdf
*/
#define MM_VERSION_AARCH32 U(0x84000040)
@@ -59,7 +50,6 @@
* SMC IDs defined for accessing services implemented by the Secure Partition
* Manager from the Secure Partition(s). These services enable a partition to
* handle delegated events and request privileged operations from the manager.
- * They occupy the range 0x60-0x7f.
*/
#define SPM_MM_VERSION_AARCH32 U(0x84000060)
#define MM_SP_EVENT_COMPLETE_AARCH64 U(0xC4000061)
@@ -94,6 +84,8 @@
int32_t spm_mm_setup(void);
+bool is_spm_mm_fid(uint32_t smc_fid);
+
uint64_t spm_mm_smc_handler(uint32_t smc_fid,
uint64_t x1,
uint64_t x2,
diff --git a/services/std_svc/spm_mm/spm_mm_main.c
b/services/std_svc/spm_mm/spm_mm_main.c
index 14c0038ba..07226b0fb 100644
--- a/services/std_svc/spm_mm/spm_mm_main.c
+++ b/services/std_svc/spm_mm/spm_mm_main.c
@@ -266,6 +266,18 @@ static uint64_t mm_communicate(uint32_t smc_fid,
uint64_t mm_cookie,
SMC_RET1(handle, rc);
}
+/* Predicate indicating that a function id is part of SPM-MM */
+bool is_spm_mm_fid(uint32_t smc_fid)
+{
+ return ((smc_fid == MM_VERSION_AARCH32) ||
+ (smc_fid == MM_COMMUNICATE_AARCH32) ||
+ (smc_fid == MM_COMMUNICATE_AARCH64) ||
+ (smc_fid == SPM_MM_VERSION_AARCH32) ||
+ (smc_fid == MM_SP_EVENT_COMPLETE_AARCH64) ||
+ (smc_fid == MM_SP_MEMORY_ATTRIBUTES_GET_AARCH64) ||
+ (smc_fid == MM_SP_MEMORY_ATTRIBUTES_SET_AARCH64));
+}
+
/*******************************************************************************
* Secure Partition Manager SMC handler.
******************************************************************************/
--
2.32.0.554.ge1b32706d8-goog
--
TF-A mailing list
TF-A(a)lists.trustedfirmware.org
https://lists.trustedfirmware.org/mailman/listinfo/tf-a
I've failed to figure out how to upload a CL so I'm resorting to this,
it's more of a bug report anyway. There seems to be a conflict in how
the standard SMCs are claimed with the TRNG SMCs claimed by SPM-MM
before TRNG would get a chance to handle them properly.
The patch below might fix the issue but I've not tested it or even
built against ToT.
----
The TRNG SMCs use 0x84000050 to 0x84000053 which is in the range that
SPM-MM claims for itself. Resolve this conflict by making SMC-MM much
more selective about the SMCs it claims for itself.
Signed-off-by: Andrew Scull <ascull(a)google.com>
Change-Id: If86b0d6a22497d34315c61fe72645b642c6e35f3
---
include/services/spm_mm_svc.h | 12 ++----------
services/std_svc/spm_mm/spm_mm_main.c | 12 ++++++++++++
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/include/services/spm_mm_svc.h b/include/services/spm_mm_svc.h
index 3148beb80..4247c95a1 100644
--- a/include/services/spm_mm_svc.h
+++ b/include/services/spm_mm_svc.h
@@ -38,17 +38,8 @@
#define SPM_MM_VERSION_COMPILED
SPM_MM_VERSION_FORM(SPM_MM_VERSION_MAJOR, \
SPM_MM_VERSION_MINOR)
-/* These macros are used to identify SPM-MM calls using the SMC function ID */
-#define SPM_MM_FID_MASK U(0xffff)
-#define SPM_MM_FID_MIN_VALUE U(0x40)
-#define SPM_MM_FID_MAX_VALUE U(0x7f)
-#define is_spm_mm_fid(_fid) \
- ((((_fid) & SPM_MM_FID_MASK) >= SPM_MM_FID_MIN_VALUE) && \
- (((_fid) & SPM_MM_FID_MASK) <= SPM_MM_FID_MAX_VALUE))
-
/*
* SMC IDs defined in [1] for accessing MM services from the Non-secure world.
- * These FIDs occupy the range 0x40 - 0x5f.
* [1] DEN0060A_ARM_MM_Interface_Specification.pdf
*/
#define MM_VERSION_AARCH32 U(0x84000040)
@@ -59,7 +50,6 @@
* SMC IDs defined for accessing services implemented by the Secure Partition
* Manager from the Secure Partition(s). These services enable a partition to
* handle delegated events and request privileged operations from the manager.
- * They occupy the range 0x60-0x7f.
*/
#define SPM_MM_VERSION_AARCH32 U(0x84000060)
#define MM_SP_EVENT_COMPLETE_AARCH64 U(0xC4000061)
@@ -94,6 +84,8 @@
int32_t spm_mm_setup(void);
+bool is_spm_mm_fid(uint32_t smc_fid);
+
uint64_t spm_mm_smc_handler(uint32_t smc_fid,
uint64_t x1,
uint64_t x2,
diff --git a/services/std_svc/spm_mm/spm_mm_main.c
b/services/std_svc/spm_mm/spm_mm_main.c
index 14c0038ba..07226b0fb 100644
--- a/services/std_svc/spm_mm/spm_mm_main.c
+++ b/services/std_svc/spm_mm/spm_mm_main.c
@@ -266,6 +266,18 @@ static uint64_t mm_communicate(uint32_t smc_fid,
uint64_t mm_cookie,
SMC_RET1(handle, rc);
}
+/* Predicate indicating that a function id is part of SPM-MM */
+bool is_spm_mm_fid(uint32_t smc_fid)
+{
+ return ((smc_fid == MM_VERSION_AARCH32) ||
+ (smc_fid == MM_COMMUNICATE_AARCH32) ||
+ (smc_fid == MM_COMMUNICATE_AARCH64) ||
+ (smc_fid == SPM_MM_VERSION_AARCH32) ||
+ (smc_fid == MM_SP_EVENT_COMPLETE_AARCH64) ||
+ (smc_fid == MM_SP_MEMORY_ATTRIBUTES_GET_AARCH64) ||
+ (smc_fid == MM_SP_MEMORY_ATTRIBUTES_SET_AARCH64));
+}
+
/*******************************************************************************
* Secure Partition Manager SMC handler.
******************************************************************************/
--
2.32.0.554.ge1b32706d8-goog
After updating to ATF v2.5 on the Xilinx ZynqMP platform, I was having issues
with the FPGA PL logic not loading successfully from U-Boot, it was failing
with this error:
PL FPGA LOAD failed with err: 0x000007d6
which is PM_RET_ERROR_TIMEOUT. The following commit introduced the timeout:
commit 4d9b9b2352f9a67849faf2d4484f5fcdd2788b01
Author: Tejas Patel <tejas.patel(a)xilinx.com>
Date: Thu Feb 25 02:37:09 2021 -0800
plat: xilinx: Add timeout while waiting for IPI Ack
Return timeout error if, IPI is not acked in specified timeout.
Signed-off-by: Tejas Patel <tejas.patel(a)xilinx.com>
Change-Id: I27be3d4d4eb5bc57f6a84c839e2586278c0aec19
The timeout value (TIMEOUT_COUNT_US) is set to 0x4000 (16384) usec, which
appears to be too short for the FPGA loading operation (at least on the ZCU102
board with XCZU9EG device), causing it to always timeout. Increasing the
timeout to 0xF4240 usec (i.e. 1 second) fixes the issue, though some lower
value may also be sufficient.
--
Robert Hancock
Senior Hardware Designer, Calian Advanced Technologies
www.calian.com
>> Our initial ask was to only bump the SP image entrypoint past the DTB boundary while generating SP.pkg using sptool. IIUC, the issue you brought up is for passing the manifest base address to the SP at runtime. I think these two are independent issues. Please advise.
[RK] Agree here. Passing information through the manifest to the SP is orthogonal to the main problem at hand where we are assuming that the size of manifest cannot be > 4K and the entrypoint offset is always at 0x100.
-Raghu
-----Original Message-----
From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org> On Behalf Of Varun Wadekar via TF-A
Sent: Tuesday, June 22, 2021 7:35 AM
To: Olivier Deprez <Olivier.Deprez(a)arm.com>; tf-a(a)lists.trustedfirmware.org
Cc: Raghupathy Krishnamurthy <raghupathyk(a)nvidia.com>; Nicolas Benech <nbenech(a)nvidia.com>
Subject: Re: [TF-A] SP manifest: avoid manual updates to "entrypoint-offset"
Hi Olivier,
>> [OD] The two questions are which entity is loading boot data (can be a DT blob) that is to be consumed by the SP? And how is the address for boot data conveyed to the SP?
The SP manifest is made for the SPMC consumption. I guess it's ok to conflate DT information required by the SP into the SP manifest. It means the bootloader loads both the SP manifest and the SP boot data in a single "SP package". In current implementation the SP has no standard way to know where the DT blob is loaded in its own memory range. We have experimental patches around the FF-A boot protocol which may help.
[VW] You are right - bootloader loads SP.pkg (header+manifest+image) into memory. Can you please help me understand what "SP boot data" contains? For passing the SP manifest pointer to the SP we should ask for ideas from the community.
Some ideas to get the discussion started:
1. SPMC creates a mapping for the manifest in the SP's virtual address space. SP issues a SVC call to get the virtual address from the SPMC 2. SPMC creates a mapping for the manifest in the SP's virtual address space and passes the pointer to SP via X0 3. SP manifest contains an entry to publish the virtual address for its manifest. SPMC reads this entry and maps the manifest at that virtual address during boot.
>> [OD] If the assumptions (implementation defined) are that the SP boot data fits into the SP manifest, and that the SP finds this data at a fixed address (e.g. offset 0 in the SP package) then yes it can be a way to go.
[VW] Our initial ask was to only bump the SP image entrypoint past the DTB boundary while generating SP.pkg using sptool. IIUC, the issue you brought up is for passing the manifest base address to the SP at runtime. I think these two are independent issues. Please advise.
-Varun
-----Original Message-----
From: Olivier Deprez <Olivier.Deprez(a)arm.com>
Sent: Tuesday, June 22, 2021 8:17 AM
To: Varun Wadekar <vwadekar(a)nvidia.com>; tf-a(a)lists.trustedfirmware.org
Cc: Raghupathy Krishnamurthy <raghupathyk(a)nvidia.com>; Nicolas Benech <nbenech(a)nvidia.com>
Subject: Re: SP manifest: avoid manual updates to "entrypoint-offset"
External email: Use caution opening links or attachments
Hi Varun,
(sorry last message sent too fast)
See few comments inline [OD].
Regards,
Olivier.
________________________________________
From: Varun Wadekar <vwadekar(a)nvidia.com>
Sent: 17 June 2021 12:33
To: Olivier Deprez; tf-a(a)lists.trustedfirmware.org
Cc: Raghupathy Krishnamurthy; Nicolas Benech
Subject: RE: SP manifest: avoid manual updates to "entrypoint-offset"
Hi,
>> [OD] Ok. How is the SP informed about where to find the dtb (IPA address)? Saying this because the boot protocol between Hafnium and SPs is very much implementation specific at this moment and does not strictly follow the FF-A spec recommendations (data passing as TLVs). There is a trick that the manifest blob remains fortunately mapped from offset 0 in the SP IPA range. So it may be able to extract manifest data by mapping it the Stage-1 translation regime. But as said this does not follow a standard.
[VW] We don't have a policy for all SPs, yet. At least I don't know of one. But in our experimental setup we plan to work on some assumptions e.g. assume the manifest blob to always be present at a certain address.
[OD] The two questions are which entity is loading boot data (can be a DT blob) that is to be consumed by the SP? And how is the address for boot data conveyed to the SP?
The SP manifest is made for the SPMC consumption. I guess it's ok to conflate DT information required by the SP into the SP manifest. It means the bootloader loads both the SP manifest and the SP boot data in a single "SP package". In current implementation the SP has no standard way to know where the DT blob is loaded in its own memory range. We have experimental patches around the FF-A boot protocol which may help.
>> [OD] I think review link is mysteriously broken and the review lost. But Joao can provide the new link if necessary. I understand the intent of not making things too complex.
[VW] Can we list down the next steps? Do we agree in principle that sptool needs to be upgraded to handle this use case? We can collaborate on an implementation, once we agree on the direction.
[OD] If the assumptions (implementation defined) are that the SP boot data fits into the SP manifest, and that the SP finds this data at a fixed address (e.g. offset 0 in the SP package) then yes it can be a way to go.
Cheers.
-----Original Message-----
From: Olivier Deprez <Olivier.Deprez(a)arm.com>
Sent: Thursday, June 17, 2021 8:40 AM
To: Varun Wadekar <vwadekar(a)nvidia.com>; tf-a(a)lists.trustedfirmware.org
Cc: Raghupathy Krishnamurthy <raghupathyk(a)nvidia.com>; Nicolas Benech <nbenech(a)nvidia.com>
Subject: Re: SP manifest: avoid manual updates to "entrypoint-offset"
External email: Use caution opening links or attachments
Hi Varun,
Few comments [OD]
Regards,
Olivier.
________________________________________
From: Varun Wadekar <vwadekar(a)nvidia.com>
Sent: 16 June 2021 14:37
To: Olivier Deprez; tf-a(a)lists.trustedfirmware.org
Cc: Raghupathy Krishnamurthy; Nicolas Benech
Subject: RE: SP manifest: avoid manual updates to "entrypoint-offset"
Hi,
>> Just a small heads up VHE SEL0 changes are tested within the Hafnium CI presently and do not relate to TF-A CI. sptool is a TF-A tool and there is no link to the Hafnium CI.
[VW] Thanks for the heads up.
>> what is the order in size for the manifest dtb you require in Tegra platform? Are the supplementary nodes in this manifest consumed by Hafnium or the SP itself?
[VW] We can assume tens of KB. In the worst case, a few hundred KB. The manifest is targeted towards the SP and not meant for Hafnium. Just curious, do you see any pitfalls?
[OD] Ok. How is the SP informed about where to find the dtb (IPA address)? Saying this because the boot protocol between Hafnium and SPs is very much implementation specific at this moment and does not strictly follow the FF-A spec recommendations (data passing as TLVs). There is a trick that the manifest blob remains fortunately mapped from offset 0 in the SP IPA range. So it may be able to extract manifest data by mapping it the Stage-1 translation regime. But as said this does not follow a standard.
>> To set the complete picture, Joao had made some exploration around more dynamic SP configuration [2], maybe there are ideas to gather from there.
[VW] Thanks for the links. I will review and leave comments - although we are not looking at introducing yet another script.
[OD] I think review link is mysteriously broken and the review lost. But Joao can provide the new link if necessary. I understand the intent of not making things too complex.
Cheers.
-----Original Message-----
From: Olivier Deprez <Olivier.Deprez(a)arm.com>
Sent: Wednesday, June 16, 2021 12:59 PM
To: Varun Wadekar <vwadekar(a)nvidia.com>; tf-a(a)lists.trustedfirmware.org
Cc: Raghupathy Krishnamurthy <raghupathyk(a)nvidia.com>; Nicolas Benech <nbenech(a)nvidia.com>
Subject: Re: SP manifest: avoid manual updates to "entrypoint-offset"
External email: Use caution opening links or attachments
Hi Varun,
See inline [OD]
Regards,
Olivier.
________________________________________
From: Varun Wadekar <vwadekar(a)nvidia.com>
Sent: 16 June 2021 13:07
To: Olivier Deprez; tf-a(a)lists.trustedfirmware.org
Cc: Raghupathy Krishnamurthy; Nicolas Benech
Subject: RE: SP manifest: avoid manual updates to "entrypoint-offset"
HI Olivier,
>> [OD] Just to be clear, is this about SEL0 partitions using an SEL1
>> shim
No, this issue can be seen even without the shim. I don't think the usage of shim or VHE really matters here.
[OD] All right. Just a small heads up VHE SEL0 changes are tested within the Hafnium CI presently and do not relate to TF-A CI. sptool is a TF-A tool and there is no link to the Hafnium CI. Not an issue as such but just making sure you have the full picture. At some point in time, when Hf VHE changes are merged we can create a specific TF-A test config to cover this case if necessary.
Out of curiosity what is the order in size for the manifest dtb you require in Tegra platform? Are the supplementary nodes in this manifest consumed by Hafnium or the SP itself?
>> [OD] This does not relate exactly to your problem but the effect is the "same" (aka there is more room for the manifest dtb). Agree this still requires hard-coding the entry point. At this stage I had thought of pushing the entry point even farther at a reasonably large 64KB aligned offset such that it helps with both problems.
I agree, this approach is good for the short term. But I propose we craft a forward-looking solution. Are you planning on merging the sptool patch[1]? If not, I propose we come up with a way to dynamically update the SP manifest - I understand this involves adding libfdt to update the manifest.
[OD] There is no pressing need to merge [1] in the short term so this can wait for a better solution.
To set the complete picture, Joao had made some exploration around more dynamic SP configuration [2], maybe there are ideas to gather from there.
-Varun
[1] https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Freview.tr…
[2] https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.tru…
-----Original Message-----
From: Olivier Deprez <Olivier.Deprez(a)arm.com>
Sent: Wednesday, June 16, 2021 11:42 AM
To: tf-a(a)lists.trustedfirmware.org; Nicolas Benech <nbenech(a)nvidia.com>
Cc: Raghupathy Krishnamurthy <raghupathyk(a)nvidia.com>; Varun Wadekar <vwadekar(a)nvidia.com>
Subject: Re: SP manifest: avoid manual updates to "entrypoint-offset"
External email: Use caution opening links or attachments
Hi,
See few comments inline [OD]
Regards,
Olivier.
________________________________________
From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org> on behalf of Varun Wadekar via TF-A <tf-a(a)lists.trustedfirmware.org>
Sent: 16 June 2021 11:41
To: tf-a(a)lists.trustedfirmware.org
Cc: Raghupathy Krishnamurthy; Nicolas Benech
Subject: [TF-A] SP manifest: avoid manual updates to "entrypoint-offset"
Hello,
We (Nico/Raghu) have been implementing SEL0 partitions for Tegra platforms
[OD] Just to be clear, is this about SEL0 partitions using an SEL1 shim (as per https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Freview.tr… )?
and recently hit an issue, where the "entrypoint-offset" field of the SP manifest [1] cannot cope with increasing manifest blobs. The way the SP manifest is created today, the "entrypoint-offset" field is set to a value *statically* by the implementer. Down the line if the manifest grows past the value written in the "entrypoint-offset", we must manually update it. This needs to be fixed.
We believe there is an opportunity to upgrade the sptool to handle this situation during SP package creation, where sptool calculates the manifest size and bumps the "entrypoint-offset" past the end of the manifest. There are other ways of patching the SP manifest at runtime, but they seem sub-optimal.
Please let me know if there are other ideas to solve this problem. I will post a patch to update the sptool shortly but wanted to get the ball rolling.
[OD] We had an attempt (https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Freview.tr…) to move the entry point farther in the image such that we can support 64KB granules in the Stage-1 translation regime. This does not relate exactly to your problem but the effect is the "same" (aka there is more room for the manifest dtb). Agree this still requires hard-coding the entry point. At this stage I had thought of pushing the entry point even farther at a reasonably large 64KB aligned offset such that it helps with both problems.
Cheers.
[1] 14. FF-A manifest binding to device tree - Trusted Firmware-A documentation<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftrustedfi…>
--
TF-A mailing list
TF-A(a)lists.trustedfirmware.org
https://lists.trustedfirmware.org/mailman/listinfo/tf-a
Hi Boaz,
It appears that you have included plat/arm files in your platform porting which is causing Arm platform function definition to be included.
Along with providing generic implementations Arm also has its own platforms(like any other partner platforms), code under plat/arm is meant only for Arm platforms.
Check your make file and make sure that you don't include plat/arm/common/arm_pm.c(to avoid plat_setup_psci_ops) and plat/arm/common/aarch64/arm_helpers.S(for other functions you mentioned) this will avoid multiple definition errors.
Hope this helps
thanks
Manish
________________________________
From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org> on behalf of IS20 Boaz Baron via TF-A <tf-a(a)lists.trustedfirmware.org>
Sent: 29 July 2021 09:12
To: Madhukar Pappireddy <Madhukar.Pappireddy(a)arm.com>
Cc: tf-a(a)lists.trustedfirmware.org <tf-a(a)lists.trustedfirmware.org>; IN20 Hila Miranda-Kuzi <Hila.Miranda-Kuzi(a)nuvoton.com>
Subject: Re: [TF-A] A Q about TZ porting guide
Also, those functions aren’t defined as WEAK so I encountered the same problem (multiple definitions)
plat_crash_console_putc
plat_crash_console_flush
platform_mem_init
From: IS20 Boaz Baron
Sent: Thursday, July 29, 2021 10:14 AM
To: Madhukar Pappireddy <Madhukar.Pappireddy(a)arm.com>
Cc: tf-a(a)lists.trustedfirmware.org; IN20 Hila Miranda-Kuzi <Hila.Miranda-Kuzi(a)nuvoton.com>
Subject: RE: [TF-A] A Q about TZ porting guide
Thanks Madhukar for your answer,
I think I wasn’t so clear.
plat_setup_psci_ops is listed as mandatory in the porting guide.
I implemented it locally but linkage fails because it is also defined in arm_pm.c.
How do you suggest to avoid this multiple definition?
Thanks,
Boaz.
From: Madhukar Pappireddy <Madhukar.Pappireddy(a)arm.com<mailto:Madhukar.Pappireddy@arm.com>>
Sent: Wednesday, July 28, 2021 10:44 PM
To: IS20 Boaz Baron <boaz.baron(a)nuvoton.com<mailto:boaz.baron@nuvoton.com>>
Cc: tf-a(a)lists.trustedfirmware.org<mailto:tf-a@lists.trustedfirmware.org>
Subject: RE: [TF-A] A Q about TZ porting guide
Hi Boaz
Yes, plat_setup_psci_ops() is mandatory. Every platform needs to implement it independently. You can use the implementation from [1] as a reference. I don’t think you have to delete any original function. If your platform does not support PSCI spec, you can implement a dummy function. Hope it helps.
int plat_setup_psci_ops(uintptr_t sec_entrypoint,
const plat_psci_ops_t **psci_ops)
{
return 0;
}
[1] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/tree/plat/arm/c…<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.trust…>
Thanks,
Madhukar
From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org<mailto:tf-a-bounces@lists.trustedfirmware.org>> On Behalf Of IS20 Boaz Baron via TF-A
Sent: Wednesday, July 28, 2021 7:58 AM
To: tf-a(a)lists.trustedfirmware.org<mailto:tf-a@lists.trustedfirmware.org>
Subject: [TF-A] A Q about TZ porting guide
Hi all,
I have a Q about plat_setup_psci_ops() function implementation ,
In the porting guide, that function is defined as mandatory BUT the original (arm) function isn’t defined as #pargam WEAK.
what should I do? to use/ delete the original function?
Thanks,
Boaz.
________________________________
The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Nuvoton is strictly prohibited; and any information in this email irrelevant to the official business of Nuvoton shall be deemed as neither given nor endorsed by Nuvoton.
________________________________
The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Nuvoton is strictly prohibited; and any information in this email irrelevant to the official business of Nuvoton shall be deemed as neither given nor endorsed by Nuvoton.
Hi Boaz
Yes, plat_setup_psci_ops() is mandatory. Every platform needs to implement it independently. You can use the implementation from [1] as a reference. I don't think you have to delete any original function. If your platform does not support PSCI spec, you can implement a dummy function. Hope it helps.
int plat_setup_psci_ops(uintptr_t sec_entrypoint,
const plat_psci_ops_t **psci_ops)
{
return 0;
}
[1] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/tree/plat/arm/c…
Thanks,
Madhukar
From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org> On Behalf Of IS20 Boaz Baron via TF-A
Sent: Wednesday, July 28, 2021 7:58 AM
To: tf-a(a)lists.trustedfirmware.org
Subject: [TF-A] A Q about TZ porting guide
Hi all,
I have a Q about plat_setup_psci_ops() function implementation ,
In the porting guide, that function is defined as mandatory BUT the original (arm) function isn't defined as #pargam WEAK.
what should I do? to use/ delete the original function?
Thanks,
Boaz.
________________________________
The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Nuvoton is strictly prohibited; and any information in this email irrelevant to the official business of Nuvoton shall be deemed as neither given nor endorsed by Nuvoton.
Hi all,
I have a Q about plat_setup_psci_ops() function implementation ,
In the porting guide, that function is defined as mandatory BUT the original (arm) function isn't defined as #pargam WEAK.
what should I do? to use/ delete the original function?
Thanks,
Boaz.
________________________________
The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Nuvoton is strictly prohibited; and any information in this email irrelevant to the official business of Nuvoton shall be deemed as neither given nor endorsed by Nuvoton.
Hi, I’m trying to implement a secure boot on a STM32MP1 without using the FIP file.
For now , I am not able to use FIP format during the boot process so I use a depreciated boot process with TF-Av2.2 as FSBL and U-Boot as SSBL to boot my Board.
My boot process do Romcode -> TF-A (BL2) -> SP_min (BL32) -> U-Boot (BL33) -> Linux kernel
I succefully implemented signature authentification between U-Boot and Linux image, but between TF-A and U-Boot it’s a little bit harder.
I learned on ST wiki how to sign my u-boot binary with the STM32MP_SigningTool_CLI, but when I sign my binary with a custom private key, TF-A don’t authentified it on boot, even if i tryed to pass my key to TF-A at compilation time with the BL33_KEY argument, which i think is dedicated to the FIP usage.
I found, in the sources of TF-A, what I think being a developpement key, named « arm_rotpk_ecdsa.pem ».
And when I sign my binary with this key, I am able to perform the signature check and continu my boot process. So I tryed to change this key with a custom one and recompile TF-A to update the key in the final binary, but it seem that it is not so simple.
I found yesterday that the auth_mod_init() function wasn’t call because I had forgotten the TUSTED_BOARD_BOOT=1 compilation argument. But when I activate it, the compilation doesn’t work and i see
« build/arm-trusted-firmware-v2.2/bl2/bl2_main.c:91: undefined reference to `auth_mod_init' »
Whitch traditionnaly append when linker don’t find the .o where the functions are implemented.
I would like to know if it is possible to implement some kind of authentification with custom keys without FIP and if yes where can i find some hints/ressources/tutorial ?
I don’t find a lot of ressources about secure boot without FIP so I hope you will be able to help me.
Hi Alexey,
On Thu, Jul 22, 2021 at 10:14 AM Alexey Kazantsev via TF-A
<tf-a(a)lists.trustedfirmware.org> wrote:
>
> Hello!
>
> Please add a build option for selecting GICv3 instead of GICv2 for QEMU
> platform.
>
> There is the following line in plat/qemu/qemu/platform.mk :
> QEMU_USE_GIC_DRIVER := QEMU_GICV2
>
> It doesn't imply setting GICv3 externally by build system of other
> projects, like OP-TEE.
When building with OP-TEE we're overriding this assignment by passing
"QEMU_USE_GIC_DRIVER=$(TFA_GIC_DRIVER)" (where TFA_GIC_DRIVER is
either QEMU_GICV3 or QEMU_GICV2) on the command line.
This is now tested on a regular basis since we've recently added Xen
support to the OP-TEE build setup on QEMU V8 and this depends on using
GICv3 instead of GICv2.
Does this help in your case?
Cheers,
Jens
Hello!
Please add a build option for selecting GICv3 instead of GICv2 for QEMU
platform.
There is the following line in plat/qemu/qemu/platform.mk :
QEMU_USE_GIC_DRIVER := QEMU_GICV2
It doesn't imply setting GICv3 externally by build system of other
projects, like OP-TEE.
Best regards, Aleksey.
Hi Tom,
Thanks for your interest in the SC7180 TF-A port! You're asking fair
questions about a difficult situation, so let me try to add some
background:
The binary component policy was actually written specifically as part
of the discussions about adding the SC7180 port, to lay some
guidelines and ground rules about how to deal with binary components
(which already existed in some other platform ports beforehand). This
case was discussed in-depth with the project leaders and the
trustedfirmware.org Board beforehand, and it was always understood
that this would have to be a tricky compromise. As you may know,
devices (e.g. Android phones) with Qualcomm chipsets generally do not
run TF-A, but instead run Qualcomm's proprietary trusted OS and secure
monitor (QTEE). The TF-A port was more of an experimental side project
(which has by now resulted in a few SC7180-based Chromebooks being
sold with TF-A, but the much larger phone market continues to use
QTEE), so unfortunately the TF project's position to make demands is
not yet as solid as you may think. Basically, we could have either
made these compromises or continue to not support Qualcomm chipsets at
all, so due to their prevalence in the ecosystem we decided it would
be worth it to start like this, try to make the situation as good as
it can get, and then hopefully improve on that in future chipset
generations.
The binary policy is meant as more of a decision guideline and
individual cases are ultimately up to the Board. FWIW maybe I slightly
mis-summarized the policy in the text added to the contributing.rst
document -- I think saying that the *majority* of the platform port
(in terms of bytes of code) should be open source, while a good
ambition in general, was never realistic for SC7180. The full document
in https://git.trustedfirmware.org/tf-binaries.git/tree/readme.rst
instead says "Binary components that contain all meaningful
functionality of a platform port" are not accepted -- the intention is
that there are pieces large enough to be worth modifying in the open
source part, while allowing vendors to keep functionality proprietary
that they absolutely do not want (or are not allowed) to disclose. For
SC7180, things like UART, SPMI, PMIC and RNG drivers as well as SMC
validation are implemented in open source (and as you noticed some of
those were ported piecemeal at later points of the development
process). I'll be the first to admit that this isn't a lot and we
absolutely want to do more, but it is a tricky and very time-consuming
process both in identifying the exact parts that can be open-sourced
without IP concerns and then actually doing the work (since the
qtiseclib code is still proprietary even if there is a Linux driver
for the same subsystem, we can't just copy things over, it has to be
carefully rewritten and revalidated). The state you see the SC7180
port in right now is basically just as far as we got over the course
of this project (and believe me it took a lot of effort already, even
if it may not look like much). Hopefully we can make further progress
with the next chipset.
Also, just as a note, we didn't actually end up hosting qtiseclib in
the TF binary repository in the end, due to concerns about details in
the license text that couldn't be resolved. It is instead hosted by
the coreboot.org project at the moment. I'm not sure if this
technically means that the TF binary component policy applies to this
blob or not (from a strict reading of the text I would say it
doesn't), but that's not really that relevant... like I said, in the
end the Board makes final decisions about whether a platform port is
accepted into the repository or not on a case by case basis, and the
policy is just a general guideline. The general goal is to make sure
the TF-A ports are actually useful to open source developers while
allowing for pragmatic compromises in tricky situations like this, and
in this case we decided that allowing this port would be more useful
than not (although it's certainly on the edge).
On Tue, Jul 20, 2021 at 2:05 AM Tom Johnsen <tomjohnsen(a)protonmail.com> wrote:
>
> Hello!
>
> I recently discovered the TF-A port for QTI SC7180 and was very happy
> to see this. I always thought it would have been great if Qualcomm made
> (open-source) TF-A ports for their platforms. For example, I would be
> interested in TF-A for the DragonBoard 820c (APQ8096E).
> Unfortunately, after talking to some other people I have been told
> it is unlikely that Qualcomm will ever have this. :-/
>
> I am not much of a firmware developer but I was curious so I wanted to
> check how much SoC-specific code is actually needed for a TF-A port. At
> first I was surprised - the QTI platform ports seem fairly simple, there
> is not much SoC-specific code at all. However, it looks like the reason for
> that is that almost all of the SoC-specific code is actually contained in a
> proprietary "qtiseclib" blob that is statically linked into the bl31.bin.
>
> I did not really expect to see something like that in a public
> open-source project, especially not one as security-critical as TF-A.
> It looks like some binary components are indeed allowed as per the
> Contribution Guidelines (1). Yet, after reading them and looking at the
> code again I wonder how the amount of functionality implemented
> in the "qtiseclib" could really conform to these guidelines?
>
> I quote them here (from (1)) for convenience:
>
> > Binary components must be restricted to only the specific
> > functionality that cannot be open-sourced and must be linked into a
> > larger open-source platform port. The majority of the platform port
> > must still be implemented in open source. Platform ports that are
> > merely a thin wrapper around a binary component that contains all the
> > actual code will not be accepted.
>
> There are two main reasons why I do not think that the "qtiseclib"
> conforms to these guidelines.
>
> --- 1. "Majority of the platform port must be open-source" ---
>
> I have built TF-A for QTI SC7180 according to the documentation (2).
> The resulting bl31.bin has a size of 182088 bytes. The linker conveniently
> produces a "bl31.map" file that shows exactly which part of the binary
> comes from which component of the TF-A port. It can be analyzed easily,
> for example with fpv-gcc (3).
>
> The following table shows the distribution of the bl31.bin:
>
> +-------------+----------+-----+
> | Component | Size (B) | % |
> +-------------+----------+-----+
> | libqtisec.a | 147344 | 81% |
> | Other BL31 | 23838 | 13% |
> | plat/qti | 5222 | 3% |
> | Padding | 3863 | 2% |
> | libc.a | 1821 | 1% |
> +-------------+----------+-----+
>
> Clearly, the libqtisec.a dominates with 81%. The open-source part of the
> QTI TF-A platform port (plat/qti) is merely 3% of the final binary.
>
> Perhaps it is just large static data tables? The following table shows
> only the distribution of .text symbols (excluding libc and "Other BL31"):
>
> +-------------+----------+-----+
> | Component | Size (B) | % |
> +-------------+----------+-----+
> | libqtisec.a | 75792 | 95% |
> | plat/qti | 3920 | 5% |
> +-------------+----------+-----+
>
> I do not see any way to interpret this as "the majority of the platform
> port is open-source". It is hard to find any substantial functionality
> that does not end up calling into the proprietary qtiseclib. In my
> opinion, the port is hardly more than "a thin wrapper around a binary
> component" which is explicitly forbidden in the guidelines.
>
> --- 2. "Binary components should be as minimal as possible" ---
>
> It is hard to judge this given that the license for "qtiseclib" (obviously)
> does not allow reverse-engineering. However, just judging from some of the
> symbol names that I see visibly in the "bl31.map" Qualcomm seems to have
> spent little effort to keep the binary component actually minimal.
>
> "qtiseclib" also contains code for IP blocks that have public
> open-source drivers in Linux, including for:
>
> - TLMM (GPIO)
> - GCC (Clocks)
> - rpmh
>
> Perhaps some "secret" registers are programmed there but it is hard to
> believe that there is no overlap that could have been made open-source.
>
> This is also quite visible based on changes that were made later.
> The PRNG and SPMI driver were moved out of "qtiseclib" later (4, 5)
> and both can be found similarly in Linux.
>
> --- Conclusion ---
>
> How does this conform to the Binary Components policy that is part of
> the contribution guidelines? Was this not checked during review?
>
> All in all I cannot help but get the feeling that Qualcomm has fairly
> little interest to have open-source firmware. Not even simple hardware
> initialization that probably exists similarly in open-source drivers
> has been implemented in open-source code. The resulting bl31.bin can
> be hardly called "open-source" when 81% of it is actually proprietary.
>
> If this is intended and considered acceptable I suggest rewriting the
> "Binary Components" policy to explicitly allow vendors to require
> any amount of proprietary code for their TF-A ports. Personally, I think
> this is a very bad idea though and just encourages all other vendors to
> do the same in the future. TF-A (as a trusted reference implementation)
> is in a good position to make certain demands that must be met for
> inclusion in the upstream tree.
>
> I am mainly sad about this because this certainly means that only
> Qualcomm can make such ports by providing the "qtiseclib" that contains
> most of the functionality. Perhaps open-source code could have been
> adjusted by the community to other platforms with some effort.
>
> Thanks for reading.
> ~ Tom
>
> (1) https://trustedfirmware-a.readthedocs.io/en/latest/process/contributing.htm…
> (2) https://trustedfirmware-a.readthedocs.io/en/latest/plat/qti.html
> (3) https://github.com/ebs-universe/fpv-gcc
> (4) https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/4885
> (5) https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/4409
>
> Thank you all for your feedback.
>
> It appears that in theory we are all happy with using bloblist with few
> implementation details which needs to be taken care of during
> implementation.
>
Just to clarify: are you using "bloblist" as a general term for the concept
of a simple linked list of tagged data blobs, or to refer specifically to
the U-Boot implementation with that name? The existing TF-A implementation
(bl_aux_params) is basically identical in concept to the U-Boot bloblist,
but not binary compatible. Are we talking about just keeping that, or
throwing it away in order to reimplement the exact structure U-Boot is
using? (I would prefer to keep the bl_aux_params as they are to avoid
disrupting existing uses, of course. Making backwards-incompatible changes
to an interface that passes across multiple repos and firmware components
is always a big pain.)