Skip to content

Commit

Permalink
[AArch64] Query and export TME, FHM, TS and TLB features
Browse files Browse the repository at this point in the history
  • Loading branch information
cyring committed Jan 27, 2024
1 parent c892a9d commit 9da3a60
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 5 deletions.
8 changes: 8 additions & 0 deletions aarch64/corefreq-cli-json.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,14 @@ void JsonSysInfo(RO(SHM_STRUCT) *RO(Shm))
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.SM4);
json_key(&s, "RAND");
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.RAND);
json_key(&s, "TME");
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.TME);
json_key(&s, "FHM");
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.FHM);
json_key(&s, "TS");
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.TS);
json_key(&s, "TLB");
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.TLB);
json_key(&s, "RDMA");
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.RDMA);
json_end_object(&s);
Expand Down
38 changes: 38 additions & 0 deletions aarch64/corefreqk.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,15 @@ static void Query_Features(void *pArg)
iArg->Features->CAS = 0;
break;
}
switch (isar0.TME) {
case 0b0001:
iArg->Features->TME = 1;
break;
case 0b0000:
default:
iArg->Features->TME = 0;
break;
}
switch (isar0.RDM) {
case 0b0001:
iArg->Features->RDMA = 1;
Expand Down Expand Up @@ -716,6 +725,35 @@ static void Query_Features(void *pArg)
iArg->Features->SM4 = 0;
break;
}
switch (isar0.FHM) {
case 0b0001:
iArg->Features->FHM = 1;
break;
case 0b0000:
default:
iArg->Features->FHM = 0;
break;
}
switch (isar0.TS) {
case 0b0001:
case 0b0010:
iArg->Features->TS = 1;
break;
case 0b0000:
default:
iArg->Features->TS = 0;
break;
}
switch (isar0.TLB) {
case 0b0001:
case 0b0010:
iArg->Features->TLB = 1;
break;
case 0b0000:
default:
iArg->Features->TLB = 0;
break;
}
switch (isar0.RNDR) {
case 0b0001:
iArg->Features->RAND = 1;
Expand Down
14 changes: 9 additions & 5 deletions aarch64/coretypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -788,11 +788,15 @@ typedef struct /* BSP features. */
SVE : 12-11,
VHE : 13-12,
SME : 14-13,
RDMA : 15-14,
DP : 16-15,
SM3 : 17-16,
SM4 : 18-17,
_Unused1_ : 24-18,
TME : 15-14,
RDMA : 16-15,
DP : 17-16,
SM3 : 18-17,
SM4 : 19-18,
FHM : 20-19,
TS : 21-20,
TLB : 22-21,
_Unused1_ : 24-22,
HTT : 25-24,
TSC : 26-25,
MONITOR : 27-26,
Expand Down

0 comments on commit 9da3a60

Please sign in to comment.