Skip to content

Commit ef35863

Browse files
jrtc27mergify[bot]
authored andcommitted
ArmPlatformPkg,MdePkg: Rename AARCH64 CPACR_CP_FULL_ACCESS
CP_FULL_ACCESS is a misnomer, we only enable access to SIMD/FP state, and although the register's mnemonic is CPACR_EL1, its full name is "Architectural Feature Access Control Register", with AArch64 having no coprocessors like AArch32 did, so the "CP" is also not appropriate. Rename it to show it's the default value we use on entry, and define it in terms of the existing CPACR_FPEN_FULL rather than a magic constant with the same value to more clearly document that fact. Also update comments to reflect all this (including the CPTR_EL2 case). Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
1 parent 6f07aeb commit ef35863

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ArmPlatformPkg/Sec/AArch64/Helper.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
ASM_FUNC(SetupExceptionLevel1)
1313
mov x5, x30 // Save LR
1414

15-
mov x0, #CPACR_CP_FULL_ACCESS
16-
bl ASM_PFX(ArmWriteCpacr) // Disable copro traps to EL1
15+
mov x0, #CPACR_DEFAULT
16+
bl ASM_PFX(ArmWriteCpacr) // Enable architectural features
1717

1818
ret x5
1919

@@ -30,7 +30,7 @@ ASM_FUNC(SetupExceptionLevel2)
3030

3131
// NB: We assume that we have not been entered on VHE systems with
3232
// HCR_EL2.E2H set.
33-
msr cptr_el2, xzr // Disable copro traps to EL2
33+
msr cptr_el2, xzr // Enable architectural features
3434

3535
// Enable Timer access for non-secure EL1 and EL0
3636
// The cnthctl_el2 register bits are architecturally

MdePkg/Include/AArch64/AArch64.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
#define ARM_ARCH_EXCEPTION_IRQ EXCEPT_AARCH64_IRQ
1717

1818
// CPACR - Coprocessor Access Control Register definitions
19-
#define CPACR_TTA_EN (1UL << 28)
20-
#define CPACR_FPEN_EL1 (1UL << 20)
21-
#define CPACR_FPEN_FULL (3UL << 20)
22-
#define CPACR_CP_FULL_ACCESS 0x300000
19+
#define CPACR_TTA_EN (1UL << 28)
20+
#define CPACR_FPEN_EL1 (1UL << 20)
21+
#define CPACR_FPEN_FULL (3UL << 20)
22+
#define CPACR_DEFAULT CPACR_FPEN_FULL
2323

2424
// Coprocessor Trap Register (CPTR)
2525
#define AARCH64_CPTR_TFP (1 << 10)

0 commit comments

Comments
 (0)