Hi,
Please find the latest report on new defect(s) introduced to ARM-software/arm-trusted-firmware found with Coverity Scan.
1 new defect(s) introduced to ARM-software/arm-trusted-firmware found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)
** CID 365287: Control flow issues (MISSING_BREAK)
/plat/xilinx/zynqmp/pm_service/pm_svc_main.c: 334 in pm_smc_handler()
________________________________________________________________________________________________________
*** CID 365287: Control flow issues (MISSING_BREAK)
/plat/xilinx/zynqmp/pm_service/pm_svc_main.c: 334 in pm_smc_handler()
328 SMC_RET1(handle, (uint64_t)ret);
329
330 case PM_SET_MAX_LATENCY:
331 ret = pm_set_max_latency(pm_arg[0], pm_arg[1]);
332 SMC_RET1(handle, (uint64_t)ret);
333
>>> CID 365287: Control flow issues (MISSING_BREAK)
>>> The case for value "PM_GET_API_VERSION" is not terminated by a 'break' statement.
334 case PM_GET_API_VERSION:
335 /* Check is PM API version already verified */
336 if (pm_ctx.api_version >= PM_VERSION) {
337 if (!ipi_irq_flag) {
338 /*
339 * Enable IPI IRQ
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P…
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