|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v3 1/7] xen/arm: Add ID registers and complete cpuinfo
Hi Bertrand, On 09/12/2020 16:30, Bertrand Marquis wrote: Add definition and entries in cpuinfo for ID registers introduced in newer Arm Architecture reference manual: - ID_PFR2: processor feature register 2 - ID_DFR1: debug feature register 1 - ID_MMFR4 and ID_MMFR5: Memory model feature registers 4 and 5 - ID_ISA6: ISA Feature register 6 Add more bitfield definitions in PFR fields of cpuinfo. Add MVFR2 register definition for aarch32. Add mvfr values in cpuinfo. Add some registers definition for arm64 in sysregs as some are not always know by compilers. Initialize the new values added in cpuinfo in identify_cpu during init. Signed-off-by: Bertrand Marquis <bertrand.marquis@xxxxxxx> --- Changes in V2: Fix dbg32 table size and add proper initialisation of the second entry of the table by reading ID_DFR1 register. Changes in V3: Fix typo in commit title Add MVFR2 definition and handling on aarch32 and remove specific case for mvfr field in cpuinfo (now the same on arm64 and arm32). Add MMFR4 definition if not known by the compiler. --- xen/arch/arm/cpufeature.c | 18 ++++++++++ xen/include/asm-arm/arm64/sysregs.h | 28 +++++++++++++++ xen/include/asm-arm/cpregs.h | 12 +++++++ xen/include/asm-arm/cpufeature.h | 56 ++++++++++++++++++++++++----- 4 files changed, 105 insertions(+), 9 deletions(-) diff --git a/xen/arch/arm/cpufeature.c b/xen/arch/arm/cpufeature.c index 44126dbf07..bc7ee5ac95 100644 --- a/xen/arch/arm/cpufeature.c +++ b/xen/arch/arm/cpufeature.c @@ -114,15 +114,20 @@ void identify_cpu(struct cpuinfo_arm *c)c->mm64.bits[0] = READ_SYSREG64(ID_AA64MMFR0_EL1); Please don't introduce any more use of READ_SYSREG32(), they are wrong on Armv8 because system registers are always 64-bit.
c->isa32.bits[0] = READ_SYSREG32(ID_ISAR0_EL1);
READ_SYSREG() will do the job to either use READ_SYSREG64() or READ_CP32() depending on the arch used. }/*diff --git a/xen/include/asm-arm/arm64/sysregs.h b/xen/include/asm-arm/arm64/sysregs.h index c60029d38f..077fd95fb7 100644 --- a/xen/include/asm-arm/arm64/sysregs.h +++ b/xen/include/asm-arm/arm64/sysregs.h @@ -57,6 +57,34 @@ #define ICH_AP1R2_EL2 __AP1Rx_EL2(2) #define ICH_AP1R3_EL2 __AP1Rx_EL2(3)+/*+ * Define ID coprocessor registers if they are not + * already defined by the compiler. + * + * Values picked from linux kernel + */ +#ifndef ID_AA64MMFR2_EL1 I am a bit puzzled how this meant to work. Will the libc/compiler headers define ID_AA64MMFR2_EL1? +#define ID_AA64MMFR2_EL1 S3_0_C0_C7_2 +#endif +#ifndef ID_PFR2_EL1 +#define ID_PFR2_EL1 S3_0_C0_C3_4 +#endif +#ifndef ID_MMFR4_EL1 +#define ID_MMFR4_EL1 S3_0_C0_C2_6 +#endif +#ifndef ID_MMFR5_EL1 +#define ID_MMFR5_EL1 S3_0_C0_C3_6 +#endif +#ifndef ID_ISAR6_EL1 +#define ID_ISAR6_EL1 S3_0_C0_C2_7 +#endif +#ifndef ID_AA64ZFR0_EL1 +#define ID_AA64ZFR0_EL1 S3_0_C0_C4_4 +#endif +#ifndef ID_DFR1_EL1 +#define ID_DFR1_EL1 S3_0_C0_C3_5 +#endif + /* Access to system registers */#define READ_SYSREG32(name) ((uint32_t)READ_SYSREG64(name)) Shouldn't this be register_t? + } mvfr; };extern struct cpuinfo_arm boot_cpu_data; -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |