Skip to content

Make use of DC ZVA instruction when zeroing memory #408

@danh-arm

Description

@danh-arm

When zeroing a range of normal memory, it is much more efficient to use the DC VZA instruction (if the implementation supports it) than store instructions . Trusted Firmware currently doesn't make use of this instruction. The DCZID_EL0 register should be read to determine if DC VZA is supported and the block size to use.

In particular:

  • The memset() implementation in lib/stdlib/mem.c is often called with zero as the val argument, which results in a loop of STRB instructions.
  • The zeromem16 implementation in lib/aarch64/misc_helpers.S uses STP and STRB instructions. This is used for zeroing out the BSS and coherent RAM sections.

There may be other places.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions