Hi
I tried to turn on encryption in BL31.
And, I met some trouble.
Here is my code.
```
static struct plat_io_policy policies[] = {
...
[BL31_IMAGE_ID] = {&enc_dev_handle, &bl31_uuid_spec, check_enc_fip},
....
[ENC_IMAGE_ID] = {&fip_dev_handle, NULL, check_fip}
}
int plat_get_image_source(...) {
...
policy = &policies[image_id];
ret = policy->check[policy->image_spec];
...
}
static int check_fip(const uintptr_t spec)
{
int ret;
ret = io_dev_open(fip_dev_con, (uintptr_t)NULL, &fip_dev_handle);
if (ret) {
ERROR("io_dev_open failed for FIP (%d)\n", ret);
return ret;
}
ret = io_dev_init(fip_dev_handle, fip_image_id);
if (ret) {
ERROR("io_dev_init failed for FIP image id %lu (%d)\n",
fip_image_id, ret);
io_dev_close(fip_dev_handle);
}
return ret;
}
static int check_enc_fip(const uintptr_t spec)
{
int result;
uintptr_t local_image_handle;
/* See if a Firmware Image Package is available */
result = io_dev_open(enc_dev_con, (uintptr_t)NULL, &enc_dev_handle);
if (result) {
ERROR("io_dev_open failed for FIP (%d)\n", result);
return result;
}
result = io_dev_init(enc_dev_handle, (uintptr_t)ENC_IMAGE_ID);
if (result != 0)
return result;
return result;
}
```
But, I can't boot successfully.
Below is log.
```
INFO: Image id=3 loaded: 0x40800000 - 0x4080e299
INFO: BL2: Loading image id 5
WARNING: ===== allocate_dev_info 1 =====
WARNING: ==== -12 ====
ERROR: io_dev_open failed for FIP (-12)
ERROR: Image id 11 open failed with -12
WARNING: Failed to obtain reference to image id=11 (-12)
ERROR: BL2: Failed to load image id 5 (-12)
```
And, I found root cause in `allocate_dev_info` and `free_dev_info` in
`drivers/io/io_fip.c`
In `allocate_dev_info`, there is a count, `fip_dev_count`, increasing by 1
after calling `fip_dev_open`
There is a check. The value of MAX_FIP_DEVICES is 1.
```
if (fip_dev_count < (unsigned int)MAX_FIP_DEVICES) {
unsigned int index = 0;
result = find_first_fip_state(0, &index);
assert(result == 0);
/* initialize dev_info */
dev_info_pool[index].funcs = &fip_dev_funcs;
dev_info_pool[index].info =
(uintptr_t)&state_pool[index];
*dev_info = &dev_info_pool[index];
++fip_dev_count;
}
```
And, in `fip_dev_close`, The `fip_dev_count` will be decreased by 1.
However, The root casue is it call fip_dev_open but not calling
fip_dev_close.
It cause the `fip_dev_count` not be decreased by 1.
Now, I have two solution.
1. Increasing the MAX_FIP_DEVICES, it will be working.
2. Add the io_dev_close in `enc_dev_close` in `driver/io_/io_encrypted.c`.
And, it will call the fip_dev_close. It will be working.
Do you have any idea in this solution ?
Which solution is more general ?
Thanks !
Hi, On Jan 23rd 2025, in the TF-A Tech forum, Mate Toth-Pal and Soby Mathew
will present the RMM design of EL0 applications support. The TF-A Tech
forum is a regular open forum for anyone from the open source community to
participate. Feel free to reach if you have a topic you'd want to present.
It can be a design review with slides, walking through RFC patches, or more
generic discussion around open source projects. Regards, Olivier.
TF-A Tech Forum
Thursday Jan 23, 2025 ⋅ 5pm – 6pm
Central European Time - Paris
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/Trusted
Firmware is inviting you to a scheduled Zoom meeting.Join Zoom
Meetinghttps://linaro-org.zoom.us/my/trustedfirmware?pwd=VktXcm5MNUUyVVM4R0k3ZUtvdU84QT09
One 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
Guests
tf-a(a)lists.trustedfirmware.org
This event has been canceled with a note:
"Hi, No topic planned for this week. Regards, Olivier. "
TF-A Tech Forum
Thursday Jan 9, 2025 ⋅ 5pm – 6pm
Central European Time - Paris
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/Trusted
Firmware is inviting you to a scheduled Zoom meeting.Join Zoom
Meetinghttps://linaro-org.zoom.us/my/trustedfirmware?pwd=VktXcm5MNUUyVVM4R0k3ZUtvdU84QT09
One 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
Guests
tf-a(a)lists.trustedfirmware.org
~~//~~
Invitation from Google Calendar: https://calendar.google.com/calendar/
You are receiving this email because you are an attendee on the event.
Forwarding this invitation could allow any recipient to send a response to
the organizer, be added to the guest list, invite others regardless of
their own invitation status, or modify your RSVP.
Learn more https://support.google.com/calendar/answer/37135#forwarding
Hi,
On AMD-Xilinx ZynqMP platform there is a erratum (1530924) which is mentioned as applied as shown in the log below:
" INFO: BL31: cortex_a53: CPU workaround for erratum 1530924 was applied "
Refer to the code comments mentioned below, there is no "erratum has no workaround in the CPU. Generic code must take care "
https://gitenterprise.xilinx.com/Linux/arm-trusted-firmware/blob/master/lib…
However, we found no handling in the generic code either.
Can we be guided further regarding the handling of erratum 1530924 ?
Regards,
Maheedhar.
This event has been canceled.
TF-A Tech Forum
Thursday Dec 26, 2024 ⋅ 5pm – 6pm
Central European Time - Paris
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/Trusted
Firmware is inviting you to a scheduled Zoom meeting.Join Zoom
Meetinghttps://linaro-org.zoom.us/my/trustedfirmware?pwd=VktXcm5MNUUyVVM4R0k3ZUtvdU84QT09
One 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
Guests
tf-a(a)lists.trustedfirmware.org
~~//~~
Invitation from Google Calendar: https://calendar.google.com/calendar/
You are receiving this email because you are an attendee on the event.
Forwarding this invitation could allow any recipient to send a response to
the organizer, be added to the guest list, invite others regardless of
their own invitation status, or modify your RSVP.
Learn more https://support.google.com/calendar/answer/37135#forwarding