HomeFreeBSD

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

Description

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

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.

Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D48813
Signed-off-by: Harry Moulton <harry.moulton@arm.com>

Details

Provenance
harry.moulton_arm.comAuthored on Feb 17 2025, 3:58 PM
andrewCommitted on Feb 17 2025, 4:07 PM
Reviewer
andrew
Differential Revision
D48813: arm64: add CHECK_CPU_FEAT() for checking feature support in assembly
Parents
rG90a3b6a7a4e4: libkern: strdup.c, strndup.c: Prefer memcpy() over bcopy()
Branches
Unknown
Tags
Unknown