Hi
To understand the interrupt handling in TF-A, i recommend you go through https://trustedfirmware-a.readthedocs.io/en/latest/design/interrupt-framewo…
To debug your problem, you need to first check if the timer interrupt is generated as FIQ and check whether it indeed is trapped in EL3 (checking SCR_EL3.FIQ=1).
Regarding build errors while adding .S files and your assembly implementation, it will be better if you share your code (may be pushing a patch on https://review.trustedfirmware.org).
Thanks
Manish
________________________________
From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org> on behalf of Ian Burres via TF-A <tf-a(a)lists.trustedfirmware.org>
Sent: 06 January 2021 17:56
To: tf-a(a)lists.trustedfirmware.org <tf-a(a)lists.trustedfirmware.org>
Subject: [TF-A] Routing FIQ timer interrupts to EL3 on Raspberry Pi 4B
I am attempting to route FIQ timer interrupts using the ARM timers (not system timers) to EL3 in order to achieve introspection. I am running TF-A (cross compiled for AArch64/AArch32) on a Raspberry Pi 4B, which uses the Broadcom 2711 chipset. I have written some code, but I am not an embedded software engineer – I’m an IoT pentester. The ARM timers look like this:
RPI4_ARM_TIMER_LOAD 0x400
RPI4_ARM_TIMER_VALUE 0x404
…..
RPI4_ARM_TIMER_FREE_COUNTER 0x420
System timers are:
RPI4_SYS_TIMER_CLO, RPI4_SYS_TIMER_CS, etc…
I have successfully implement a Linux driver that allows me to dump kernel page tables and memory; however, I cannot see user page tables (even after running a CPU intensive program ). I believe the only way to view user page tables is to have interrupts routed to EL3 – a Linux driver is not sufficient. I have 3 UARTs attached with a debug log and screen setup. From what I have read, the Raspberry Pi 4B uses GICv2. TF-A supports EL3 routing when the build option GICV2_GO_FOR_EL3 is enabled, which I have done.
>From what I have gathered, the FIQ interrupt has to be written in assembly. So far, I have created a vector table, loaded the vector table, and masked and unmasked interrupts using daifclr, #3 and daifset, #3 instructions, using inline assembly. The timer is initinitialized and handled using C functions. I am using inline assembly, because I am adding code to the TF-A base, and I have not discovered how to add .S files to the build without receiving make errors. I will gladly share the code I have if it helps, but what I am really looking for is if anyone believes I am on the right track or not. Obviously, I am not implementing something correctly since the interrupt is not being handled. Thanks.
Thomas
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
I am attempting to route FIQ timer interrupts using the ARM timers (not system timers) to EL3 in order to achieve introspection. I am running TF-A (cross compiled for AArch64/AArch32) on a Raspberry Pi 4B, which uses the Broadcom 2711 chipset. I have written some code, but I am not an embedded software engineer – I’m an IoT pentester. The ARM timers look like this:
RPI4_ARM_TIMER_LOAD 0x400
RPI4_ARM_TIMER_VALUE 0x404
…..
RPI4_ARM_TIMER_FREE_COUNTER 0x420
System timers are:
RPI4_SYS_TIMER_CLO, RPI4_SYS_TIMER_CS, etc…
I have successfully implement a Linux driver that allows me to dump kernel page tables and memory; however, I cannot see user page tables (even after running a CPU intensive program ). I believe the only way to view user page tables is to have interrupts routed to EL3 – a Linux driver is not sufficient. I have 3 UARTs attached with a debug log and screen setup. >From what I have read, the Raspberry Pi 4B uses GICv2. TF-A supports EL3 routing when the build option GICV2_GO_FOR_EL3 is enabled, which I have done.
>From what I have gathered, the FIQ interrupt has to be written in assembly. So far, I have created a vector table, loaded the vector table, and masked and unmasked interrupts using daifclr, #3 and daifset, #3 instructions, using inline assembly. The timer is initinitialized and handled using C functions. I am using inline assembly, because I am adding code to the TF-A base, and I have not discovered how to add .S files to the build without receiving make errors. I will gladly share the code I have if it helps, but what I am really looking for is if anyone believes I am on the right track or not. Obviously, I am not implementing something correctly since the interrupt is not being handled. Thanks.
Thomas
Sent from Mail for Windows 10
Hi Carlo
Alexei created a patch for testing TF-A/TFTF builds with the toolchain GCC 10.2-2020.11
https://review.trustedfirmware.org/c/ci/tf-a-ci-scripts/+/7733
which flagged build errors for plat/amlogic/axg platform, please see below:
Build command lines:
make CROSS_COMPILE=aarch64-none-elf- PLAT=axg SPD=opteed DEBUG=1 V=1 fiptool all
make AML_USE_ATOS=1 CROSS_COMPILE=aarch64-none-elf- PLAT=axg DEBUG=1 V=1 fiptool all
plat/amlogic/axg/axg_pm.c: In function 'axg_pwr_domain_off':
plat/amlogic/axg/axg_pm.c:124:43: error: array subscript 2 is above array bounds of 'const plat_local_state_t[2]' {aka 'const unsigned char[2]'} [-Werror=array-bounds]
124 | if (target_state->pwr_domain_state[MPIDR_AFFLVL2] ==
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
In file included from plat/amlogic/axg/axg_pm.c:14:
include/lib/psci/psci.h:270:28: note: while referencing 'pwr_domain_state'
270 | plat_local_state_t pwr_domain_state[PLAT_MAX_PWR_LVL + U(1)];
| ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Makefile:1103: recipe for target '/work/workspace/workspace/tf-worker/trusted_firmware/build/axg/debug/bl31/axg_pm.o' failed
make: *** [/work/workspace/workspace/tf-worker/trusted_firmware/build/axg/debug/bl31/axg_pm.o] Error 1
Please help to resolve this issue.
Thanks
Manish Badarkhe
Hi Feng,
On Fri, Dec 18, 2020 at 04:41:37PM +0000, Chen Feng via TF-A wrote:
> Hi,
>
> While reading the Arm Firmware Framework for Armv8-A
> https://developer.arm.com/documentation/den0077/latest
>
> I do not find the API that for a sp to request vIRQ, or do I miss something.
>
> Is this some private API that is implementing defined FF-A IDs?
Is what you have in mind is an ABI that allows SP0 to raise an interrupt in SP1?
Could you please provide more information about your use case?
cheers,
Achin
>
>
> --
> cheers,
> feng
>
> --
> TF-A mailing list
> TF-A(a)lists.trustedfirmware.org
> https://lists.trustedfirmware.org/mailman/listinfo/tf-a
Hi all,
I have a similar but different question here :)
Why not the tf-a support both smpd and tspd.
Since the vendor's teeos that has not support ff-a interface currently.
With armv8.4-sel2, is there a choice to disable scr.eel2 with origin
vendor's theeos IDs, and enable scr.eel2 with new ff-a services?
It seems to need some tlb maintenance, but it seems work.
On 2020/11/23 3:27 下午, Achin Gupta via TF-A wrote:
> Hi Heyi,
>
> Happy to discuss the detail but the short answer is no.
>
> Instead, it is possible to run an MM partition in S-EL0 under the TEE. This work is being done with OP-TEE.
>
> From a SW architecture standpoint, it did not seem like a good idea to let EL3 run its "application" i.e. MM SP alongside a TEE which also runs its own applications. It is better to let the TEE own S-EL1 and run all applications in S-EL0 under it.
>
> Cheers,
> Achin
>
> On 23/11/2020, 05:36, "TF-A on behalf of Heyi Guo via TF-A" <tf-a-bounces(a)lists.trustedfirmware.org on behalf of tf-a(a)lists.trustedfirmware.org> wrote:
>
> Hi All,
>
> On some platforms there may be requirements to run both TEE and SPM_MM
> instances, such as providing TEE services on server platforms.
>
> Do TF-A support this scenario? If it doesn't, do it make sense to add
> such support?
>
> Thanks,
>
> Heyi
>
> --
> TF-A mailing list
> TF-A(a)lists.trustedfirmware.org
> https://lists.trustedfirmware.org/mailman/listinfo/tf-a
>
--
cheers,
feng
Hi,
While reading the Arm Firmware Framework for Armv8-A
https://developer.arm.com/documentation/den0077/latest
I do not find the API that for a sp to request vIRQ, or do I miss something.
Is this some private API that is implementing defined FF-A IDs?
--
cheers,
feng
Hi All,
The next TF-A Tech Forum is scheduled for Thu 17th December 2020 16:00 – 17:00 (GMT).
As well as being posted to the TF-A mailing list this has been cross posted to OPTEE mailing list. For OPTEE attendees the Zoom call details are included below.
Agenda:
* An introduction to the Trusted Services project
* Presented by Julian Hall
* Summary
* The Trusted Services project is a new trustedfirmware.org project that provides a home for security related service components that can run in the different isolated processing environments available on Arm Cortex-A. The project attempts to promote reuse and standardization to enable a consistent set of services to be provided by firmware, independent of which isolation technology is used.
If TF-A contributors have anything they wish to present at any future TF-A tech forum please contact me to have that scheduled.
Previous sessions, both recording and presentation material can be found on the trustedfirmware.org TF-A Technical meeting webpage: https://www.trustedfirmware.org/meetings/tf-a-technical-forum/
A scheduling tracking page is also available to help track sessions suggested and being prepared: https://developer.trustedfirmware.org/w/tf_a/tf-a-tech-forum-scheduling/ Final decisions on what will be presented will be shared a few days before the next meeting and shared on the TF-A mailing list.
This is the last TF-A Tech Forum session until January 2021.
Join Zoom Meeting
https://zoom.us/j/9159704974<https://www.google.com/url?q=https%3A%2F%2Fzoom.us%2Fj%2F9159704974&sa=D&us…>
Meeting ID: 915 970 4974
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-free
Meeting ID: 915 970 4974
Find your local number: https://zoom.us/u/ad27hc6t7h<https://www.google.com/url?q=https%3A%2F%2Fzoom.us%2Fu%2Fad27hc6t7h&sa=D&us…>
Thanks
Joanna