Skip to content

Commit

Permalink
[AArch64] Realm Management Extension (RME)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyring committed Jan 28, 2024
1 parent 2a3262a commit a8fe843
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions aarch64/corefreq-cli-json.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,8 @@ void JsonSysInfo(RO(SHM_STRUCT) *RO(Shm))
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.AMU_vers);
json_key(&s, "AMU_frac");
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.AMU_frac);
json_key(&s, "RME");
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.RME);
json_end_object(&s);
}
json_key(&s, "PFR1");
Expand Down
1 change: 1 addition & 0 deletions aarch64/corefreq-cli-rsc-en.h
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@
#define RSC_FEATURES_NMI_CODE_EN "Non Maskable Interrupt"
#define RSC_FEATURES_PAN_CODE_EN "Privileged Access Never"
#define RSC_FEATURES_RAS_CODE_EN "Reliability Availability & Serviceability"
#define RSC_FEATURES_RME_CODE_EN "Realm Management Extension"

#define RSC_FEATURES_TLB_CODE_EN "TLB maintenance instructions"
#define RSC_FEATURES_TME_CODE_EN "Transactional Memory Extension"
Expand Down
1 change: 1 addition & 0 deletions aarch64/corefreq-cli-rsc-fr.h
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ do echo -en "$h$l\t""\xc3""\x$h$l""\t"; done; done;echo
#define RSC_FEATURES_RAS_CODE_FR \
"Fiabilit""\xa9"" Disponibilit""\xa9"" et Durabilit""\xa9"

#define RSC_FEATURES_RME_CODE_FR RSC_FEATURES_RME_CODE_EN
#define RSC_FEATURES_TLB_CODE_FR "Instructions de gestion TLB"
#define RSC_FEATURES_TME_CODE_FR "Extension de m""\xa9""moire transactionnelle"
#define RSC_FEATURES_TSC_CODE_FR "Compteur d'horodatage"
Expand Down
1 change: 1 addition & 0 deletions aarch64/corefreq-cli-rsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ RESOURCE_ST Resource[] = {
LDT(RSC_FEATURES_NMI),
LDT(RSC_FEATURES_PAN),
LDT(RSC_FEATURES_RAS),
LDT(RSC_FEATURES_RME),
LDT(RSC_FEATURES_TLB),
LDT(RSC_FEATURES_TME),
LDT(RSC_FEATURES_TSC),
Expand Down
1 change: 1 addition & 0 deletions aarch64/corefreq-cli-rsc.h
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ enum {
RSC_FEATURES_NMI,
RSC_FEATURES_PAN,
RSC_FEATURES_RAS,
RSC_FEATURES_RME,
RSC_FEATURES_TLB,
RSC_FEATURES_TME,
RSC_FEATURES_TSC,
Expand Down
8 changes: 8 additions & 0 deletions aarch64/corefreq-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -1780,6 +1780,14 @@ REASON_CODE SysInfoFeatures( Window *win,
0,
NULL
},
{
NULL,
RO(Shm)->Proc.Features.RME == 1,
attr_Feat,
2, "%s%.*sRME [%7s]", RSC(FEATURES_RME).CODE(),
width - 18 - RSZ(FEATURES_RME),
NULL
},
};
size_t idx;
for (idx = 0; idx < sizeof(FEAT) / sizeof(struct FEAT_ST); idx++)
Expand Down
9 changes: 9 additions & 0 deletions aarch64/corefreqk.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,15 @@ static void Query_Features(void *pArg)
iArg->Features->AMU_frac = 0;
break;
}
switch (pfr0.RME) {
case 0b0001:
iArg->Features->RME = 1;
break;
case 0b0000:
default:
iArg->Features->RME = 0;
break;
}

iArg->Features->SSBS = pfr1.SSBS;

Expand Down
3 changes: 2 additions & 1 deletion aarch64/coretypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,8 @@ typedef struct /* BSP features. */
MPAM_frac : 18-17,
AMU_vers : 19-18,
AMU_frac : 20-19,
_Unused2_ : 64-20;
RME : 21-20,
_Unused2_ : 64-21;

Bit64 InvariantTSC : 8-0,
HyperThreading : 9-8,
Expand Down

0 comments on commit a8fe843

Please sign in to comment.