[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Adding Implementation Defined ARM cpu registers
From: |
Peter Maydell |
Subject: |
Re: Adding Implementation Defined ARM cpu registers |
Date: |
Tue, 7 Mar 2023 10:42:04 +0000 |
On Tue, 7 Mar 2023 at 01:41, Roque Arcudia Hernandez <roqueh@google.com> wrote:
>
> 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?
What's the feature that you need to add extra registers for?
thanks
-- PMM