diff --git a/aarch64/arm_reg.h b/aarch64/arm_reg.h index 55aea3d4..fafcc1bc 100644 --- a/aarch64/arm_reg.h +++ b/aarch64/arm_reg.h @@ -246,7 +246,7 @@ typedef union typedef union { - unsigned long long value; + unsigned long long value; /* SMT=0x0000000000000000 */ struct { unsigned long long @@ -726,7 +726,7 @@ typedef union } SSBS2; typedef union -{ +{ /* R82; A55; A75; A76; A76AE; A77; A78; A78AE; A78C; X1; X1C; N3; V1 */ unsigned long long value; /* Pkg:0x0000000007bfda77 */ struct { @@ -755,7 +755,29 @@ typedef union SFIDX : 59-55, SFWAY : 61-59, NODES : 64-61; - }; + } IMP; + struct + { + unsigned long long + NUMCORE : 3-0, + RAZ1 : 4-3, + L3 : 5-4, + WRLAT : 6-5, + RDLAT : 7-6, + RDSLC : 8-7, + ECC : 9-8, + MAS : 11-9, + ACP : 12-11, + PP : 13-12, + MAS_Ext : 14-13, + CPUSLC : 22-14, + RAZ2 : 23-22, + WRDLY : 24-23, + NUMPE : 28-24, + RAZ3 : 30-28, + SafetyMode : 32-30, + RSVD : 64-32; + } DSU; } CLUSTERCFR; typedef union diff --git a/aarch64/corefreqk.c b/aarch64/corefreqk.c index 7f2fc7e2..f0efd47f 100644 --- a/aarch64/corefreqk.c +++ b/aarch64/corefreqk.c @@ -1555,13 +1555,6 @@ static void Query_Features(void *pArg) iArg->Features->SME_SF8FMA = smfr0.SF8FMA; iArg->Features->SME_SF8DP4 = smfr0.SF8DP4; iArg->Features->SME_SF8DP2 = smfr0.SF8DP2; - } - if (Experimental && (iArg->HypervisorID == HYPERV_NONE)) { - /* Query the Cluster Configuration */ - volatile CLUSTERCFR clustercfg = {.value = SysRegRead(CLUSTERCFR_EL1)}; - if (clustercfg.NUMCORE) { - iArg->SMT_Count = iArg->SMT_Count + clustercfg.NUMCORE; - } } /* Reset the performance features bits: present is 0b1 */ iArg->Features->PerfMon.CoreCycles = 0b0; @@ -2358,6 +2351,17 @@ static void Query_GenericMachine(unsigned int cpu) } } +static void Query_DynamIQ(unsigned int cpu) +{ + Query_GenericMachine(cpu); + + if (PUBLIC(RO(Proc))->HypervisorID == BARE_METAL) { + /* Query the Cluster Configuration on Bare Metal only */ + volatile CLUSTERCFR clusterCfg = {.value = SysRegRead(CLUSTERCFR_EL1)}; + UNUSED(clusterCfg); + } +} + void SystemRegisters(CORE_RO *Core) { volatile AA64ISAR2 isar2; @@ -2543,15 +2547,15 @@ void PerCore_Reset(CORE_RO *Core) static void PerCore_GenericMachine(void *arg) { - volatile CPUPWRCTLR cpupwrctl; + volatile CPUPWRCTLR cpuPwrCtl; volatile REVIDR revid; CORE_RO *Core = (CORE_RO *) arg; Query_DeviceTree(Core->Bind); - if (Experimental && (PUBLIC(RO(Proc))->HypervisorID == HYPERV_NONE)) { - cpupwrctl.value = SysRegRead(CPUPWRCTLR_EL1); - Core->Query.CStateBaseAddr = cpupwrctl.WFI_RET_CTRL; + if (Experimental && (PUBLIC(RO(Proc))->HypervisorID == BARE_METAL)) { + cpuPwrCtl.value = SysRegRead(CPUPWRCTLR_EL1); + Core->Query.CStateBaseAddr = cpuPwrCtl.WFI_RET_CTRL; } __asm__ __volatile__( "mrs %[revid], revidr_el1" "\n\t" diff --git a/aarch64/corefreqk.h b/aarch64/corefreqk.h index 4fcf7c1d..07039882 100644 --- a/aarch64/corefreqk.h +++ b/aarch64/corefreqk.h @@ -355,6 +355,7 @@ static void PerCore_GenericMachine(void *arg) ; static void Start_GenericMachine(void *arg) ; static void Stop_GenericMachine(void *arg) ; static void InitTimer_GenericMachine(unsigned int cpu) ; +static void Query_DynamIQ(unsigned int cpu) ; /* [Void] */ #define _Void_Signature {.ExtFamily=0x00, .Family=0x0, .ExtModel=0x0, .Model=0x0} #define _Cortex_A34 {.ExtFamily=0xd0, .Family=0x2, .ExtModel=0x0, .Model=0x8} @@ -626,7 +627,7 @@ static ARCH Arch[ARCHITECTURES] = { }, [Cortex_A55] = { .Signature = _Cortex_A55, - .Query = Query_GenericMachine, + .Query = Query_DynamIQ, .Update = PerCore_GenericMachine, .Start = Start_GenericMachine, .Stop = Stop_GenericMachine, @@ -842,7 +843,7 @@ static ARCH Arch[ARCHITECTURES] = { }, [Cortex_A75] = { .Signature = _Cortex_A75, - .Query = Query_GenericMachine, + .Query = Query_DynamIQ, .Update = PerCore_GenericMachine, .Start = Start_GenericMachine, .Stop = Stop_GenericMachine, @@ -866,7 +867,7 @@ static ARCH Arch[ARCHITECTURES] = { }, [Cortex_A76] = { .Signature = _Cortex_A76, - .Query = Query_GenericMachine, + .Query = Query_DynamIQ, .Update = PerCore_GenericMachine, .Start = Start_GenericMachine, .Stop = Stop_GenericMachine, @@ -890,7 +891,7 @@ static ARCH Arch[ARCHITECTURES] = { }, [Cortex_A76AE] = { .Signature = _Cortex_A76AE, - .Query = Query_GenericMachine, + .Query = Query_DynamIQ, .Update = PerCore_GenericMachine, .Start = Start_GenericMachine, .Stop = Stop_GenericMachine, @@ -914,7 +915,7 @@ static ARCH Arch[ARCHITECTURES] = { }, [Cortex_A77] = { .Signature = _Cortex_A77, - .Query = Query_GenericMachine, + .Query = Query_DynamIQ, .Update = PerCore_GenericMachine, .Start = Start_GenericMachine, .Stop = Stop_GenericMachine, @@ -938,7 +939,7 @@ static ARCH Arch[ARCHITECTURES] = { }, [Cortex_A78] = { .Signature = _Cortex_A78, - .Query = Query_GenericMachine, + .Query = Query_DynamIQ, .Update = PerCore_GenericMachine, .Start = Start_GenericMachine, .Stop = Stop_GenericMachine, @@ -962,7 +963,7 @@ static ARCH Arch[ARCHITECTURES] = { }, [Cortex_A78AE] = { .Signature = _Cortex_A78AE, - .Query = Query_GenericMachine, + .Query = Query_DynamIQ, .Update = PerCore_GenericMachine, .Start = Start_GenericMachine, .Stop = Stop_GenericMachine, @@ -986,7 +987,7 @@ static ARCH Arch[ARCHITECTURES] = { }, [Cortex_A78C] = { .Signature = _Cortex_A78C, - .Query = Query_GenericMachine, + .Query = Query_DynamIQ, .Update = PerCore_GenericMachine, .Start = Start_GenericMachine, .Stop = Stop_GenericMachine, @@ -1010,7 +1011,7 @@ static ARCH Arch[ARCHITECTURES] = { }, [Cortex_R82] = { .Signature = _Cortex_R82, - .Query = Query_GenericMachine, + .Query = Query_DynamIQ, .Update = PerCore_GenericMachine, .Start = Start_GenericMachine, .Stop = Stop_GenericMachine, @@ -1034,7 +1035,7 @@ static ARCH Arch[ARCHITECTURES] = { }, [Cortex_X1] = { .Signature = _Cortex_X1, - .Query = Query_GenericMachine, + .Query = Query_DynamIQ, .Update = PerCore_GenericMachine, .Start = Start_GenericMachine, .Stop = Stop_GenericMachine, @@ -1058,7 +1059,7 @@ static ARCH Arch[ARCHITECTURES] = { }, [Cortex_X1C] = { .Signature = _Cortex_X1C, - .Query = Query_GenericMachine, + .Query = Query_DynamIQ, .Update = PerCore_GenericMachine, .Start = Start_GenericMachine, .Stop = Stop_GenericMachine, @@ -1250,7 +1251,7 @@ static ARCH Arch[ARCHITECTURES] = { }, [Neoverse_V1] = { .Signature = _Neoverse_V1, - .Query = Query_GenericMachine, + .Query = Query_DynamIQ, .Update = PerCore_GenericMachine, .Start = Start_GenericMachine, .Stop = Stop_GenericMachine,