arm: followup on the ID register storage series
cover arm: followup on the ID register storage series
This series tries to address some low-hanging fruit on top of target-arm.next (move some more registers, some cosmetics; see discussion following <[email protected]>)
Also available at https://gitlab.com/cohuck/qemu id-reg-fixup-v1
Cornelia Huck (5):
arm/cpu: store id_afr0 into the idregs array arm/cpu: store id_aa64afr{0,1} into the idregs array arm/cpu: fix trailing ',' for SET_IDREG arm/cpu: store clidr into the idregs array arm/kvm: shorten one overly long line
hw/intc/armv7m_nvic.c | 4 +-- target/arm/cpu-sysregs.h.inc | 4 +++ target/arm/cpu.h | 6 +--- target/arm/cpu64.c | 8 ++--- target/arm/helper.c | 8 ++--- target/arm/kvm.c | 3 +- target/arm/tcg/cpu-v7m.c | 16 ++++----- target/arm/tcg/cpu32.c | 34 +++++++++--------- target/arm/tcg/cpu64.c | 68 ++++++++++++++++++------------------ 9 files changed, 76 insertions(+), 75 deletions(-)
base-commit: 7bc86ccbb59f2022014e132327a33b94a7ed00fe
Signature · 1 line
2.50.0
PATCH 1/5 arm/cpu: store id_afr0 into the idregs array
--- hw/intc/armv7m_nvic.c | 2 +- target/arm/cpu-sysregs.h.inc | 1 + target/arm/cpu.h | 1 - target/arm/cpu64.c | 4 ++-- target/arm/helper.c | 2 +- target/arm/tcg/cpu-v7m.c | 12 ++++++------ target/arm/tcg/cpu32.c | 22 +++++++++++----------- target/arm/tcg/cpu64.c | 16 ++++++++-------- 8 files changed, 30 insertions(+), 30 deletions(-)
hw/intc/armv7m_nvic.c +1 -1
@@ -1279,7 +1279,7 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs)if (!arm_feature (&cpu->env,ARM_FEATURE_M_MAIN )) { goto bad_offset; } -return cpu->id_afr0; +return GET_IDREG (isar,ID_AFR0 );case 0xd50 :/* MMFR0. */ if (!arm_feature (&cpu->env,ARM_FEATURE_M_MAIN )) { goto bad_offset;
target/arm/cpu-sysregs.h.inc +1 -0
@@ -14,6 +14,7 @@ DEF(ID_AA64MMFR3_EL1, 3, 0, 0, 7, 3) DEF(ID_PFR0_EL1, 3, 0, 0, 1, 0) DEF(ID_PFR1_EL1, 3, 0, 0, 1, 1) DEF(ID_DFR0_EL1, 3, 0, 0, 1, 2) +DEF(ID_AFR0_EL1, 3, 0, 0, 1, 3) DEF(ID_MMFR0_EL1, 3, 0, 0, 1, 4) DEF(ID_MMFR1_EL1, 3, 0, 0, 1, 5) DEF(ID_MMFR2_EL1, 3, 0, 0, 1, 6)
target/arm/cpu.h +0 -1
@@ -1066,7 +1066,6 @@ struct ArchCPU {uint32_t reset_sctlr;uint64_t pmceid0;uint64_t pmceid1; -uint32_t id_afr0;uint64_t id_aa64afr0;uint64_t id_aa64afr1;uint64_t clidr;
target/arm/cpu64.c +2 -2
@@ -655,7 +655,7 @@ static void aarch64_a57_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000131 );SET_IDREG (isar,ID_PFR1 ,0x00011011 );SET_IDREG (isar,ID_DFR0 ,0x03010066 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x10101105 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01260000 );
@@ -717,7 +717,7 @@ static void aarch64_a53_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000131 );SET_IDREG (isar,ID_PFR1 ,0x00011011 );SET_IDREG (isar,ID_DFR0 ,0x03010066 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x10101105 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01260000 );
target/arm/helper.c +1 -1
@@ -7805,7 +7805,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 3, .access = PL1_R, .type = ARM_CP_CONST, .accessfn = access_aa32_tid3, - .resetvalue = cpu->id_afr0 }, + .resetvalue = GET_IDREG(isar, ID_AFR0)}, { .name = "ID_MMFR0", .state = ARM_CP_STATE_BOTH, .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 4, .access = PL1_R, .type = ARM_CP_CONST,
target/arm/tcg/cpu-v7m.c +6 -6
@@ -62,7 +62,7 @@ static void cortex_m0_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000030 );SET_IDREG (isar,ID_PFR1 ,0x00000200 );SET_IDREG (isar,ID_DFR0 ,0x00100000 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x00000030 );SET_IDREG (isar,ID_MMFR1 ,0x00000000 );SET_IDREG (isar,ID_MMFR2 ,0x00000000 );
@@ -88,7 +88,7 @@ static void cortex_m3_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000030 );SET_IDREG (isar,ID_PFR1 ,0x00000200 );SET_IDREG (isar,ID_DFR0 ,0x00100000 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x00000030 );SET_IDREG (isar,ID_MMFR1 ,0x00000000 );SET_IDREG (isar,ID_MMFR2 ,0x00000000 );
@@ -119,7 +119,7 @@ static void cortex_m4_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000030 );SET_IDREG (isar,ID_PFR1 ,0x00000200 );SET_IDREG (isar,ID_DFR0 ,0x00100000 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x00000030 );SET_IDREG (isar,ID_MMFR1 ,0x00000000 );SET_IDREG (isar,ID_MMFR2 ,0x00000000 );
@@ -150,7 +150,7 @@ static void cortex_m7_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000030 );SET_IDREG (isar,ID_PFR1 ,0x00000200 );SET_IDREG (isar,ID_DFR0 ,0x00100000 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x00100030 );SET_IDREG (isar,ID_MMFR1 ,0x00000000 );SET_IDREG (isar,ID_MMFR2 ,0x01000000 );
@@ -183,7 +183,7 @@ static void cortex_m33_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000030 );SET_IDREG (isar,ID_PFR1 ,0x00000210 );SET_IDREG (isar,ID_DFR0 ,0x00200000 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x00101F40 );SET_IDREG (isar,ID_MMFR1 ,0x00000000 );SET_IDREG (isar,ID_MMFR2 ,0x01000000 );
@@ -221,7 +221,7 @@ static void cortex_m55_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x20000030 );SET_IDREG (isar,ID_PFR1 ,0x00000230 );SET_IDREG (isar,ID_DFR0 ,0x10200000 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x00111040 );SET_IDREG (isar,ID_MMFR1 ,0x00000000 );SET_IDREG (isar,ID_MMFR2 ,0x01000000 );
target/arm/tcg/cpu32.c +11 -11
@@ -225,7 +225,7 @@ static void arm1136_r2_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x111 );SET_IDREG (isar,ID_PFR1 ,0x1 );SET_IDREG (isar,ID_DFR0 ,0x2 ); - cpu->id_afr0 =0x3 ; +SET_IDREG (isar,ID_AFR0 ,0x3 );SET_IDREG (isar,ID_MMFR0 ,0x01130003 );SET_IDREG (isar,ID_MMFR1 ,0x10030302 );SET_IDREG (isar,ID_MMFR2 ,0x01222110 );
@@ -257,7 +257,7 @@ static void arm1136_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x111 );SET_IDREG (isar,ID_PFR1 ,0x1 );SET_IDREG (isar,ID_DFR0 ,0x2 ); - cpu->id_afr0 =0x3 ; +SET_IDREG (isar,ID_AFR0 ,0x3 );SET_IDREG (isar,ID_MMFR0 ,0x01130003 );SET_IDREG (isar,ID_MMFR1 ,0x10030302 );SET_IDREG (isar,ID_MMFR2 ,0x01222110 );
@@ -290,7 +290,7 @@ static void arm1176_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x111 );SET_IDREG (isar,ID_PFR1 ,0x11 );SET_IDREG (isar,ID_DFR0 ,0x33 ); - cpu->id_afr0 =0 ; +SET_IDREG (isar,ID_AFR0 ,0 );SET_IDREG (isar,ID_MMFR0 ,0x01130003 );SET_IDREG (isar,ID_MMFR1 ,0x10030302 );SET_IDREG (isar,ID_MMFR2 ,0x01222100 );
@@ -320,7 +320,7 @@ static void arm11mpcore_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x111 );SET_IDREG (isar,ID_PFR1 ,0x1 );SET_IDREG (isar,ID_DFR0 ,0 ); - cpu->id_afr0 =0x2 ; +SET_IDREG (isar,ID_AFR0 ,0x2 );SET_IDREG (isar,ID_MMFR0 ,0x01100103 );SET_IDREG (isar,ID_MMFR1 ,0x10020302 );SET_IDREG (isar,ID_MMFR2 ,0x01222000 );
@@ -360,7 +360,7 @@ static void cortex_a8_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x1031 );SET_IDREG (isar,ID_PFR1 ,0x11 );SET_IDREG (isar,ID_DFR0 ,0x400 ); - cpu->id_afr0 =0 ; +SET_IDREG (isar,ID_AFR0 ,0 );SET_IDREG (isar,ID_MMFR0 ,0x31100003 );SET_IDREG (isar,ID_MMFR1 ,0x20000000 );SET_IDREG (isar,ID_MMFR2 ,0x01202000 );
@@ -436,7 +436,7 @@ static void cortex_a9_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x1031 );SET_IDREG (isar,ID_PFR1 ,0x11 );SET_IDREG (isar,ID_DFR0 ,0x000 ); - cpu->id_afr0 =0 ; +SET_IDREG (isar,ID_AFR0 ,0 );SET_IDREG (isar,ID_MMFR0 ,0x00100103 );SET_IDREG (isar,ID_MMFR1 ,0x20000000 );SET_IDREG (isar,ID_MMFR2 ,0x01230000 );
@@ -502,7 +502,7 @@ static void cortex_a7_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00001131 );SET_IDREG (isar,ID_PFR1 ,0x00011011 );SET_IDREG (isar,ID_DFR0 ,0x02010555 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x10101105 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01240000 );
@@ -554,7 +554,7 @@ static void cortex_a15_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00001131 );SET_IDREG (isar,ID_PFR1 ,0x00011011 );SET_IDREG (isar,ID_DFR0 ,0x02010555 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x10201105 );SET_IDREG (isar,ID_MMFR1 ,0x20000000 );SET_IDREG (isar,ID_MMFR2 ,0x01240000 );
@@ -598,7 +598,7 @@ static void cortex_r5_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x0131 );SET_IDREG (isar,ID_PFR1 ,0x001 );SET_IDREG (isar,ID_DFR0 ,0x010400 ); - cpu->id_afr0 =0x0 ; +SET_IDREG (isar,ID_AFR0 ,0x0 );SET_IDREG (isar,ID_MMFR0 ,0x0210030 );SET_IDREG (isar,ID_MMFR1 ,0x00000000 );SET_IDREG (isar,ID_MMFR2 ,0x01200000 );
@@ -745,7 +745,7 @@ static void cortex_r52_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000131 );SET_IDREG (isar,ID_PFR1 ,0x10111001 );SET_IDREG (isar,ID_DFR0 ,0x03010006 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x00211040 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01200000 );
@@ -977,7 +977,7 @@ static void arm_max_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000131 );SET_IDREG (isar,ID_PFR1 ,0x00011011 );SET_IDREG (isar,ID_DFR0 ,0x03010066 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x10101105 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01260000 );
target/arm/tcg/cpu64.c +8 -8
@@ -52,7 +52,7 @@ static void aarch64_a35_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000131 );SET_IDREG (isar,ID_PFR1 ,0x00011011 );SET_IDREG (isar,ID_DFR0 ,0x03010066 ); - cpu->id_afr0 =0 ; +SET_IDREG (isar,ID_AFR0 ,0 );SET_IDREG (isar,ID_MMFR0 ,0x10201105 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01260000 );
@@ -227,7 +227,7 @@ static void aarch64_a55_initfn(Object *obj)SET_IDREG (isar,ID_AA64MMFR2 ,0x0000000000001011ull );SET_IDREG (isar,ID_AA64PFR0 ,0x0000000010112222ull );SET_IDREG (isar,ID_AA64PFR1 ,0x0000000000000010ull ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_DFR0 ,0x04010088 );SET_IDREG (isar,ID_ISAR0 ,0x02101110 );SET_IDREG (isar,ID_ISAR1 ,0x13112111 );
@@ -298,7 +298,7 @@ static void aarch64_a72_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000131 );SET_IDREG (isar,ID_PFR1 ,0x00011011 );SET_IDREG (isar,ID_DFR0 ,0x03010066 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x10201105 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01260000 );
@@ -360,7 +360,7 @@ static void aarch64_a76_initfn(Object *obj)SET_IDREG (isar,ID_AA64MMFR2 ,0x0000000000001011ull );SET_IDREG (isar,ID_AA64PFR0 ,0x1100000010111112ull );/* GIC filled in later */ SET_IDREG (isar,ID_AA64PFR1 ,0x0000000000000010ull ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_DFR0 ,0x04010088 );SET_IDREG (isar,ID_ISAR0 ,0x02101110 );SET_IDREG (isar,ID_ISAR1 ,0x13112111 );
@@ -608,7 +608,7 @@ static void aarch64_neoverse_n1_initfn(Object *obj)SET_IDREG (isar,ID_AA64MMFR2 ,0x0000000000001011ull );SET_IDREG (isar,ID_AA64PFR0 ,0x1100000010111112ull );/* GIC filled in later */ SET_IDREG (isar,ID_AA64PFR1 ,0x0000000000000020ull ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_DFR0 ,0x04010088 );SET_IDREG (isar,ID_ISAR0 ,0x02101110 );SET_IDREG (isar,ID_ISAR1 ,0x13112111 );
@@ -687,7 +687,7 @@ static void aarch64_neoverse_v1_initfn(Object *obj)SET_IDREG (isar,ID_AA64MMFR2 ,0x0220011102101011ull ),SET_IDREG (isar,ID_AA64PFR0 ,0x1101110120111112ull );/* GIC filled in later */ SET_IDREG (isar,ID_AA64PFR1 ,0x0000000000000020ull ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_DFR0 ,0x15011099 );SET_IDREG (isar,ID_ISAR0 ,0x02101110 );SET_IDREG (isar,ID_ISAR1 ,0x13112111 );
@@ -905,7 +905,7 @@ static void aarch64_a710_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x21110131 );SET_IDREG (isar,ID_PFR1 ,0x00010000 );/* GIC filled in later */ SET_IDREG (isar,ID_DFR0 ,0x16011099 ); - cpu->id_afr0 =0 ; +SET_IDREG (isar,ID_AFR0 ,0 );SET_IDREG (isar,ID_MMFR0 ,0x10201105 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01260000 );
@@ -1007,7 +1007,7 @@ static void aarch64_neoverse_n2_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x21110131 );SET_IDREG (isar,ID_PFR1 ,0x00010000 );/* GIC filled in later */ SET_IDREG (isar,ID_DFR0 ,0x16011099 ); - cpu->id_afr0 =0 ; +SET_IDREG (isar,ID_AFR0 ,0 );SET_IDREG (isar,ID_MMFR0 ,0x10201105 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01260000 );
Signature · 1 line
2.50.0
Re: [PATCH 1/5] arm/cpu: store id_afr0 into the idregs array
Quoted 11 lines · Cornelia Huck
Signed-off-by Cornelia Huck <[email protected]>--- hw/intc/armv7m_nvic.c | 2 +- target/arm/cpu-sysregs.h.inc | 1 + target/arm/cpu.h | 1 - target/arm/cpu64.c | 4 ++-- target/arm/helper.c | 2 +- target/arm/tcg/cpu-v7m.c | 12 ++++++------ target/arm/tcg/cpu32.c | 22 +++++++++++----------- target/arm/tcg/cpu64.c | 16 ++++++++-------- 8 files changed, 30 insertions(+), 30 deletions(-)
Re: [PATCH 1/5] arm/cpu: store id_afr0 into the idregs array
In reply to Cornelia HuckHi Connie,
Quoted 1 line · Cornelia Huck
Signed-off-by Cornelia Huck <[email protected]>
Eric
Quoted 320 lines
--- hw/intc/armv7m_nvic.c | 2 +- target/arm/cpu-sysregs.h.inc | 1 + target/arm/cpu.h | 1 - target/arm/cpu64.c | 4 ++-- target/arm/helper.c | 2 +- target/arm/tcg/cpu-v7m.c | 12 ++++++------ target/arm/tcg/cpu32.c | 22 +++++++++++----------- target/arm/tcg/cpu64.c | 16 ++++++++-------- 8 files changed, 30 insertions(+), 30 deletions(-)hw/intc/armv7m_nvic.c +1
-1@@ -1279,7 +1279,7 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs)if (!arm_feature (&cpu->env,ARM_FEATURE_M_MAIN )) { goto bad_offset; } -return cpu->id_afr0; +return GET_IDREG (isar,ID_AFR0 );case 0xd50 :/* MMFR0. */ if (!arm_feature (&cpu->env,ARM_FEATURE_M_MAIN )) { goto bad_offset;target/arm/cpu-sysregs.h.inc +1
-0@@ -14,6 +14,7 @@ DEF(ID_AA64MMFR3_EL1, 3, 0, 0, 7, 3) DEF(ID_PFR0_EL1, 3, 0, 0, 1, 0) DEF(ID_PFR1_EL1, 3, 0, 0, 1, 1) DEF(ID_DFR0_EL1, 3, 0, 0, 1, 2) +DEF(ID_AFR0_EL1, 3, 0, 0, 1, 3) DEF(ID_MMFR0_EL1, 3, 0, 0, 1, 4) DEF(ID_MMFR1_EL1, 3, 0, 0, 1, 5) DEF(ID_MMFR2_EL1, 3, 0, 0, 1, 6)target/arm/cpu.h +0
-1@@ -1066,7 +1066,6 @@ struct ArchCPU {uint32_t reset_sctlr;uint64_t pmceid0;uint64_t pmceid1; -uint32_t id_afr0;uint64_t id_aa64afr0;uint64_t id_aa64afr1;uint64_t clidr;target/arm/cpu64.c +2
-2@@ -655,7 +655,7 @@ static void aarch64_a57_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000131 );SET_IDREG (isar,ID_PFR1 ,0x00011011 );SET_IDREG (isar,ID_DFR0 ,0x03010066 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x10101105 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01260000 );@@ -717,7 +717,7 @@ static void aarch64_a53_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000131 );SET_IDREG (isar,ID_PFR1 ,0x00011011 );SET_IDREG (isar,ID_DFR0 ,0x03010066 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x10101105 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01260000 );target/arm/helper.c +1
-1@@ -7805,7 +7805,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 3, .access = PL1_R, .type = ARM_CP_CONST, .accessfn = access_aa32_tid3, - .resetvalue = cpu->id_afr0 }, + .resetvalue = GET_IDREG(isar, ID_AFR0)}, { .name = "ID_MMFR0", .state = ARM_CP_STATE_BOTH, .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 4, .access = PL1_R, .type = ARM_CP_CONST,target/arm/tcg/cpu-v7m.c +6
-6@@ -62,7 +62,7 @@ static void cortex_m0_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000030 );SET_IDREG (isar,ID_PFR1 ,0x00000200 );SET_IDREG (isar,ID_DFR0 ,0x00100000 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x00000030 );SET_IDREG (isar,ID_MMFR1 ,0x00000000 );SET_IDREG (isar,ID_MMFR2 ,0x00000000 );@@ -88,7 +88,7 @@ static void cortex_m3_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000030 );SET_IDREG (isar,ID_PFR1 ,0x00000200 );SET_IDREG (isar,ID_DFR0 ,0x00100000 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x00000030 );SET_IDREG (isar,ID_MMFR1 ,0x00000000 );SET_IDREG (isar,ID_MMFR2 ,0x00000000 );@@ -119,7 +119,7 @@ static void cortex_m4_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000030 );SET_IDREG (isar,ID_PFR1 ,0x00000200 );SET_IDREG (isar,ID_DFR0 ,0x00100000 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x00000030 );SET_IDREG (isar,ID_MMFR1 ,0x00000000 );SET_IDREG (isar,ID_MMFR2 ,0x00000000 );@@ -150,7 +150,7 @@ static void cortex_m7_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000030 );SET_IDREG (isar,ID_PFR1 ,0x00000200 );SET_IDREG (isar,ID_DFR0 ,0x00100000 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x00100030 );SET_IDREG (isar,ID_MMFR1 ,0x00000000 );SET_IDREG (isar,ID_MMFR2 ,0x01000000 );@@ -183,7 +183,7 @@ static void cortex_m33_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000030 );SET_IDREG (isar,ID_PFR1 ,0x00000210 );SET_IDREG (isar,ID_DFR0 ,0x00200000 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x00101F40 );SET_IDREG (isar,ID_MMFR1 ,0x00000000 );SET_IDREG (isar,ID_MMFR2 ,0x01000000 );@@ -221,7 +221,7 @@ static void cortex_m55_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x20000030 );SET_IDREG (isar,ID_PFR1 ,0x00000230 );SET_IDREG (isar,ID_DFR0 ,0x10200000 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x00111040 );SET_IDREG (isar,ID_MMFR1 ,0x00000000 );SET_IDREG (isar,ID_MMFR2 ,0x01000000 );target/arm/tcg/cpu32.c +11
-11@@ -225,7 +225,7 @@ static void arm1136_r2_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x111 );SET_IDREG (isar,ID_PFR1 ,0x1 );SET_IDREG (isar,ID_DFR0 ,0x2 ); - cpu->id_afr0 =0x3 ; +SET_IDREG (isar,ID_AFR0 ,0x3 );SET_IDREG (isar,ID_MMFR0 ,0x01130003 );SET_IDREG (isar,ID_MMFR1 ,0x10030302 );SET_IDREG (isar,ID_MMFR2 ,0x01222110 );@@ -257,7 +257,7 @@ static void arm1136_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x111 );SET_IDREG (isar,ID_PFR1 ,0x1 );SET_IDREG (isar,ID_DFR0 ,0x2 ); - cpu->id_afr0 =0x3 ; +SET_IDREG (isar,ID_AFR0 ,0x3 );SET_IDREG (isar,ID_MMFR0 ,0x01130003 );SET_IDREG (isar,ID_MMFR1 ,0x10030302 );SET_IDREG (isar,ID_MMFR2 ,0x01222110 );@@ -290,7 +290,7 @@ static void arm1176_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x111 );SET_IDREG (isar,ID_PFR1 ,0x11 );SET_IDREG (isar,ID_DFR0 ,0x33 ); - cpu->id_afr0 =0 ; +SET_IDREG (isar,ID_AFR0 ,0 );SET_IDREG (isar,ID_MMFR0 ,0x01130003 );SET_IDREG (isar,ID_MMFR1 ,0x10030302 );SET_IDREG (isar,ID_MMFR2 ,0x01222100 );@@ -320,7 +320,7 @@ static void arm11mpcore_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x111 );SET_IDREG (isar,ID_PFR1 ,0x1 );SET_IDREG (isar,ID_DFR0 ,0 ); - cpu->id_afr0 =0x2 ; +SET_IDREG (isar,ID_AFR0 ,0x2 );SET_IDREG (isar,ID_MMFR0 ,0x01100103 );SET_IDREG (isar,ID_MMFR1 ,0x10020302 );SET_IDREG (isar,ID_MMFR2 ,0x01222000 );@@ -360,7 +360,7 @@ static void cortex_a8_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x1031 );SET_IDREG (isar,ID_PFR1 ,0x11 );SET_IDREG (isar,ID_DFR0 ,0x400 ); - cpu->id_afr0 =0 ; +SET_IDREG (isar,ID_AFR0 ,0 );SET_IDREG (isar,ID_MMFR0 ,0x31100003 );SET_IDREG (isar,ID_MMFR1 ,0x20000000 );SET_IDREG (isar,ID_MMFR2 ,0x01202000 );@@ -436,7 +436,7 @@ static void cortex_a9_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x1031 );SET_IDREG (isar,ID_PFR1 ,0x11 );SET_IDREG (isar,ID_DFR0 ,0x000 ); - cpu->id_afr0 =0 ; +SET_IDREG (isar,ID_AFR0 ,0 );SET_IDREG (isar,ID_MMFR0 ,0x00100103 );SET_IDREG (isar,ID_MMFR1 ,0x20000000 );SET_IDREG (isar,ID_MMFR2 ,0x01230000 );@@ -502,7 +502,7 @@ static void cortex_a7_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00001131 );SET_IDREG (isar,ID_PFR1 ,0x00011011 );SET_IDREG (isar,ID_DFR0 ,0x02010555 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x10101105 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01240000 );@@ -554,7 +554,7 @@ static void cortex_a15_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00001131 );SET_IDREG (isar,ID_PFR1 ,0x00011011 );SET_IDREG (isar,ID_DFR0 ,0x02010555 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x10201105 );SET_IDREG (isar,ID_MMFR1 ,0x20000000 );SET_IDREG (isar,ID_MMFR2 ,0x01240000 );@@ -598,7 +598,7 @@ static void cortex_r5_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x0131 );SET_IDREG (isar,ID_PFR1 ,0x001 );SET_IDREG (isar,ID_DFR0 ,0x010400 ); - cpu->id_afr0 =0x0 ; +SET_IDREG (isar,ID_AFR0 ,0x0 );SET_IDREG (isar,ID_MMFR0 ,0x0210030 );SET_IDREG (isar,ID_MMFR1 ,0x00000000 );SET_IDREG (isar,ID_MMFR2 ,0x01200000 );@@ -745,7 +745,7 @@ static void cortex_r52_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000131 );SET_IDREG (isar,ID_PFR1 ,0x10111001 );SET_IDREG (isar,ID_DFR0 ,0x03010006 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x00211040 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01200000 );@@ -977,7 +977,7 @@ static void arm_max_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000131 );SET_IDREG (isar,ID_PFR1 ,0x00011011 );SET_IDREG (isar,ID_DFR0 ,0x03010066 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x10101105 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01260000 );target/arm/tcg/cpu64.c +8
-8@@ -52,7 +52,7 @@ static void aarch64_a35_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000131 );SET_IDREG (isar,ID_PFR1 ,0x00011011 );SET_IDREG (isar,ID_DFR0 ,0x03010066 ); - cpu->id_afr0 =0 ; +SET_IDREG (isar,ID_AFR0 ,0 );SET_IDREG (isar,ID_MMFR0 ,0x10201105 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01260000 );@@ -227,7 +227,7 @@ static void aarch64_a55_initfn(Object *obj)SET_IDREG (isar,ID_AA64MMFR2 ,0x0000000000001011ull );SET_IDREG (isar,ID_AA64PFR0 ,0x0000000010112222ull );SET_IDREG (isar,ID_AA64PFR1 ,0x0000000000000010ull ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_DFR0 ,0x04010088 );SET_IDREG (isar,ID_ISAR0 ,0x02101110 );SET_IDREG (isar,ID_ISAR1 ,0x13112111 );@@ -298,7 +298,7 @@ static void aarch64_a72_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x00000131 );SET_IDREG (isar,ID_PFR1 ,0x00011011 );SET_IDREG (isar,ID_DFR0 ,0x03010066 ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_MMFR0 ,0x10201105 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01260000 );@@ -360,7 +360,7 @@ static void aarch64_a76_initfn(Object *obj)SET_IDREG (isar,ID_AA64MMFR2 ,0x0000000000001011ull );SET_IDREG (isar,ID_AA64PFR0 ,0x1100000010111112ull );/* GIC filled in later */ SET_IDREG (isar,ID_AA64PFR1 ,0x0000000000000010ull ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_DFR0 ,0x04010088 );SET_IDREG (isar,ID_ISAR0 ,0x02101110 );SET_IDREG (isar,ID_ISAR1 ,0x13112111 );@@ -608,7 +608,7 @@ static void aarch64_neoverse_n1_initfn(Object *obj)SET_IDREG (isar,ID_AA64MMFR2 ,0x0000000000001011ull );SET_IDREG (isar,ID_AA64PFR0 ,0x1100000010111112ull );/* GIC filled in later */ SET_IDREG (isar,ID_AA64PFR1 ,0x0000000000000020ull ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_DFR0 ,0x04010088 );SET_IDREG (isar,ID_ISAR0 ,0x02101110 );SET_IDREG (isar,ID_ISAR1 ,0x13112111 );@@ -687,7 +687,7 @@ static void aarch64_neoverse_v1_initfn(Object *obj)SET_IDREG (isar,ID_AA64MMFR2 ,0x0220011102101011ull ),SET_IDREG (isar,ID_AA64PFR0 ,0x1101110120111112ull );/* GIC filled in later */ SET_IDREG (isar,ID_AA64PFR1 ,0x0000000000000020ull ); - cpu->id_afr0 =0x00000000 ; +SET_IDREG (isar,ID_AFR0 ,0x00000000 );SET_IDREG (isar,ID_DFR0 ,0x15011099 );SET_IDREG (isar,ID_ISAR0 ,0x02101110 );SET_IDREG (isar,ID_ISAR1 ,0x13112111 );@@ -905,7 +905,7 @@ static void aarch64_a710_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x21110131 );SET_IDREG (isar,ID_PFR1 ,0x00010000 );/* GIC filled in later */ SET_IDREG (isar,ID_DFR0 ,0x16011099 ); - cpu->id_afr0 =0 ; +SET_IDREG (isar,ID_AFR0 ,0 );SET_IDREG (isar,ID_MMFR0 ,0x10201105 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01260000 );@@ -1007,7 +1007,7 @@ static void aarch64_neoverse_n2_initfn(Object *obj)SET_IDREG (isar,ID_PFR0 ,0x21110131 );SET_IDREG (isar,ID_PFR1 ,0x00010000 );/* GIC filled in later */ SET_IDREG (isar,ID_DFR0 ,0x16011099 ); - cpu->id_afr0 =0 ; +SET_IDREG (isar,ID_AFR0 ,0 );SET_IDREG (isar,ID_MMFR0 ,0x10201105 );SET_IDREG (isar,ID_MMFR1 ,0x40000000 );SET_IDREG (isar,ID_MMFR2 ,0x01260000 );
PATCH 2/5 arm/cpu: store id_aa64afr{0,1} into the idregs array
In reply to Cornelia Huck--- target/arm/cpu-sysregs.h.inc | 2 ++ target/arm/cpu.h | 2 -- target/arm/helper.c | 4 ++-- target/arm/tcg/cpu64.c | 16 ++++++++-------- 4 files changed, 12 insertions(+), 12 deletions(-)
target/arm/cpu-sysregs.h.inc +2 -0
@@ -4,6 +4,8 @@ DEF(ID_AA64PFR1_EL1, 3, 0, 0, 4, 1) DEF(ID_AA64SMFR0_EL1, 3, 0, 0, 4, 5) DEF(ID_AA64DFR0_EL1, 3, 0, 0, 5, 0) DEF(ID_AA64DFR1_EL1, 3, 0, 0, 5, 1) +DEF(ID_AA64AFR0_EL1, 3, 0, 0, 5, 4) +DEF(ID_AA64AFR1_EL1, 3, 0, 0, 5, 5) DEF(ID_AA64ISAR0_EL1, 3, 0, 0, 6, 0) DEF(ID_AA64ISAR1_EL1, 3, 0, 0, 6, 1) DEF(ID_AA64ISAR2_EL1, 3, 0, 0, 6, 2)
target/arm/cpu.h +0 -2
@@ -1066,8 +1066,6 @@ struct ArchCPU {uint32_t reset_sctlr;uint64_t pmceid0;uint64_t pmceid1; -uint64_t id_aa64afr0; -uint64_t id_aa64afr1;uint64_t clidr;uint64_t mp_affinity;/* MP ID without feature bits */ /* The elements of this array are the CCSIDR values for each cache,
target/arm/helper.c +2 -2
@@ -7983,12 +7983,12 @@ void register_cp_regs_for_features(ARMCPU *cpu) .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 4, .access = PL1_R, .type = ARM_CP_CONST, .accessfn = access_aa64_tid3, - .resetvalue = cpu->id_aa64afr0 }, + .resetvalue = GET_IDREG(isar, ID_AA64AFR0) }, { .name = "ID_AA64AFR1_EL1", .state = ARM_CP_STATE_AA64, .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 5, .access = PL1_R, .type = ARM_CP_CONST, .accessfn = access_aa64_tid3, - .resetvalue = cpu->id_aa64afr1 }, + .resetvalue = GET_IDREG(isar, ID_AA64AFR1) }, { .name = "ID_AA64AFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64, .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 6, .access = PL1_R, .type = ARM_CP_CONST,
target/arm/tcg/cpu64.c +8 -8
@@ -428,8 +428,8 @@ static void aarch64_a64fx_initfn(Object *obj)SET_IDREG (isar,ID_AA64PFR1 ,0x0000000000000000 );SET_IDREG (isar,ID_AA64DFR0 ,0x0000000010305408 ),SET_IDREG (isar,ID_AA64DFR1 ,0x0000000000000000 ), - cpu->id_aa64afr0 =0x0000000000000000 ; - cpu->id_aa64afr1 =0x0000000000000000 ; +SET_IDREG (isar,ID_AA64AFR0 ,0x0000000000000000 ); +SET_IDREG (isar,ID_AA64AFR1 ,0x0000000000000000 );SET_IDREG (isar,ID_AA64MMFR0 ,0x0000000000001122 );SET_IDREG (isar,ID_AA64MMFR1 ,0x0000000011212100 );SET_IDREG (isar,ID_AA64MMFR2 ,0x0000000000001011 );
@@ -676,8 +676,8 @@ static void aarch64_neoverse_v1_initfn(Object *obj) cpu->clidr =0x82000023 ; cpu->ctr =0xb444c004 ;/* With DIC and IDC set */ cpu->dcz_blocksize =4 ; - cpu->id_aa64afr0 =0x00000000 ; - cpu->id_aa64afr1 =0x00000000 ; +SET_IDREG (isar,ID_AA64AFR0 ,0x00000000 ); +SET_IDREG (isar,ID_AA64AFR1 ,0x00000000 );SET_IDREG (isar,ID_AA64DFR0 ,0x000001f210305519ull ),SET_IDREG (isar,ID_AA64DFR1 ,0x00000000 ),SET_IDREG (isar,ID_AA64ISAR0 ,0x1011111110212120ull );/* with FEAT_RNG */
@@ -927,8 +927,8 @@ static void aarch64_a710_initfn(Object *obj)SET_IDREG (isar,ID_AA64ZFR0 ,0x0000110100110021ull );/* with Crypto */ SET_IDREG (isar,ID_AA64DFR0 ,0x000011f010305619ull );SET_IDREG (isar,ID_AA64DFR1 ,0 ); - cpu->id_aa64afr0 =0 ; - cpu->id_aa64afr1 =0 ; +SET_IDREG (isar,ID_AA64AFR0 ,0 ); +SET_IDREG (isar,ID_AA64AFR1 ,0 );SET_IDREG (isar,ID_AA64ISAR0 ,0x0221111110212120ull );/* with Crypto */ SET_IDREG (isar,ID_AA64ISAR1 ,0x0010111101211052ull );SET_IDREG (isar,ID_AA64MMFR0 ,0x0000022200101122ull );
@@ -1029,8 +1029,8 @@ static void aarch64_neoverse_n2_initfn(Object *obj)SET_IDREG (isar,ID_AA64ZFR0 ,0x0000110100110021ull );/* with Crypto */ SET_IDREG (isar,ID_AA64DFR0 ,0x000011f210305619ull );SET_IDREG (isar,ID_AA64DFR1 ,0 ); - cpu->id_aa64afr0 =0 ; - cpu->id_aa64afr1 =0 ; +SET_IDREG (isar,ID_AA64AFR0 ,0 ); +SET_IDREG (isar,ID_AA64AFR1 ,0 );SET_IDREG (isar,ID_AA64ISAR0 ,0x1221111110212120ull );/* with Crypto and FEAT_RNG */ SET_IDREG (isar,ID_AA64ISAR1 ,0x0011111101211052ull );SET_IDREG (isar,ID_AA64MMFR0 ,0x0000022200101125ull );
Signature · 1 line
2.50.0
Re: [PATCH 2/5] arm/cpu: store id_aa64afr{0,1} into the idregs array
Quoted 7 lines · Cornelia Huck
Signed-off-by Cornelia Huck <[email protected]>--- target/arm/cpu-sysregs.h.inc | 2 ++ target/arm/cpu.h | 2 -- target/arm/helper.c | 4 ++-- target/arm/tcg/cpu64.c | 16 ++++++++-------- 4 files changed, 12 insertions(+), 12 deletions(-)
Re: [PATCH 2/5] arm/cpu: store id_aa64afr{0,1} into the idregs array
In reply to Cornelia HuckQuoted 1 line · Cornelia Huck
Signed-off-by Cornelia Huck <[email protected]>
Eric
Quoted 100 lines
--- target/arm/cpu-sysregs.h.inc | 2 ++ target/arm/cpu.h | 2 -- target/arm/helper.c | 4 ++-- target/arm/tcg/cpu64.c | 16 ++++++++-------- 4 files changed, 12 insertions(+), 12 deletions(-)target/arm/cpu-sysregs.h.inc +2
-0@@ -4,6 +4,8 @@ DEF(ID_AA64PFR1_EL1, 3, 0, 0, 4, 1) DEF(ID_AA64SMFR0_EL1, 3, 0, 0, 4, 5) DEF(ID_AA64DFR0_EL1, 3, 0, 0, 5, 0) DEF(ID_AA64DFR1_EL1, 3, 0, 0, 5, 1) +DEF(ID_AA64AFR0_EL1, 3, 0, 0, 5, 4) +DEF(ID_AA64AFR1_EL1, 3, 0, 0, 5, 5) DEF(ID_AA64ISAR0_EL1, 3, 0, 0, 6, 0) DEF(ID_AA64ISAR1_EL1, 3, 0, 0, 6, 1) DEF(ID_AA64ISAR2_EL1, 3, 0, 0, 6, 2)target/arm/cpu.h +0
-2@@ -1066,8 +1066,6 @@ struct ArchCPU {uint32_t reset_sctlr;uint64_t pmceid0;uint64_t pmceid1; -uint64_t id_aa64afr0; -uint64_t id_aa64afr1;uint64_t clidr;uint64_t mp_affinity;/* MP ID without feature bits */ /* The elements of this array are the CCSIDR values for each cache, target/arm/helper.c +2
-2@@ -7983,12 +7983,12 @@ void register_cp_regs_for_features(ARMCPU *cpu) .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 4, .access = PL1_R, .type = ARM_CP_CONST, .accessfn = access_aa64_tid3, - .resetvalue = cpu->id_aa64afr0 }, + .resetvalue = GET_IDREG(isar, ID_AA64AFR0) }, { .name = "ID_AA64AFR1_EL1", .state = ARM_CP_STATE_AA64, .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 5, .access = PL1_R, .type = ARM_CP_CONST, .accessfn = access_aa64_tid3, - .resetvalue = cpu->id_aa64afr1 }, + .resetvalue = GET_IDREG(isar, ID_AA64AFR1) }, { .name = "ID_AA64AFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64, .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 6, .access = PL1_R, .type = ARM_CP_CONST,target/arm/tcg/cpu64.c +8
-8@@ -428,8 +428,8 @@ static void aarch64_a64fx_initfn(Object *obj)SET_IDREG (isar,ID_AA64PFR1 ,0x0000000000000000 );SET_IDREG (isar,ID_AA64DFR0 ,0x0000000010305408 ),SET_IDREG (isar,ID_AA64DFR1 ,0x0000000000000000 ), - cpu->id_aa64afr0 =0x0000000000000000 ; - cpu->id_aa64afr1 =0x0000000000000000 ; +SET_IDREG (isar,ID_AA64AFR0 ,0x0000000000000000 ); +SET_IDREG (isar,ID_AA64AFR1 ,0x0000000000000000 );SET_IDREG (isar,ID_AA64MMFR0 ,0x0000000000001122 );SET_IDREG (isar,ID_AA64MMFR1 ,0x0000000011212100 );SET_IDREG (isar,ID_AA64MMFR2 ,0x0000000000001011 );@@ -676,8 +676,8 @@ static void aarch64_neoverse_v1_initfn(Object *obj) cpu->clidr =0x82000023 ; cpu->ctr =0xb444c004 ;/* With DIC and IDC set */ cpu->dcz_blocksize =4 ; - cpu->id_aa64afr0 =0x00000000 ; - cpu->id_aa64afr1 =0x00000000 ; +SET_IDREG (isar,ID_AA64AFR0 ,0x00000000 ); +SET_IDREG (isar,ID_AA64AFR1 ,0x00000000 );SET_IDREG (isar,ID_AA64DFR0 ,0x000001f210305519ull ),SET_IDREG (isar,ID_AA64DFR1 ,0x00000000 ),SET_IDREG (isar,ID_AA64ISAR0 ,0x1011111110212120ull );/* with FEAT_RNG */ @@ -927,8 +927,8 @@ static void aarch64_a710_initfn(Object *obj)SET_IDREG (isar,ID_AA64ZFR0 ,0x0000110100110021ull );/* with Crypto */ SET_IDREG (isar,ID_AA64DFR0 ,0x000011f010305619ull );SET_IDREG (isar,ID_AA64DFR1 ,0 ); - cpu->id_aa64afr0 =0 ; - cpu->id_aa64afr1 =0 ; +SET_IDREG (isar,ID_AA64AFR0 ,0 ); +SET_IDREG (isar,ID_AA64AFR1 ,0 );SET_IDREG (isar,ID_AA64ISAR0 ,0x0221111110212120ull );/* with Crypto */ SET_IDREG (isar,ID_AA64ISAR1 ,0x0010111101211052ull );SET_IDREG (isar,ID_AA64MMFR0 ,0x0000022200101122ull );@@ -1029,8 +1029,8 @@ static void aarch64_neoverse_n2_initfn(Object *obj)SET_IDREG (isar,ID_AA64ZFR0 ,0x0000110100110021ull );/* with Crypto */ SET_IDREG (isar,ID_AA64DFR0 ,0x000011f210305619ull );SET_IDREG (isar,ID_AA64DFR1 ,0 ); - cpu->id_aa64afr0 =0 ; - cpu->id_aa64afr1 =0 ; +SET_IDREG (isar,ID_AA64AFR0 ,0 ); +SET_IDREG (isar,ID_AA64AFR1 ,0 );SET_IDREG (isar,ID_AA64ISAR0 ,0x1221111110212120ull );/* with Crypto and FEAT_RNG */ SET_IDREG (isar,ID_AA64ISAR1 ,0x0011111101211052ull );SET_IDREG (isar,ID_AA64MMFR0 ,0x0000022200101125ull );
PATCH 3/5 arm/cpu: fix trailing ',' for SET_IDREG
In reply to Cornelia HuckWhile a trailing comma is not broken for SET_IDREG invocations, it does look odd; use a semicolon instead.
--- target/arm/tcg/cpu64.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
target/arm/tcg/cpu64.c +7 -7
@@ -352,7 +352,7 @@ static void aarch64_a76_initfn(Object *obj) cpu->clidr =0x82000023 ; cpu->ctr =0x8444C004 ; cpu->dcz_blocksize =4 ; -SET_IDREG (isar,ID_AA64DFR0 ,0x0000000010305408ull ), +SET_IDREG (isar,ID_AA64DFR0 ,0x0000000010305408ull );SET_IDREG (isar,ID_AA64ISAR0 ,0x0000100010211120ull );SET_IDREG (isar,ID_AA64ISAR1 ,0x0000000000100001ull );SET_IDREG (isar,ID_AA64MMFR0 ,0x0000000000101122ull );
@@ -426,8 +426,8 @@ static void aarch64_a64fx_initfn(Object *obj) cpu->reset_sctlr =0x30000180 ;SET_IDREG (isar,ID_AA64PFR0 ,0x0000000101111111 );/* No RAS Extensions */ SET_IDREG (isar,ID_AA64PFR1 ,0x0000000000000000 ); -SET_IDREG (isar,ID_AA64DFR0 ,0x0000000010305408 ), -SET_IDREG (isar,ID_AA64DFR1 ,0x0000000000000000 ), +SET_IDREG (isar,ID_AA64DFR0 ,0x0000000010305408 ); +SET_IDREG (isar,ID_AA64DFR1 ,0x0000000000000000 );SET_IDREG (isar,ID_AA64AFR0 ,0x0000000000000000 );SET_IDREG (isar,ID_AA64AFR1 ,0x0000000000000000 );SET_IDREG (isar,ID_AA64MMFR0 ,0x0000000000001122 );
@@ -678,13 +678,13 @@ static void aarch64_neoverse_v1_initfn(Object *obj) cpu->dcz_blocksize =4 ;SET_IDREG (isar,ID_AA64AFR0 ,0x00000000 );SET_IDREG (isar,ID_AA64AFR1 ,0x00000000 ); -SET_IDREG (isar,ID_AA64DFR0 ,0x000001f210305519ull ), -SET_IDREG (isar,ID_AA64DFR1 ,0x00000000 ), +SET_IDREG (isar,ID_AA64DFR0 ,0x000001f210305519ull ); +SET_IDREG (isar,ID_AA64DFR1 ,0x00000000 );SET_IDREG (isar,ID_AA64ISAR0 ,0x1011111110212120ull );/* with FEAT_RNG */ SET_IDREG (isar,ID_AA64ISAR1 ,0x0011000001211032ull );SET_IDREG (isar,ID_AA64MMFR0 ,0x0000000000101125ull ); -SET_IDREG (isar,ID_AA64MMFR1 ,0x0000000010212122ull ), -SET_IDREG (isar,ID_AA64MMFR2 ,0x0220011102101011ull ), +SET_IDREG (isar,ID_AA64MMFR1 ,0x0000000010212122ull ); +SET_IDREG (isar,ID_AA64MMFR2 ,0x0220011102101011ull );SET_IDREG (isar,ID_AA64PFR0 ,0x1101110120111112ull );/* GIC filled in later */ SET_IDREG (isar,ID_AA64PFR1 ,0x0000000000000020ull );SET_IDREG (isar,ID_AFR0 ,0x00000000 );
Signature · 1 line
2.50.0
Re: [PATCH 3/5] arm/cpu: fix trailing ',' for SET_IDREG
Quoted 9 lines · Cornelia Huck
While a trailing comma is not broken for
SET_IDREGinvocations, it does look odd; use a semicolon instead.Fixes f1fd81291c91 ("arm/cpu: Store aa64mmfr0-3 into the idregs array")Fixes def3f1c1026a ("arm/cpu: Store aa64dfr0/1 into the idregs array")Signed-off-by Cornelia Huck <[email protected]>--- target/arm/tcg/cpu64.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
Re: [PATCH 3/5] arm/cpu: fix trailing ',' for SET_IDREG
In reply to Cornelia HuckQuoted 6 lines · Cornelia Huck
While a trailing comma is not broken for
SET_IDREGinvocations, it does look odd; use a semicolon instead.Fixes f1fd81291c91 ("arm/cpu: Store aa64mmfr0-3 into the idregs array")Fixes def3f1c1026a ("arm/cpu: Store aa64dfr0/1 into the idregs array")Signed-off-by Cornelia Huck <[email protected]>
Eric
Quoted 46 lines
--- target/arm/tcg/cpu64.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)target/arm/tcg/cpu64.c +7
-7@@ -352,7 +352,7 @@ static void aarch64_a76_initfn(Object *obj) cpu->clidr =0x82000023 ; cpu->ctr =0x8444C004 ; cpu->dcz_blocksize =4 ; -SET_IDREG (isar,ID_AA64DFR0 ,0x0000000010305408ull ), +SET_IDREG (isar,ID_AA64DFR0 ,0x0000000010305408ull );SET_IDREG (isar,ID_AA64ISAR0 ,0x0000100010211120ull );SET_IDREG (isar,ID_AA64ISAR1 ,0x0000000000100001ull );SET_IDREG (isar,ID_AA64MMFR0 ,0x0000000000101122ull );@@ -426,8 +426,8 @@ static void aarch64_a64fx_initfn(Object *obj) cpu->reset_sctlr =0x30000180 ;SET_IDREG (isar,ID_AA64PFR0 ,0x0000000101111111 );/* No RAS Extensions */ SET_IDREG (isar,ID_AA64PFR1 ,0x0000000000000000 ); -SET_IDREG (isar,ID_AA64DFR0 ,0x0000000010305408 ), -SET_IDREG (isar,ID_AA64DFR1 ,0x0000000000000000 ), +SET_IDREG (isar,ID_AA64DFR0 ,0x0000000010305408 ); +SET_IDREG (isar,ID_AA64DFR1 ,0x0000000000000000 );SET_IDREG (isar,ID_AA64AFR0 ,0x0000000000000000 );SET_IDREG (isar,ID_AA64AFR1 ,0x0000000000000000 );SET_IDREG (isar,ID_AA64MMFR0 ,0x0000000000001122 );@@ -678,13 +678,13 @@ static void aarch64_neoverse_v1_initfn(Object *obj) cpu->dcz_blocksize =4 ;SET_IDREG (isar,ID_AA64AFR0 ,0x00000000 );SET_IDREG (isar,ID_AA64AFR1 ,0x00000000 ); -SET_IDREG (isar,ID_AA64DFR0 ,0x000001f210305519ull ), -SET_IDREG (isar,ID_AA64DFR1 ,0x00000000 ), +SET_IDREG (isar,ID_AA64DFR0 ,0x000001f210305519ull ); +SET_IDREG (isar,ID_AA64DFR1 ,0x00000000 );SET_IDREG (isar,ID_AA64ISAR0 ,0x1011111110212120ull );/* with FEAT_RNG */ SET_IDREG (isar,ID_AA64ISAR1 ,0x0011000001211032ull );SET_IDREG (isar,ID_AA64MMFR0 ,0x0000000000101125ull ); -SET_IDREG (isar,ID_AA64MMFR1 ,0x0000000010212122ull ), -SET_IDREG (isar,ID_AA64MMFR2 ,0x0220011102101011ull ), +SET_IDREG (isar,ID_AA64MMFR1 ,0x0000000010212122ull ); +SET_IDREG (isar,ID_AA64MMFR2 ,0x0220011102101011ull );SET_IDREG (isar,ID_AA64PFR0 ,0x1101110120111112ull );/* GIC filled in later */ SET_IDREG (isar,ID_AA64PFR1 ,0x0000000000000020ull );SET_IDREG (isar,ID_AFR0 ,0x00000000 );
PATCH 4/5 arm/cpu: store clidr into the idregs array
In reply to Cornelia Huck--- hw/intc/armv7m_nvic.c | 2 +- target/arm/cpu-sysregs.h.inc | 1 + target/arm/cpu.h | 3 +-- target/arm/cpu64.c | 4 ++-- target/arm/helper.c | 2 +- target/arm/tcg/cpu-v7m.c | 4 ++-- target/arm/tcg/cpu32.c | 12 ++++++------ target/arm/tcg/cpu64.c | 22 +++++++++++----------- 8 files changed, 25 insertions(+), 25 deletions(-)
hw/intc/armv7m_nvic.c +1 -1
@@ -1331,7 +1331,7 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) }return GET_IDREG (&cpu->isar,ID_ISAR5 );case 0xd78 :/* CLIDR */ -return cpu->clidr; +return GET_IDREG (&cpu->isar,CLIDR );case 0xd7c :/* CTR */ return cpu->ctr;case 0xd80 :/* CSSIDR */
target/arm/cpu-sysregs.h.inc +1 -0
@@ -35,5 +35,6 @@ DEF(MVFR2_EL1, 3, 0, 0, 3, 2) DEF(ID_PFR2_EL1, 3, 0, 0, 3, 4) DEF(ID_DFR1_EL1, 3, 0, 0, 3, 5) DEF(ID_MMFR5_EL1, 3, 0, 0, 3, 6) +DEF(CLIDR_EL1, 3, 1, 0, 0, 1) DEF(ID_AA64ZFR0_EL1, 3, 0, 0, 4, 4) DEF(CTR_EL0, 3, 3, 0, 0, 1)
target/arm/cpu.h +1 -2
@@ -1066,7 +1066,6 @@ struct ArchCPU {uint32_t reset_sctlr;uint64_t pmceid0;uint64_t pmceid1; -uint64_t clidr;uint64_t mp_affinity;/* MP ID without feature bits */ /* The elements of this array are the CCSIDR values for each cache, * in the order L1DCache, L1ICache, L2DCache, L2ICache, etc.
@@ -2926,7 +2925,7 @@ static inline bool arm_v7m_csselr_razwi(ARMCPU *cpu)/* If all the CLIDR.Ctypem bits are 0 there are no caches, and * CSSELR is RAZ/WI. */ -return (cpu->clidr &R_V7M_CLIDR_CTYPE_ALL_MASK ) !=0 ; +return (GET_IDREG (&cpu->isar,CLIDR ) &R_V7M_CLIDR_CTYPE_ALL_MASK ) !=0 ; }static inline bool arm_sctlr_b (CPUARMState *env)
target/arm/cpu64.c +2 -2
@@ -675,7 +675,7 @@ static void aarch64_a57_initfn(Object *obj) cpu->isar.dbgdevid =0x01110f13 ; cpu->isar.dbgdevid1 =0x2 ; cpu->isar.reset_pmcr_el0 =0x41013000 ; - cpu->clidr =0x0a200023 ; +SET_IDREG (isar,CLIDR ,0x0a200023 );/* 32KB L1 dcache */ cpu->ccsidr[0 ] =make_ccsidr (CCSIDR_FORMAT_LEGACY ,4 ,64 ,32 * KiB,7 );/* 48KB L1 icache */
@@ -737,7 +737,7 @@ static void aarch64_a53_initfn(Object *obj) cpu->isar.dbgdevid =0x00110f13 ; cpu->isar.dbgdevid1 =0x1 ; cpu->isar.reset_pmcr_el0 =0x41033000 ; - cpu->clidr =0x0a200023 ; +SET_IDREG (isar,CLIDR ,0x0a200023 );/* 32KB L1 dcache */ cpu->ccsidr[0 ] =make_ccsidr (CCSIDR_FORMAT_LEGACY ,4 ,64 ,32 * KiB,7 );/* 32KB L1 icache */
target/arm/helper.c +1 -1
@@ -7885,7 +7885,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) .access = PL1_R, .type = ARM_CP_CONST, .accessfn = access_tid4, .fgt = FGT_CLIDR_EL1, - .resetvalue = cpu->clidr + .resetvalue = GET_IDREG(isar, CLIDR) };define_one_arm_cp_reg (cpu, &clidr);define_arm_cp_regs (cpu, v7_cp_reginfo);
target/arm/tcg/cpu-v7m.c +2 -2
@@ -195,7 +195,7 @@ static void cortex_m33_initfn(Object *obj)SET_IDREG (isar,ID_ISAR4 ,0x01310132 );SET_IDREG (isar,ID_ISAR5 ,0x00000000 );SET_IDREG (isar,ID_ISAR6 ,0x00000000 ); - cpu->clidr =0x00000000 ; +SET_IDREG (isar,CLIDR ,0x00000000 ); cpu->ctr =0x8000c000 ; }
@@ -233,7 +233,7 @@ static void cortex_m55_initfn(Object *obj)SET_IDREG (isar,ID_ISAR4 ,0x01310132 );SET_IDREG (isar,ID_ISAR5 ,0x00000000 );SET_IDREG (isar,ID_ISAR6 ,0x00000000 ); - cpu->clidr =0x00000000 ;/* caches not implemented */ +SET_IDREG (isar,CLIDR ,0x00000000 );/* caches not implemented */ cpu->ctr =0x8303c003 ; }
target/arm/tcg/cpu32.c +6 -6
@@ -371,7 +371,7 @@ static void cortex_a8_initfn(Object *obj)SET_IDREG (isar,ID_ISAR3 ,0x11112131 );SET_IDREG (isar,ID_ISAR4 ,0x00111142 ); cpu->isar.dbgdidr =0x15141000 ; - cpu->clidr = (1 <<27 ) | (2 <<24 ) |3 ; +SET_IDREG (isar,CLIDR , (1 <<27 ) | (2 <<24 ) |3 ); cpu->ccsidr[0 ] =0xe007e01a ;/* 16k L1 dcache. */ cpu->ccsidr[1 ] =0x2007e01a ;/* 16k L1 icache. */ cpu->ccsidr[2 ] =0xf0000000 ;/* No L2 icache. */
@@ -447,7 +447,7 @@ static void cortex_a9_initfn(Object *obj)SET_IDREG (isar,ID_ISAR3 ,0x11112131 );SET_IDREG (isar,ID_ISAR4 ,0x00111142 ); cpu->isar.dbgdidr =0x35141000 ; - cpu->clidr = (1 <<27 ) | (1 <<24 ) |3 ; +SET_IDREG (isar,CLIDR , (1 <<27 ) | (1 <<24 ) |3 ); cpu->ccsidr[0 ] =0xe00fe019 ;/* 16k L1 dcache. */ cpu->ccsidr[1 ] =0x200fe019 ;/* 16k L1 icache. */ cpu->isar.reset_pmcr_el0 =0x41093000 ;
@@ -519,7 +519,7 @@ static void cortex_a7_initfn(Object *obj) cpu->isar.dbgdidr =0x3515f005 ; cpu->isar.dbgdevid =0x01110f13 ; cpu->isar.dbgdevid1 =0x1 ; - cpu->clidr =0x0a200023 ; +SET_IDREG (isar,CLIDR ,0x0a200023 ); cpu->ccsidr[0 ] =0x701fe00a ;/* 32K L1 dcache */ cpu->ccsidr[1 ] =0x201fe00a ;/* 32K L1 icache */ cpu->ccsidr[2 ] =0x711fe07a ;/* 4096K L2 unified cache */
@@ -567,7 +567,7 @@ static void cortex_a15_initfn(Object *obj) cpu->isar.dbgdidr =0x3515f021 ; cpu->isar.dbgdevid =0x01110f13 ; cpu->isar.dbgdevid1 =0x0 ; - cpu->clidr =0x0a200023 ; +SET_IDREG (isar,CLIDR ,0x0a200023 ); cpu->ccsidr[0 ] =0x701fe00a ;/* 32K L1 dcache */ cpu->ccsidr[1 ] =0x201fe00a ;/* 32K L1 icache */ cpu->ccsidr[2 ] =0x711fe07a ;/* 4096K L2 unified cache */
@@ -758,7 +758,7 @@ static void cortex_r52_initfn(Object *obj)SET_IDREG (isar,ID_ISAR4 ,0x00010142 );SET_IDREG (isar,ID_ISAR5 ,0x00010001 ); cpu->isar.dbgdidr =0x77168000 ; - cpu->clidr = (1 <<27 ) | (1 <<24 ) |0x3 ; +SET_IDREG (isar,CLIDR , (1 <<27 ) | (1 <<24 ) |0x3 ); cpu->ccsidr[0 ] =0x700fe01a ;/* 32KB L1 dcache */ cpu->ccsidr[1 ] =0x201fe00a ;/* 32KB L1 icache */
@@ -990,7 +990,7 @@ static void arm_max_initfn(Object *obj)SET_IDREG (isar,ID_ISAR5 ,0x00011121 );SET_IDREG (isar,ID_ISAR6 ,0 ); cpu->isar.reset_pmcr_el0 =0x41013000 ; - cpu->clidr =0x0a200023 ; +SET_IDREG (isar,CLIDR ,0x0a200023 ); cpu->ccsidr[0 ] =0x701fe00a ;/* 32KB L1 dcache */ cpu->ccsidr[1 ] =0x201fe012 ;/* 48KB L1 icache */ cpu->ccsidr[2 ] =0x70ffe07a ;/* 2048KB L2 cache */
target/arm/tcg/cpu64.c +11 -11
@@ -71,7 +71,7 @@ static void aarch64_a35_initfn(Object *obj)SET_IDREG (isar,ID_AA64ISAR1 ,0 );SET_IDREG (isar,ID_AA64MMFR0 ,0x00101122 );SET_IDREG (isar,ID_AA64MMFR1 ,0 ); - cpu->clidr =0x0a200023 ; +SET_IDREG (isar,CLIDR ,0x0a200023 ); cpu->dcz_blocksize =4 ;/* From B2.4 AArch64 Virtual Memory control registers */
@@ -216,7 +216,7 @@ static void aarch64_a55_initfn(Object *obj)set_feature (&cpu->env,ARM_FEATURE_PMU );/* Ordered by B2.4 AArch64 registers by functional group */ - cpu->clidr =0x82000023 ; +SET_IDREG (isar,CLIDR ,0x82000023 ); cpu->ctr =0x84448004 ;/* L1Ip = VIPT */ cpu->dcz_blocksize =4 ;/* 64 bytes */ SET_IDREG (isar,ID_AA64DFR0 ,0x0000000010305408ull );
@@ -317,7 +317,7 @@ static void aarch64_a72_initfn(Object *obj) cpu->isar.dbgdevid =0x01110f13 ; cpu->isar.dbgdevid1 =0x2 ; cpu->isar.reset_pmcr_el0 =0x41023000 ; - cpu->clidr =0x0a200023 ; +SET_IDREG (isar,CLIDR ,0x0a200023 );/* 32KB L1 dcache */ cpu->ccsidr[0 ] =make_ccsidr (CCSIDR_FORMAT_LEGACY ,4 ,64 ,32 * KiB,7 );/* 48KB L1 dcache */
@@ -349,7 +349,7 @@ static void aarch64_a76_initfn(Object *obj)set_feature (&cpu->env,ARM_FEATURE_PMU );/* Ordered by B2.4 AArch64 registers by functional group */ - cpu->clidr =0x82000023 ; +SET_IDREG (isar,CLIDR ,0x82000023 ); cpu->ctr =0x8444C004 ; cpu->dcz_blocksize =4 ;SET_IDREG (isar,ID_AA64DFR0 ,0x0000000010305408ull );
@@ -436,7 +436,7 @@ static void aarch64_a64fx_initfn(Object *obj)SET_IDREG (isar,ID_AA64ISAR0 ,0x0000000010211120 );SET_IDREG (isar,ID_AA64ISAR1 ,0x0000000000010001 );SET_IDREG (isar,ID_AA64ZFR0 ,0x0000000000000000 ); - cpu->clidr =0x0000000080000023 ; +SET_IDREG (isar,CLIDR ,0x0000000080000023 );/* 64KB L1 dcache */ cpu->ccsidr[0 ] =make_ccsidr (CCSIDR_FORMAT_LEGACY ,4 ,256 ,64 * KiB,7 );/* 64KB L1 icache */
@@ -597,7 +597,7 @@ static void aarch64_neoverse_n1_initfn(Object *obj)set_feature (&cpu->env,ARM_FEATURE_PMU );/* Ordered by B2.4 AArch64 registers by functional group */ - cpu->clidr =0x82000023 ; +SET_IDREG (isar,CLIDR ,0x82000023 ); cpu->ctr =0x8444c004 ; cpu->dcz_blocksize =4 ;SET_IDREG (isar,ID_AA64DFR0 ,0x0000000110305408ull );
@@ -673,7 +673,7 @@ static void aarch64_neoverse_v1_initfn(Object *obj)set_feature (&cpu->env,ARM_FEATURE_PMU );/* Ordered by 3.2.4 AArch64 registers by functional group */ - cpu->clidr =0x82000023 ; +SET_IDREG (isar,CLIDR ,0x82000023 ); cpu->ctr =0xb444c004 ;/* With DIC and IDC set */ cpu->dcz_blocksize =4 ;SET_IDREG (isar,ID_AA64AFR0 ,0x00000000 );
@@ -934,7 +934,7 @@ static void aarch64_a710_initfn(Object *obj)SET_IDREG (isar,ID_AA64MMFR0 ,0x0000022200101122ull );SET_IDREG (isar,ID_AA64MMFR1 ,0x0000000010212122ull );SET_IDREG (isar,ID_AA64MMFR2 ,0x1221011110101011ull ); - cpu->clidr =0x0000001482000023ull ; +SET_IDREG (isar,CLIDR ,0x0000001482000023ull ); cpu->gm_blocksize =4 ; cpu->ctr =0x000000049444c004ull ; cpu->dcz_blocksize =4 ;
@@ -1036,7 +1036,7 @@ static void aarch64_neoverse_n2_initfn(Object *obj)SET_IDREG (isar,ID_AA64MMFR0 ,0x0000022200101125ull );SET_IDREG (isar,ID_AA64MMFR1 ,0x0000000010212122ull );SET_IDREG (isar,ID_AA64MMFR2 ,0x1221011112101011ull ); - cpu->clidr =0x0000001482000023ull ; +SET_IDREG (isar,CLIDR ,0x0000001482000023ull ); cpu->gm_blocksize =4 ; cpu->ctr =0x00000004b444c004ull ; cpu->dcz_blocksize =4 ;
@@ -1125,10 +1125,10 @@ void aarch64_max_tcg_initfn(Object *obj)* We're going to set FEAT_S2FWB, which mandates that CLIDR_EL1.{LoUU,LoUIS} * are zero. */ - u = cpu->clidr; + u =GET_IDREG (isar,CLIDR ); u =FIELD_DP32 (u,CLIDR_EL1 ,LOUIS ,0 ); u =FIELD_DP32 (u,CLIDR_EL1 ,LOUU ,0 ); - cpu->clidr = u; +SET_IDREG (isar,CLIDR , u);/* * Set CTR_EL0.DIC and IDC to tell the guest it doesnt' need to
Signature · 1 line
2.50.0
Re: [PATCH 4/5] arm/cpu: store clidr into the idregs array
Quoted 1 line · Cornelia Huck
Signed-off-by Cornelia Huck <[email protected]>
Eric
Quoted 269 lines
--- hw/intc/armv7m_nvic.c | 2 +- target/arm/cpu-sysregs.h.inc | 1 + target/arm/cpu.h | 3 +-- target/arm/cpu64.c | 4 ++-- target/arm/helper.c | 2 +- target/arm/tcg/cpu-v7m.c | 4 ++-- target/arm/tcg/cpu32.c | 12 ++++++------ target/arm/tcg/cpu64.c | 22 +++++++++++----------- 8 files changed, 25 insertions(+), 25 deletions(-)hw/intc/armv7m_nvic.c +1
-1@@ -1331,7 +1331,7 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) }return GET_IDREG (&cpu->isar,ID_ISAR5 );case 0xd78 :/* CLIDR */ -return cpu->clidr; +return GET_IDREG (&cpu->isar,CLIDR );case 0xd7c :/* CTR */ return cpu->ctr;case 0xd80 :/* CSSIDR */ target/arm/cpu-sysregs.h.inc +1
-0@@ -35,5 +35,6 @@ DEF(MVFR2_EL1, 3, 0, 0, 3, 2) DEF(ID_PFR2_EL1, 3, 0, 0, 3, 4) DEF(ID_DFR1_EL1, 3, 0, 0, 3, 5) DEF(ID_MMFR5_EL1, 3, 0, 0, 3, 6) +DEF(CLIDR_EL1, 3, 1, 0, 0, 1) DEF(ID_AA64ZFR0_EL1, 3, 0, 0, 4, 4) DEF(CTR_EL0, 3, 3, 0, 0, 1)target/arm/cpu.h +1
-2@@ -1066,7 +1066,6 @@ struct ArchCPU {uint32_t reset_sctlr;uint64_t pmceid0;uint64_t pmceid1; -uint64_t clidr;uint64_t mp_affinity;/* MP ID without feature bits */ /* The elements of this array are the CCSIDR values for each cache, * in the order L1DCache, L1ICache, L2DCache, L2ICache, etc. @@ -2926,7 +2925,7 @@ static inline bool arm_v7m_csselr_razwi(ARMCPU *cpu)/* If all the CLIDR.Ctypem bits are 0 there are no caches, and * CSSELR is RAZ/WI. */ -return (cpu->clidr &R_V7M_CLIDR_CTYPE_ALL_MASK ) !=0 ; +return (GET_IDREG (&cpu->isar,CLIDR ) &R_V7M_CLIDR_CTYPE_ALL_MASK ) !=0 ; }static inline bool arm_sctlr_b (CPUARMState *env)target/arm/cpu64.c +2
-2@@ -675,7 +675,7 @@ static void aarch64_a57_initfn(Object *obj) cpu->isar.dbgdevid =0x01110f13 ; cpu->isar.dbgdevid1 =0x2 ; cpu->isar.reset_pmcr_el0 =0x41013000 ; - cpu->clidr =0x0a200023 ; +SET_IDREG (isar,CLIDR ,0x0a200023 );/* 32KB L1 dcache */ cpu->ccsidr[0 ] =make_ccsidr (CCSIDR_FORMAT_LEGACY ,4 ,64 ,32 * KiB,7 );/* 48KB L1 icache */ @@ -737,7 +737,7 @@ static void aarch64_a53_initfn(Object *obj) cpu->isar.dbgdevid =0x00110f13 ; cpu->isar.dbgdevid1 =0x1 ; cpu->isar.reset_pmcr_el0 =0x41033000 ; - cpu->clidr =0x0a200023 ; +SET_IDREG (isar,CLIDR ,0x0a200023 );/* 32KB L1 dcache */ cpu->ccsidr[0 ] =make_ccsidr (CCSIDR_FORMAT_LEGACY ,4 ,64 ,32 * KiB,7 );/* 32KB L1 icache */ target/arm/helper.c +1
-1@@ -7885,7 +7885,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) .access = PL1_R, .type = ARM_CP_CONST, .accessfn = access_tid4, .fgt = FGT_CLIDR_EL1, - .resetvalue = cpu->clidr + .resetvalue = GET_IDREG(isar, CLIDR) };define_one_arm_cp_reg (cpu, &clidr);define_arm_cp_regs (cpu, v7_cp_reginfo);target/arm/tcg/cpu-v7m.c +2
-2@@ -195,7 +195,7 @@ static void cortex_m33_initfn(Object *obj)SET_IDREG (isar,ID_ISAR4 ,0x01310132 );SET_IDREG (isar,ID_ISAR5 ,0x00000000 );SET_IDREG (isar,ID_ISAR6 ,0x00000000 ); - cpu->clidr =0x00000000 ; +SET_IDREG (isar,CLIDR ,0x00000000 ); cpu->ctr =0x8000c000 ; }@@ -233,7 +233,7 @@ static void cortex_m55_initfn(Object *obj)SET_IDREG (isar,ID_ISAR4 ,0x01310132 );SET_IDREG (isar,ID_ISAR5 ,0x00000000 );SET_IDREG (isar,ID_ISAR6 ,0x00000000 ); - cpu->clidr =0x00000000 ;/* caches not implemented */ +SET_IDREG (isar,CLIDR ,0x00000000 );/* caches not implemented */ cpu->ctr =0x8303c003 ; }target/arm/tcg/cpu32.c +6
-6@@ -371,7 +371,7 @@ static void cortex_a8_initfn(Object *obj)SET_IDREG (isar,ID_ISAR3 ,0x11112131 );SET_IDREG (isar,ID_ISAR4 ,0x00111142 ); cpu->isar.dbgdidr =0x15141000 ; - cpu->clidr = (1 <<27 ) | (2 <<24 ) |3 ; +SET_IDREG (isar,CLIDR , (1 <<27 ) | (2 <<24 ) |3 ); cpu->ccsidr[0 ] =0xe007e01a ;/* 16k L1 dcache. */ cpu->ccsidr[1 ] =0x2007e01a ;/* 16k L1 icache. */ cpu->ccsidr[2 ] =0xf0000000 ;/* No L2 icache. */ @@ -447,7 +447,7 @@ static void cortex_a9_initfn(Object *obj)SET_IDREG (isar,ID_ISAR3 ,0x11112131 );SET_IDREG (isar,ID_ISAR4 ,0x00111142 ); cpu->isar.dbgdidr =0x35141000 ; - cpu->clidr = (1 <<27 ) | (1 <<24 ) |3 ; +SET_IDREG (isar,CLIDR , (1 <<27 ) | (1 <<24 ) |3 ); cpu->ccsidr[0 ] =0xe00fe019 ;/* 16k L1 dcache. */ cpu->ccsidr[1 ] =0x200fe019 ;/* 16k L1 icache. */ cpu->isar.reset_pmcr_el0 =0x41093000 ;@@ -519,7 +519,7 @@ static void cortex_a7_initfn(Object *obj) cpu->isar.dbgdidr =0x3515f005 ; cpu->isar.dbgdevid =0x01110f13 ; cpu->isar.dbgdevid1 =0x1 ; - cpu->clidr =0x0a200023 ; +SET_IDREG (isar,CLIDR ,0x0a200023 ); cpu->ccsidr[0 ] =0x701fe00a ;/* 32K L1 dcache */ cpu->ccsidr[1 ] =0x201fe00a ;/* 32K L1 icache */ cpu->ccsidr[2 ] =0x711fe07a ;/* 4096K L2 unified cache */ @@ -567,7 +567,7 @@ static void cortex_a15_initfn(Object *obj) cpu->isar.dbgdidr =0x3515f021 ; cpu->isar.dbgdevid =0x01110f13 ; cpu->isar.dbgdevid1 =0x0 ; - cpu->clidr =0x0a200023 ; +SET_IDREG (isar,CLIDR ,0x0a200023 ); cpu->ccsidr[0 ] =0x701fe00a ;/* 32K L1 dcache */ cpu->ccsidr[1 ] =0x201fe00a ;/* 32K L1 icache */ cpu->ccsidr[2 ] =0x711fe07a ;/* 4096K L2 unified cache */ @@ -758,7 +758,7 @@ static void cortex_r52_initfn(Object *obj)SET_IDREG (isar,ID_ISAR4 ,0x00010142 );SET_IDREG (isar,ID_ISAR5 ,0x00010001 ); cpu->isar.dbgdidr =0x77168000 ; - cpu->clidr = (1 <<27 ) | (1 <<24 ) |0x3 ; +SET_IDREG (isar,CLIDR , (1 <<27 ) | (1 <<24 ) |0x3 ); cpu->ccsidr[0 ] =0x700fe01a ;/* 32KB L1 dcache */ cpu->ccsidr[1 ] =0x201fe00a ;/* 32KB L1 icache */ @@ -990,7 +990,7 @@ static void arm_max_initfn(Object *obj)SET_IDREG (isar,ID_ISAR5 ,0x00011121 );SET_IDREG (isar,ID_ISAR6 ,0 ); cpu->isar.reset_pmcr_el0 =0x41013000 ; - cpu->clidr =0x0a200023 ; +SET_IDREG (isar,CLIDR ,0x0a200023 ); cpu->ccsidr[0 ] =0x701fe00a ;/* 32KB L1 dcache */ cpu->ccsidr[1 ] =0x201fe012 ;/* 48KB L1 icache */ cpu->ccsidr[2 ] =0x70ffe07a ;/* 2048KB L2 cache */ target/arm/tcg/cpu64.c +11
-11@@ -71,7 +71,7 @@ static void aarch64_a35_initfn(Object *obj)SET_IDREG (isar,ID_AA64ISAR1 ,0 );SET_IDREG (isar,ID_AA64MMFR0 ,0x00101122 );SET_IDREG (isar,ID_AA64MMFR1 ,0 ); - cpu->clidr =0x0a200023 ; +SET_IDREG (isar,CLIDR ,0x0a200023 ); cpu->dcz_blocksize =4 ;/* From B2.4 AArch64 Virtual Memory control registers */ @@ -216,7 +216,7 @@ static void aarch64_a55_initfn(Object *obj)set_feature (&cpu->env,ARM_FEATURE_PMU );/* Ordered by B2.4 AArch64 registers by functional group */ - cpu->clidr =0x82000023 ; +SET_IDREG (isar,CLIDR ,0x82000023 ); cpu->ctr =0x84448004 ;/* L1Ip = VIPT */ cpu->dcz_blocksize =4 ;/* 64 bytes */ SET_IDREG (isar,ID_AA64DFR0 ,0x0000000010305408ull );@@ -317,7 +317,7 @@ static void aarch64_a72_initfn(Object *obj) cpu->isar.dbgdevid =0x01110f13 ; cpu->isar.dbgdevid1 =0x2 ; cpu->isar.reset_pmcr_el0 =0x41023000 ; - cpu->clidr =0x0a200023 ; +SET_IDREG (isar,CLIDR ,0x0a200023 );/* 32KB L1 dcache */ cpu->ccsidr[0 ] =make_ccsidr (CCSIDR_FORMAT_LEGACY ,4 ,64 ,32 * KiB,7 );/* 48KB L1 dcache */ @@ -349,7 +349,7 @@ static void aarch64_a76_initfn(Object *obj)set_feature (&cpu->env,ARM_FEATURE_PMU );/* Ordered by B2.4 AArch64 registers by functional group */ - cpu->clidr =0x82000023 ; +SET_IDREG (isar,CLIDR ,0x82000023 ); cpu->ctr =0x8444C004 ; cpu->dcz_blocksize =4 ;SET_IDREG (isar,ID_AA64DFR0 ,0x0000000010305408ull );@@ -436,7 +436,7 @@ static void aarch64_a64fx_initfn(Object *obj)SET_IDREG (isar,ID_AA64ISAR0 ,0x0000000010211120 );SET_IDREG (isar,ID_AA64ISAR1 ,0x0000000000010001 );SET_IDREG (isar,ID_AA64ZFR0 ,0x0000000000000000 ); - cpu->clidr =0x0000000080000023 ; +SET_IDREG (isar,CLIDR ,0x0000000080000023 );/* 64KB L1 dcache */ cpu->ccsidr[0 ] =make_ccsidr (CCSIDR_FORMAT_LEGACY ,4 ,256 ,64 * KiB,7 );/* 64KB L1 icache */ @@ -597,7 +597,7 @@ static void aarch64_neoverse_n1_initfn(Object *obj)set_feature (&cpu->env,ARM_FEATURE_PMU );/* Ordered by B2.4 AArch64 registers by functional group */ - cpu->clidr =0x82000023 ; +SET_IDREG (isar,CLIDR ,0x82000023 ); cpu->ctr =0x8444c004 ; cpu->dcz_blocksize =4 ;SET_IDREG (isar,ID_AA64DFR0 ,0x0000000110305408ull );@@ -673,7 +673,7 @@ static void aarch64_neoverse_v1_initfn(Object *obj)set_feature (&cpu->env,ARM_FEATURE_PMU );/* Ordered by 3.2.4 AArch64 registers by functional group */ - cpu->clidr =0x82000023 ; +SET_IDREG (isar,CLIDR ,0x82000023 ); cpu->ctr =0xb444c004 ;/* With DIC and IDC set */ cpu->dcz_blocksize =4 ;SET_IDREG (isar,ID_AA64AFR0 ,0x00000000 );@@ -934,7 +934,7 @@ static void aarch64_a710_initfn(Object *obj)SET_IDREG (isar,ID_AA64MMFR0 ,0x0000022200101122ull );SET_IDREG (isar,ID_AA64MMFR1 ,0x0000000010212122ull );SET_IDREG (isar,ID_AA64MMFR2 ,0x1221011110101011ull ); - cpu->clidr =0x0000001482000023ull ; +SET_IDREG (isar,CLIDR ,0x0000001482000023ull ); cpu->gm_blocksize =4 ; cpu->ctr =0x000000049444c004ull ; cpu->dcz_blocksize =4 ;@@ -1036,7 +1036,7 @@ static void aarch64_neoverse_n2_initfn(Object *obj)SET_IDREG (isar,ID_AA64MMFR0 ,0x0000022200101125ull );SET_IDREG (isar,ID_AA64MMFR1 ,0x0000000010212122ull );SET_IDREG (isar,ID_AA64MMFR2 ,0x1221011112101011ull ); - cpu->clidr =0x0000001482000023ull ; +SET_IDREG (isar,CLIDR ,0x0000001482000023ull ); cpu->gm_blocksize =4 ; cpu->ctr =0x00000004b444c004ull ; cpu->dcz_blocksize =4 ;@@ -1125,10 +1125,10 @@ void aarch64_max_tcg_initfn(Object *obj)* We're going to set FEAT_S2FWB, which mandates that CLIDR_EL1.{LoUU,LoUIS} * are zero. */ - u = cpu->clidr; + u =GET_IDREG (isar,CLIDR ); u =FIELD_DP32 (u,CLIDR_EL1 ,LOUIS ,0 ); u =FIELD_DP32 (u,CLIDR_EL1 ,LOUU ,0 ); - cpu->clidr = u; +SET_IDREG (isar,CLIDR , u);/* * Set CTR_EL0.DIC and IDC to tell the guest it doesnt' need to
PATCH 5/5 arm/kvm: shorten one overly long line
In reply to Cornelia Huck--- target/arm/kvm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
target/arm/kvm.c +2 -1
@@ -230,7 +230,8 @@ static uint64_t idregs_sysreg_to_kvm_reg(ARMSysRegs sysreg) }/* read a sysreg value and store it in the idregs */ -static int get_host_cpu_reg (int fd,ARMHostCPUFeatures *ahcf,ARMIDRegisterIdx index) +static int get_host_cpu_reg (int fd,ARMHostCPUFeatures *ahcf, +ARMIDRegisterIdx index) {uint64_t *reg;int ret;
Signature · 1 line
2.50.0
Re: [PATCH 5/5] arm/kvm: shorten one overly long line
Quoted 5 lines · Cornelia Huck
Fixes 804cfc7eedb7 ("arm/cpu: Store aa64isar0/aa64zfr0 into the idregs arrays")Signed-off-by Cornelia Huck <[email protected]>--- target/arm/kvm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Re: [PATCH 5/5] arm/kvm: shorten one overly long line
In reply to Cornelia HuckQuoted 2 lines · Cornelia Huck
Fixes 804cfc7eedb7 ("arm/cpu: Store aa64isar0/aa64zfr0 into the idregs arrays")Signed-off-by Cornelia Huck <[email protected]>
Eric
Quoted 18 lines
--- target/arm/kvm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)target/arm/kvm.c +2
-1@@ -230,7 +230,8 @@ static uint64_t idregs_sysreg_to_kvm_reg(ARMSysRegs sysreg) }/* read a sysreg value and store it in the idregs */ -static int get_host_cpu_reg (int fd,ARMHostCPUFeatures *ahcf,ARMIDRegisterIdx index) +static int get_host_cpu_reg (int fd,ARMHostCPUFeatures *ahcf, +ARMIDRegisterIdx index) {uint64_t *reg;int ret;
Quoted 6 lines · Cornelia Huck
Cornelia Huck (5):
arm/cpu: storeid_afr0into the idregs array arm/cpu: store id_aa64afr{0,1} into the idregs array arm/cpu: fix trailing ',' forSET_IDREGarm/cpu: store clidr into the idregs array arm/kvm: shorten one overly long line
r~
Peter Maydell
AppliedQuoted 5 lines · Cornelia Huck
This series tries to address some low-hanging fruit on top of target-arm.next (move some more registers, some cosmetics; see discussion following <[email protected]>)
Quoted 8 lines
Also available at https://gitlab.com/cohuck/qemu id-reg-fixup-v1
Cornelia Huck (5):
arm/cpu: storeid_afr0into the idregs array arm/cpu: store id_aa64afr{0,1} into the idregs array arm/cpu: fix trailing ',' forSET_IDREGarm/cpu: store clidr into the idregs array arm/kvm: shorten one overly long line
Applied to target-arm.next, thanks.
-- PMM