Files
system76-edk2/ArmPkg/Drivers/CpuDxe/CpuDxe.inf
Ard Biesheuvel 61a7b0ec63 ArmPkg/Gic: force GIC driver to run before CPU arch protocol driver
Currently, the GIC driver has a static dependency on the CPU arch protocol
driver, so it can register its IRQ handler at init time. This means there
is a window between dispatch of the CPU driver and dispatch of the GIC
driver where any unexpected GIC state may trigger an interrupt which we
are not set up to handle yet. Note that this is even the case if we enter
UEFI with interrupts disabled at the CPU, given that any TPL manipulation
involving TPL_HIGH_LEVEL will unconditionally enable IRQs at the CPU side
regardless of whether they were enabled to begin with (but only as soon as
the CPU arch protocol is actually installed)

So let's reorder the GIC driver with the CPU driver, and let it run its
initialization that puts the GIC into a known state before enabling
interrupts. Move its installation of its IRQ handler to a protocol notify
callback on the CPU arch protocol so that it runs as soon as it becomes
available.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Tested-by: Marc Zyngier <marc.zyngier@arm.com>
2018-02-06 18:59:34 +00:00

78 lines
1.7 KiB
INI

#/** @file
#
# DXE CPU driver
#
# Copyright (c) 2009, Apple Inc. All rights reserved.<BR>
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
#**/
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = ArmCpuDxe
FILE_GUID = B8D9777E-D72A-451F-9BDB-BAFB52A68415
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
ENTRY_POINT = CpuDxeInitialize
[Sources.Common]
CpuDxe.c
CpuDxe.h
CpuMpCore.c
CpuMmuCommon.c
Exception.c
[Sources.ARM]
Arm/Mmu.c
[Sources.AARCH64]
AArch64/Mmu.c
[Packages]
ArmPkg/ArmPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
ArmLib
ArmMmuLib
BaseMemoryLib
CacheMaintenanceLib
CpuLib
CpuExceptionHandlerLib
DebugLib
DefaultExceptionHandlerLib
DxeServicesTableLib
HobLib
PeCoffGetEntryPointLib
UefiDriverEntryPoint
UefiLib
[Protocols]
gEfiCpuArchProtocolGuid
[Guids]
gEfiDebugImageInfoTableGuid
gArmMpCoreInfoGuid
gIdleLoopEventGuid
gEfiVectorHandoffTableGuid
[Pcd.common]
gArmTokenSpaceGuid.PcdVFPEnabled
[FeaturePcd.common]
gArmTokenSpaceGuid.PcdDebuggerExceptionSupport
[Depex]
AFTER gArmGicDxeFileGuid