Re: help needed with CPU feature detection for aarch64

[email protected] (Michael van Elst) Mon, 3 Nov 2025 15:21:11 -0000 (UTC)
Newsgroups gmane.os.netbsd.ports.arm
Organization Serpens User Group
Message-ID <[email protected]>
[email protected] (Thomas Klausner) writes:

>His questions seems to be mostly about how to interpret the
>machdep.id_aa64isar0 sysctl result.

machdep.id_aa64isar0 is OpenBSD, it's the 64bit value that
includes various flags about CPU features.

machdep.cpu0.id_cpu is NetBSD, the result is a

struct aarch64_sysctl_cpu_id {
        uint64_t ac_midr;       /* Main ID Register */
        uint64_t ac_revidr;     /* Revision ID Register */
        uint64_t ac_mpidr;      /* Multiprocessor Affinity Register */

        uint64_t ac_aa64dfr0;   /* A64 Debug Feature Register 0 */
        uint64_t ac_aa64dfr1;   /* A64 Debug Feature Register 1 */

        uint64_t ac_aa64isar0;  /* A64 Instruction Set Attribute Register 0 */
        uint64_t ac_aa64isar1;  /* A64 Instruction Set Attribute Register 1 */

        uint64_t ac_aa64mmfr0;  /* A64 Memory Model Feature Register 0 */
        uint64_t ac_aa64mmfr1;  /* A64 Memory Model Feature Register 1 */
        uint64_t ac_aa64mmfr2;  /* A64 Memory Model Feature Register 2 */

        uint64_t ac_aa64pfr0;   /* A64 Processor Feature Register 0 */
        uint64_t ac_aa64pfr1;   /* A64 Processor Feature Register 1 */

        uint64_t ac_aa64zfr0;   /* A64 SVE Feature ID Register 0 */

        uint32_t ac_mvfr0;      /* Media and VFP Feature Register 0 */
        uint32_t ac_mvfr1;      /* Media and VFP Feature Register 1 */
        uint32_t ac_mvfr2;      /* Media and VFP Feature Register 2 */
        uint32_t ac_pad;

        uint64_t ac_clidr;      /* Cache Level ID Register */
        uint64_t ac_ctr;        /* Cache Type Register */
};