Skip to content

Commit

Permalink
[AArch64] Translation Hardening Extension (THE)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyring committed Jan 29, 2024
1 parent ae93cc2 commit 48d733c
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions aarch64/corefreq-cli-json.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,8 @@ void JsonSysInfo(RO(SHM_STRUCT) *RO(Shm))
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.RAS_frac);
json_key(&s, "MPAM_frac");
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.MPAM_frac);
json_key(&s, "THE");
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.THE);
json_end_object(&s);
}
json_key(&s, "MISC");
Expand Down
2 changes: 1 addition & 1 deletion aarch64/corefreq-cli-rsc-en.h
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@
#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_THE_CODE_EN "Translation Hardening Extension"
#define RSC_FEATURES_TLB_CODE_EN "TLB maintenance instructions"
#define RSC_FEATURES_TME_CODE_EN "Transactional Memory Extension"
#define RSC_FEATURES_TSC_CODE_EN "Time Stamp Counter"
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 @@ -518,6 +518,7 @@ do echo -en "$h$l\t""\xc3""\x$h$l""\t"; done; done;echo
"Fiabilit""\xa9"" Disponibilit""\xa9"" et Durabilit""\xa9"

#define RSC_FEATURES_RME_CODE_FR RSC_FEATURES_RME_CODE_EN
#define RSC_FEATURES_THE_CODE_FR RSC_FEATURES_THE_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 @@ -724,6 +724,7 @@ RESOURCE_ST Resource[] = {
LDT(RSC_FEATURES_PAN),
LDT(RSC_FEATURES_RAS),
LDT(RSC_FEATURES_RME),
LDT(RSC_FEATURES_THE),
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 @@ -547,6 +547,7 @@ enum {
RSC_FEATURES_PAN,
RSC_FEATURES_RAS,
RSC_FEATURES_RME,
RSC_FEATURES_THE,
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 @@ -1807,6 +1807,14 @@ REASON_CODE SysInfoFeatures( Window *win,
width - 18 - RSZ(FEATURES_RME),
NULL
},
{
NULL,
RO(Shm)->Proc.Features.THE == 1,
attr_Feat,
2, "%s%.*sTHE [%7s]", RSC(FEATURES_THE).CODE(),
width - 18 - RSZ(FEATURES_THE),
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 @@ -998,6 +998,15 @@ static void Query_Features(void *pArg)
iArg->Features->GCS = 0;
break;
}
switch (pfr1.THE) {
case 0b0001:
iArg->Features->THE = 1;
break;
case 0b0000:
default:
iArg->Features->THE = 0;
break;
}

if (Experimental && (iArg->HypervisorID == HYPERV_NONE)) {
/* Query the Cluster Configuration */
Expand Down
3 changes: 2 additions & 1 deletion aarch64/coretypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,8 @@ typedef struct /* BSP features. */
RME : 21-20,
MTE : 23-21,
GCS : 24-23,
_Unused2_ : 64-24;
THE : 25-24,
_Unused2_ : 64-25;

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

0 comments on commit 48d733c

Please sign in to comment.