qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adding Implementation Defined ARM cpu registers


From: Roque Arcudia Hernandez
Subject: Adding Implementation Defined ARM cpu registers
Date: Mon, 6 Mar 2023 17:40:52 -0800

Hello,

I'm dealing with a problem in which I need to add support for some neoverse-v2 registers defined as implementation defined in the TRM of the core.

In file helper.c I can see the decision of whether or not a register is implemented is based mainly in function calls arm_feature(env, ARM_FEATURE_*) or cpu_isar_feature(<feature>, cpu).

The main feature I'm interested in is actually protected by a call to cpu_isar_feature but the neoverse-v2 needs extra IMP_ registers for extra configuration of the feature.

I cannot find any example of a set of registers that depend on a particular cpu. What I'm currently doing is defining a function to know if it is that particular core and add more registers for the feature:

    if (cpu_isar_feature(<feature>, cpu)) {
        define_arm_cp_regs(cpu, <feature>_reginfo);
        if (is_neoverse_v2_core(cpu)) {
            /* Add extra registers */
        }
    }

Where my helper function is defined as:

static bool is_neoverse_v2_core(ARMCPU *cpu)
{
    /* Looking for Neoverse-V2 Part Num 0b110101001111 */
    const uint64_t neoverse_v2_partnum = 0xd4f;
    uint64_t partnum = FIELD_EX64(cpu->midr, MIDR_EL1, PARTNUM);
    return (partnum == neoverse_v2_partnum);
}

Is this ok? Otherwise what is your recommendation?

Thanks

Roque


reply via email to

[Prev in Thread] Current Thread [Next in Thread]