Page MenuHomeFreeBSD

arm64: add CHECK_CPU_FEAT() for checking feature support in assembly
ClosedPublic

Authored by harry.moulton_arm.com on Feb 3 2025, 4:49 PM.
Tags
None
Referenced Files
F162382248: D48813.diff
Sun, Jul 12, 5:13 PM
Unknown Object (File)
Mon, Jun 29, 10:48 PM
Unknown Object (File)
Mon, Jun 29, 1:16 AM
Unknown Object (File)
Fri, Jun 26, 9:39 PM
Unknown Object (File)
Fri, Jun 26, 11:35 AM
Unknown Object (File)
Thu, Jun 25, 5:13 AM
Unknown Object (File)
Fri, Jun 19, 3:42 AM
Unknown Object (File)
Jun 1 2026, 3:05 PM
Subscribers

Details

Summary

Add a new macro under asm.h to check whether a given CPU feature is
supported. There are a number of existing places where an ID register is
checked, and these have been updated in this change. These are for GIC
special registers, HAFDBS and HCX.

When calling, pass a temporary registers who's value is not important,
the name of the ID register (minus the exception level), the name of the
feature, and a label to jump to should the feature not be present. The
feature name should match with the macros defined in armreg.h or
hypervisor.h. Any feature-specific instructions can then be placed
between the macro and the label.

Sponsored by: Arm Ltd
Signed-off-by: Harry Moulton <harry.moulton@arm.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable