Even though the UEFI spec mentions that the EL1PCTEN and EL1PCEN bits in CNTHCTL_EL2 must be set, this is not a requirement that applies to the UEFI implementation, but a requirement that applies to the firmware running at EL2 in cases where UEFI executes at EL1. (Note that the same paragraphs mentions that CNTFRQ must be programmed with the timer frequency, and this is only permitted at EL3). Setting these bits has no effect when executing at EL2, and it is the OS's job to reason about how to configure lower exception levels. So drop the initialization of CNTHCTL_EL2. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
26 lines
471 B
C
26 lines
471 B
C
/** @file
|
|
|
|
Copyright (c) 2011-2017, ARM Limited. All rights reserved.
|
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
|
**/
|
|
|
|
#include "PeilessSec.h"
|
|
|
|
#include <AArch64/AArch64.h>
|
|
|
|
/**
|
|
Architecture specific initialization routine.
|
|
**/
|
|
VOID
|
|
ArchInitialize (
|
|
VOID
|
|
)
|
|
{
|
|
if (ArmReadCurrentEL () == AARCH64_EL2) {
|
|
// Trap General Exceptions. All exceptions that would be routed to EL1 are routed to EL2
|
|
ArmWriteHcr (ARM_HCR_TGE);
|
|
}
|
|
}
|