Skip to content

Commit

Permalink
[AArch64] DynamIQ entry
Browse files Browse the repository at this point in the history
  • Loading branch information
cyring committed Mar 9, 2024
1 parent c3a8dae commit 76b3d52
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 26 deletions.
28 changes: 25 additions & 3 deletions aarch64/arm_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ typedef union

typedef union
{
unsigned long long value;
unsigned long long value; /* SMT=0x0000000000000000 */
struct
{
unsigned long long
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
Expand Down
26 changes: 15 additions & 11 deletions aarch64/corefreqk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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"
Expand Down
25 changes: 13 additions & 12 deletions aarch64/corefreqk.h
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 76b3d52

Please sign in to comment.