target-arm: Clean up ARMv8 MIDR register space
cover target-arm: Clean up ARMv8 MIDR register space
This patch series combines two changes:
* use correct REVIDR reset value for Cortex-A53/A57
* add missing MIDR AArch32 aliases
Sergey Fedorov (2):
target-arm: Fix REVIDR reset value
target-arm: Add AArch32 MIDR aliases in ARMv8
target-arm/cpu-qom.h | 1 + target-arm/cpu64.c | 2 ++ target-arm/helper.c | 13 ++++++++----- 3 files changed, 11 insertions(+), 5 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/2 target-arm: Fix REVIDR reset value
According to ARM Cortex-A53/A57 TRM, REVIDR reset value should be zero. So let REVIDR reset value be specified by CPU model and correct it for Cortex-A53/A57.
--- target-arm/cpu-qom.h | 1 + target-arm/cpu64.c | 2 ++ target-arm/helper.c | 5 ++--- 3 files changed, 5 insertions(+), 3 deletions(-)
target-arm/cpu-qom.h +1 -0
@@ -127,6 +127,7 @@ typedef struct ARMCPU {* prefix means a constant register. */ uint32_t midr; +uint32_t revidr;uint32_t reset_fpsid;uint32_t mvfr0;uint32_t mvfr1;
target-arm/cpu64.c +2 -0
@@ -110,6 +110,7 @@ static void aarch64_a57_initfn(Object *obj)set_feature (&cpu->env,ARM_FEATURE_CRC ); cpu->kvm_target =QEMU_KVM_ARM_TARGET_CORTEX_A57 ; cpu->midr =0x411fd070 ; + cpu->revidr =0x00000000 ; cpu->reset_fpsid =0x41034070 ; cpu->mvfr0 =0x10110222 ; cpu->mvfr1 =0x12111111 ;
@@ -160,6 +161,7 @@ static void aarch64_a53_initfn(Object *obj)set_feature (&cpu->env,ARM_FEATURE_V8_PMULL );set_feature (&cpu->env,ARM_FEATURE_CRC ); cpu->midr =0x410fd034 ; + cpu->revidr =0x00000000 ; cpu->reset_fpsid =0x41034070 ; cpu->mvfr0 =0x10110222 ; cpu->mvfr1 =0x12111111 ;
target-arm/helper.c +2 -3
@@ -3355,15 +3355,14 @@ void register_cp_regs_for_features(ARMCPU *cpu) };ARMCPRegInfo id_v8_midr_cp_reginfo[] = {/* v8 MIDR -- the wildcard isn't necessary, and nor is the -* variable-MIDR TI925 behaviour. Instead we have a single -* (strictly speaking IMPDEF) alias of the MIDR, REVIDR. +* variable-MIDR TI925 behaviour. */ { .name ="MIDR_EL1" , .state =ARM_CP_STATE_BOTH , .opc0 =3 , .opc1 =0 , .crn =0 , .crm =0 , .opc2 =0 , .access =PL1_R , .type =ARM_CP_CONST , .resetvalue = cpu->midr }, { .name ="REVIDR_EL1" , .state =ARM_CP_STATE_BOTH , .opc0 =3 , .opc1 =0 , .crn =0 , .crm =0 , .opc2 =6 , - .access =PL1_R , .type =ARM_CP_CONST , .resetvalue = cpu->midr }, + .access =PL1_R , .type =ARM_CP_CONST , .resetvalue = cpu->revidr },REGINFO_SENTINEL };ARMCPRegInfo id_cp_reginfo[] = {
Signature · 1 line
1.9.1
PATCH 2/2 target-arm: add AArch32 MIDR aliases in ARMv8
In reply to Sergey FedorovAccording to ARMv8 ARM, there are additional aliases to MIDR system register in AArch32 state. So add them to the list.
--- target-arm/helper.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
target-arm/helper.c +7 -3
@@ -3354,12 +3354,16 @@ void register_cp_regs_for_features(ARMCPU *cpu)REGINFO_SENTINEL };ARMCPRegInfo id_v8_midr_cp_reginfo[] = { -/* v8 MIDR -- the wildcard isn't necessary, and nor is the -* variable-MIDR TI925 behaviour. -*/ { .name ="MIDR_EL1" , .state =ARM_CP_STATE_BOTH , .opc0 =3 , .opc1 =0 , .crn =0 , .crm =0 , .opc2 =0 , .access =PL1_R , .type =ARM_CP_CONST , .resetvalue = cpu->midr }, +/* crn = 0 op1 = 0 crm = 0 op2 = 4,7 : AArch32 aliases of MIDR */ + { .name ="MIDR" , .type =ARM_CP_ALIAS |ARM_CP_CONST , + .cp =15 , .crn =0 , .crm =0 , .opc1 =0 , .opc2 =4 , + .access =PL1_R , .resetvalue = cpu->midr }, + { .name ="MIDR" , .type =ARM_CP_ALIAS |ARM_CP_CONST , + .cp =15 , .crn =0 , .crm =0 , .opc1 =0 , .opc2 =7 , + .access =PL1_R , .resetvalue = cpu->midr }, { .name ="REVIDR_EL1" , .state =ARM_CP_STATE_BOTH , .opc0 =3 , .opc1 =0 , .crn =0 , .crm =0 , .opc2 =6 , .access =PL1_R , .type =ARM_CP_CONST , .resetvalue = cpu->revidr },
Signature · 1 line
1.9.1
Peter Maydell
AppliedQuoted 4 lines · Sergey Fedorov
This patch series combines two changes:
* use correct REVIDR reset value for Cortex-A53/A57
* add missing MIDR AArch32 aliases
Quoted 8 lines
Sergey Fedorov (2):
target-arm: Fix REVIDR reset value
target-arm: Add AArch32 MIDR aliases in ARMv8target-arm/cpu-qom.h | 1 + target-arm/cpu64.c | 2 ++ target-arm/helper.c | 13 ++++++++----- 3 files changed, 11 insertions(+), 5 deletions(-)
Applied to target-arm.next, thanks.
-- PMM