Skip to content

ARMv8-M: internal low-level (TrustZone) API & implementation for configuring IRQ target #6730

@ioannisg

Description

@ioannisg

This issue aims to define an internal API and implement it, to address #6376 for ARMv8-M (with Security Extension).

In irq_manage.c we implement the following ARM Cortex-M-specific functions:

  1. void irq_target_state_set(unsigned int irq, int secure_state);

  2. int irq_target_state_is_nonsecure(unsigned int irq);


Function irq_target_state_set(unsigned int irq, int secure_state) sets the security state (Secure or Non-Secure) targeted by the given irq.

irq_target_state_set(unsigned int irq, int nonsecure_state):

  • requires ARMv8-M
  • is only compiled if ARM_SECURE_FIRMWARE is defined
  • shall only be called if we are in Secure state, otherwise, a write attempt to NVIC.ITNS[x] register is WRITE-IGNORED (WI), because the ITNS register is not banked between security states
  • shall set the NVIC.ITNS[x].irq bit accordingly, depending on the secure_state
  • shall _ASSERT if the operation is not performed successfully

Function irq_target_state_is_secure(unsigned int irq) returns the security state targeted by the given irq.

irq_target_state_is_nonsecure(unsigned int irq)

  • requires ARMv8-M (mainline or baseline)
  • is only compiled if ARM_SECURE_FIRMWARE is defined
  • shall only be called if we are in Secure state, otherwise, a read attempt to NVIC.ITNS[x] register is READ-AS-ZERO, because the ITNS register is not banked between security states.
  • shall get the NVIC.ITNS[x].irq bit and return the security state it corresponds to

Metadata

Metadata

Assignees

Labels

FeatureA planned feature with a milestonearea: APIChanges to public APIsarea: ARMARM (32-bit) Architecturearea: Trusted ExecutionTrusted Execution

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions