Skip to content

Commit

Permalink
[AArch64] Access HCR_EL2 based on CurrentEL bits
Browse files Browse the repository at this point in the history
  • Loading branch information
cyring committed Nov 22, 2024
1 parent c574ab1 commit 6436a48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

COREFREQ_MAJOR = 1
COREFREQ_MINOR = 98
COREFREQ_REV = 7
COREFREQ_REV = 8
HW = $(shell uname -m)
CC ?= cc
WARNING = -Wall -Wfatal-errors
Expand Down
16 changes: 8 additions & 8 deletions aarch64/corefreqk.c
Original file line number Diff line number Diff line change
Expand Up @@ -2449,14 +2449,6 @@ static void SystemRegisters(CORE_RO *Core)

isar2.value = SysRegRead(ID_AA64ISAR2_EL1);

if (Experimental) {
__asm__ __volatile__(
"mrs %[hcr] , hcr_el2"
: [hcr] "=r" (Core->SystemRegister.HCR)
:
: "cc", "memory"
);
}
__asm__ __volatile__(
"mrs %[sctlr], sctlr_el1" "\n\t"
"mrs %[mmfr1], id_aa64mmfr1_el1""\n\t"
Expand Down Expand Up @@ -2604,6 +2596,14 @@ static void SystemRegisters(CORE_RO *Core)
if (PUBLIC(RO(Proc))->Features.SME) {
Core->SystemRegister.SVCR = SysRegRead(MRS_SVCR);
}
if (BITEXTRZ(Core->SystemRegister.FLAGS, FLAG_EL, 2) >= 2) {
__asm__ __volatile__(
"mrs %[hcr] , hcr_el2"
: [hcr] "=r" (Core->SystemRegister.HCR)
:
: "cc", "memory"
);
}
BITSET_CC(LOCKLESS, PUBLIC(RO(Proc))->CR_Mask, Core->Bind);
}

Expand Down

0 comments on commit 6436a48

Please sign in to comment.