Commit Graph

1294 Commits

Author SHA1 Message Date
Sarah Walker
b762965bda ArmPkg: TimerDxe: Add support for GICv5 PPIs
GICv5 uses a different ID scheme for interrupt numbers to previous GICs; the
top bits indicate the type of interrupt (PPI/SPI/LPI). Update TimerDxe to use
the new ID scheme for GICv5. As the timer PPIs are architected for GICv5 they
should be the same on all GICv5 platforms.

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-07-15 02:10:39 +00:00
Ard Biesheuvel
b7fdcbbeb8 ArmPkg: ArmGicDxe: Add support for GICv5
Add initial driver support for GICv5. This initial driver supports Private
Peripheral Interrupts (PPIs) and Shared Peripheral Interrupts (SPIs).

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
[ardb: Merge v5 support into GicV3Dxe]
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-07-15 02:10:39 +00:00
Sarah Walker
e1ac8b32a6 ArmPkg: ArmLib: Add functions to read AA64PFR2 and check GICv5 support
Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-07-15 02:10:39 +00:00
Ard Biesheuvel
bfd90d47ab ArmPkg/ArmGicV3Dxe: Make v3 driver AArch64-only
Before extending the GicV3Dxe driver with support for GICv5, make the
driver AArch64-only to avoid the need for adding support to the 32-bit
build, which would be rather pointless.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-07-15 02:10:39 +00:00
GuoMinJ
91a9ad4349 ArmPkg: Remove UGA support
The Universal Graphics Adapter (UGA) is a graphic abstraction.
The UGA I/O and Draw protocols are deprecated since UEFI 2.0 was
introduced. Cf. the UEFI spec v2.9:
"Appendix L - EFI 1.10 Protocol Changes and Deprecation List"
section L.2 "Deprecated Protocols"

Remove the UGA support.

Signed-off-by: GuoMinJ <newexplorerj@gmail.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-08 15:42:03 +00:00
Ajan Zhong
5b3bb5939e ArmPkg,MdePkg,UefiCpuPkg,ArmPlatformPkg,ArmVirtPkg,UefiPayloadPkg: Move ArmMmuLib
Move ArmMmuLib from ArmPkg to UefiCpuPkg for easy maintaining.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2025-07-04 22:39:10 +00:00
Ajan Zhong
07fc968c8f ArmPkg: Drop PcdNormalMemoryNonshareableOverride support
There are no upstream platforms sets this Pcd, this Pcd was
introduced by ArmVExpress-CTA15-A7.

Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2025-07-04 22:39:10 +00:00
Ajan Zhong
3ce9d3f45b ArmPkg,ArmPlatformPkg,ArmVirtPkg: Add UefiCpuPkg to AcceptableDependencies
Since ArmMmuLib.h has been moved to UefiCpuPkg, add corresponding dec
file to AcceptableDependencies to ArmPkg, ArmPlatformPkg and ArmVirtPkg.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2025-07-04 22:39:10 +00:00
Ajan Zhong
4c282b4b4c ArmPkg,ArmPlatformPkg,ArmVirtPkg,UefiCpuPkg: Move ArmMmuLib.h to UefiCpuPkg
Move the ArmMmuLib interface definition to UefiCpuPkg, with this change,
MMU libraries for ARM, AARCH64, RiscV, LongArch64 architectures all
reside in UefiCpuPkg.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2025-07-04 22:39:10 +00:00
Kun Qin
9752e69927 ArmPkg: StandaloneMmCpu: Add MM communicate v3 support
As the standalone MM core begins supporting MM Communicate v3, this
update extends its functionality to incorporate MM Communicate v3 headers
format, enabling compatibility with the new protocol.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-26 21:43:56 +00:00
Kun Qin
6b7a3e05f0 ArmPkg: ArmStandaloneMmCoreEntryPoint: Add MM communicate v3 support
As the standalone MM core begins supporting MM Communicate v3, this
update extends its functionality to incorporate MM Communicate v3
headers, enabling compatibility with the new protocol.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-26 21:43:56 +00:00
Kun Qin
1634dd5b93 ArmPkg: MmCommunicationPei: Add MM communicate v3
As MM cores start to support MM communciate v3. This change moves the
MM communicate driver to produce MM communicate v3 PPI.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-26 21:43:56 +00:00
Kun Qin
6eed57a0aa ArmPkg: MmCommunicationDxe: Add MM communicate v3
As MM cores start to support MM communciate v3. This change moves the
MM communicate driver to produce MM communicate v3 protocol.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-26 21:43:56 +00:00
Mohamed Gamal Morsy
e0852f75d8 ArmPkg: StMM: Use x24 register to store stack address
Now that the use of 18 registers for FF-A is supported. Registers
from x0-x17 can be used by FF-A to return call results. StMM also uses
registers x19-x23 to store SPMC boot information.

Use the x24 register to store the stack address instead of x12
to avoid it being clobbered by FF-A calls.

Signed-off-by: Mohamed Gamal Morsy <mohamed.morsy@arm.com>
2025-06-25 19:12:01 +00:00
levi.yun
cce084eb45 ArmPkg/Include: fix usage of wrong macro in ArmGicv3Dxe
To get a SPI_MAX_INTID, interrupt controller type Register
should be masked with ARM_GIC_ICDICTR_GET_SPI_RANGE.
However, since ARM_GIC_ICDICTR_SPI_RANGE_TO_MAX_INTID macro
uses ARM_GIC_ICDICTR_GET_EXT_SPI_RANGE mask,
it returns wrong SPI_MAX_INITID.

This makes a failure of loading GenericWatchDog in FVP RevC model.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Fixes: d6d2f68e38 ("ArmPkg/Drivers/ArmGicDxe: ...")
2025-06-06 11:05:53 +00:00
Kun Qin
215ed375d9 ArmPkg: ArmStandaloneMmCoreEntryPoint: Use common UUID conversion routine
As new interfaces are made available to support UUID-GUID conversion,
this change is made to leverage new interfaces and remove the locally
duplicated code.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-05 05:01:57 +00:00
Nick Graves
d6d2f68e38 ArmPkg/Drivers/ArmGicDxe: Add Extended SPI support for GICv3
This commit enables extended SPI support for GicV3. GicV3 must decide,
based on the source intid, whether to access the SPI-range registers,
PPI-range registers in the redistributor, or the extended SPI-range
registers.

The protocol interfaces must also support registering an interrupt
handler with an extended SPI intid. To save ~24KB of memory, handler
allocation and access is delegated to GicV2 and GicV3. GicV2 retains the
existing handler mapping scheme using intids literally. GicV3 remaps
extended SPI intids to be immediately after the highest SPI intids.

Tested on qemu with the BSA test suite.

Signed-off-by: Nick Graves <nicholasgraves@google.com>
2025-06-03 23:04:30 +00:00
Aaron Pop
95f1b10aad ArmPkg: Add HobLib to ArmStandaloneMmCoreEntryPoint.
ArmStandaloneMmCoreEntryPoint makes use of GetNextHob
which comes from HobLib. The inf does not specify
HobLib has one of its library classes. Specify
HobLib in the LibraryClasses section of the
inf.

Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
2025-05-30 18:21:02 +00:00
John Schock
748bea7171 ArmPkg: ArmPsciResetSystemLib: PSCI warm reset fix
The current warm reset implementation attempts the PSCI SYSTEM_RESET2
command twice without clearing the local variable used for Arg1. This can
result in passing a random value as the reset type, which may cause the
PSCI call to behave unexpectedly and fall back to a cold reset.

This change addresses the issue by:
- Correcting the monitor call function ID.
- Explicitly zeroing the reset type field before invoking the PSCI
interface.

The updated warm reset flow has been tested and confirmed to invoke
SYSTEM_RESET2 as expected.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-05-28 09:46:07 +00:00
Michael Kubacki
6fde6ec6d8 ArmPkg: Fix typos
Corrects some typos.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-05-26 17:27:38 +00:00
Ard Biesheuvel
956ef6cd8b ArmPkg/ArmScmiDxe: Use array indexing to access adjacent buffers
MessageParams1 and MessageParams2 always point to adjacent slots in the
payload buffer, so no need to keep two separate pointers.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-04-25 08:46:27 +00:00
Johnny.Fan
f96d38f432 ArmPkg/ArmScmiDxe: Fix SCMI param overwrite in multi-transaction scenario
Fix an issue where input parameters in SCMI messages may be overwritten by
return values during repeated transactions when retrieving large data sets.

This issue affects:
1. ClockDescribeRates: when the number of clock rates exceeds the transfer
   limit. According to the SCMI specification (Section 4.6.2.5), the first
   and second parameters are initially used to pass clock_id and rate_index.
   However, due to SCMI’s shared memory communication mechanism, these same
   memory locations are later reused to return status and num_rate_flags.

2. PerformanceDescribeLevels: when the number of performance levels is too
   large to return in a single response. As described in Section 4.5.3.5,
   the first and second parameters are initially used for domain_id and
   level_index, but are overwritten with status and num_levels in the return.

Because SCMI reuses the same shared memory buffer for both input and output,
the return values can override input parameters if the buffer is not properly
re-initialized before each request. This patch ensures that the first and
second parameters are correctly set before every transaction to preserve
input integrity and ensure correct protocol behavior.

Signed-off-by: jie.fu <jie.fu@cixtech.com>
2025-04-22 09:23:32 +00:00
Leif Lindholm
51229eee58 ArmPkg,ArmVirtPkg,UefiPayloadPkg: make PcdVFPEnabled ARM-only
AArch64 no longer uses PcdVFPEnabled, so make the definition ARM-specific
and stop explicitly setting it for AArch64 platforms.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-04-11 12:48:56 +00:00
Leif Lindholm
6d886c3054 ArmPkg/CpuDxe: drop unused PcdVFPEnabled declaration
CpuDxe no longer uses PcdVFPEnabled, so drop the dependency
declaration before turning that Pcd ARM-only.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-04-11 12:48:56 +00:00
Leif Lindholm
7fe2436480 ArmPkg/ArmLib: don't check for FP support on AArch64
UEFI defines that FP support is required, so skip the runtime check
in ArmEnableVFP().

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-04-11 12:48:56 +00:00
Kun Qin
be03ceb117 ArmPkg: ArmFfaLib: Move ArmFfaLib implementation to MdeModulePkg
ArmFfaLib is an implementation of an industry specification-defined
interface with UEFI specific method of handling Rx/Tx buffer sharing
across multiple boot phases, which is more appropriately placed in
MdeModulePkg.

This update relocates the implementation of ArmFfaLib to MdeModulePkg,
thereby supporting the FFA call primitives for all other packages that
depend on this interface.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10 17:52:48 +00:00
Kun Qin
937ffef8ed ArmPkg: ArmFfaLib.h: Move to MdePkg
As a set of definitions from an industry specification-defined interface,
ArmFfaLib.h is more appropriately placed in MdePkg.

This update relocates both the header definition of ArmFfaLib to MdePkg,
thereby supporting the monitor call primitives for all other packages
that depend on this interface.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10 17:52:48 +00:00
Kun Qin
541c46a705 ArmPkg: ArmSvcLib: Move ArmSvcLib to MdePkg
As an implementation of an industry specification-defined interface,
ArmSvcLib is more appropriately placed in MdePkg.

This update relocates both the header definition and the implementation
of ArmSvcLib to MdePkg, thereby supporting the supervisor call primitives
for all other packages that depend on this interface.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10 17:52:48 +00:00
Kun Qin
211bb9b839 ArmPkg: ArmSmcLibNull: Move ArmSmcLibNull to MdePkg
ArmSmcLibNull is a null implementation of an industry specification-
defined interface, which is defined in MdePkg.

This update relocates the null implementation of ArmSmcLib to MdePkg,
thereby supporting the monitor call primitives for ARM platforms that
does not have SMC capabilities.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10 17:52:48 +00:00
Kun Qin
86099b948b ArmPkg: ArmSmcLib: Move ArmSmcLib to MdePkg
As an implementation of an industry specification-defined interface,
ArmSmcLib is more appropriately placed in MdePkg.

This update relocates both the header definition and the implementation
of ArmSmcLib to MdePkg, thereby supporting the monitor call primitives
for all other packages that depend on this interface.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10 17:52:48 +00:00
Kun Qin
014689399f ArmPkg: FF-A headers: Move to MdePkg
ArmFfaBootInfo.h, ArmFfaPartInfo.h and ArmFfaSvc.h comprise a set of
definitions established by industry standard specifications:
https://developer.arm.com/documentation/den0077/latest

This update relocates the header definitions from ArmPkg to MdePkg to
maintain consistency within the EDK2 layout.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10 17:52:48 +00:00
Kun Qin
9bcb2e41f7 ArmPkg: ArmStdSmc.h: Move to MdePkg
ArmStdSmc.h comprises a set of definitions established by an industry
standard specification:
https://developer.arm.com/documentation/den0028/latest/

This update relocates the header definition from ArmPkg to MdePkg to
maintain consistency within the EDK2 repo layout.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10 17:52:48 +00:00
kuqin12
8baa1c5120 ArmPkg: ArmStandaloneMmCoreEntryPoint: Support 18 register DIRECT_REQ2
This change added the support for using 18 registers when FF-A
DIRECT_REQ2 is used to communicate with MM core.

This change was tested on QEMU SBSA and booted to Windows.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-02 16:25:45 +00:00
Kun Qin
8d03c42d38 ArmPkg: ArmFfaLib: Update FF-A direct message to support 18 registers
This change expands the support of FF-A direct message 2 call to use the
full 18 registers.

It also adds a check in the contructors to ensure the SMCCC meets the
minimal requirement of v1.2 to support FF-A v1.2 usage.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-02 16:25:45 +00:00
Kun Qin
47b793f38c ArmPkg: ArmSvcLib: Support all 18 registers
This extends ARM_SVC_ARGS to support all x0-x17 registers use case for
FF-A.

The ArmCallSvc function is also updated to support 18-register usage.

Co-authored-by: Olivier Deprez <Olivier.Deprez@arm.com>
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-02 16:25:45 +00:00
Kun Qin
c0ecd11e62 ArmPkg: ArmSmcLib: Support all 18 registers
This extends ARM_SMC_ARGS to support all x0-x17 registers use case for
FF-A.

The ArmCallSmc function is also updated to support 18-register usage.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-02 16:25:45 +00:00
Crystal Lee
1c6ce560f0 ArmPkg: Add a protocol notification for gEfiDxeMmReadyToLockProtocolGuid
Add and install a protocol notification handler for
gEfiDxeMmReadyToLockProtocolGuid, in order to to trigger MMI
handler to install gEfiMmReadyToLockProtocolGuid protocol in Mm.

Signed-off-by: Crystal Lee <CrystalLee@ami.com>
2025-03-19 10:51:13 +00:00
Leif Lindholm
20247e2342 ArmPkg/ArmTransferListLib: improve coding style compliance
The existing code was full of abbreviated function/variable names.
Let's nip that in the bud before we add more code to this library.

Update the current only upstream user: ArmStandaloneMmCoreEntryPoint.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-03-06 10:17:25 +00:00
Kun Qin
f75e6952ca ArmPkg: ArmFfaSvc: Adding missing FF-A definitions
This change added missing FF-A definitions for certain FF-A function IDs.

The `ARM_FFA_NOTIFICATION_*` and `ARM_FFA_FEATURE_*` definitions are
based on FF-A spec v1.3 ALP1.

The `ARM_FFA_MEM_PERM_RESERVED_MASK` definition is based on FF-A memory
protocol spec v1.3 ALP1.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-02-26 11:04:29 +00:00
Michael Kubacki
2625e91963 ArmPkg/ArmStandaloneMmCoreEntryPoint: Fix cast on clang
Compilation error:

```
ArmStandaloneMmCoreEntryPoint.c:1041:48: error: cast to smaller
  integer type 'unsigned long' from 'void *'
  [-Werror,-Wvoid-pointer-to-int-cast]

  1041 |   DEBUG ((DEBUG_INFO, "Start Dump Hob: %lx\n",
             (unsigned long)HobStart));
```

The `%p` specifer is now used to print the pointers.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-02-24 16:30:19 +00:00
Kun Qin
523dbb6d59 ArmPkg: ArmFfaStandaloneMmLib: Fix non-FFA path
ArmFfaLibCommonInit will return EFI_UNSUPPORTED when there is no FFA
supported on the platform. This is expected behavior. However, the return
of error code will incur program asserts.

This change fixed the non-FFA path for the Standalone MM instance.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-02-11 21:21:40 +00:00
Oliver Smith-Denny
efbf5ed08c MdePkg: Move StackCheckLibStaticInit to StackCheckLib
This commit oves StackCheckLib from a NULL lib to an instance of
StackCheckLib. This requires every entry point to add a library
dependency on StackCheckLib. It also requires every SEC module
to have a dependency on StackCheckLib because there is no
standard SEC entry point.

It allows for greater flexibility for a platform to apply stack
cookies and simplifies DSC logic.

Continuous-integration-options: PatchCheck.ignore-multi-package

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-02-07 02:23:11 +00:00
Ard Biesheuvel
62cd7d338b ArmPkg: Retire ArmDisassemblerLib
No longer used anywhere so can be retired.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-31 13:50:45 +00:00
Ard Biesheuvel
ef80dd8fad ArmPkg: Stop using ArmDisassemblerLib
ArmDisassemblerLib is used to pretty print the instruction that
triggered an unhandled exception, but it was never implemented for
AARCH64, and according to the existing file comment, Thumb2 support
(which is used predominantly when building EDK2 for 32-bit ARM due to
its smaller size) is incomplete.

The DEBUG diagnostics that are produced on an unhandled exception are
generally sufficient to dump the entire executable that triggered it,
and so this disassembly is of limited value, especially because it
doesn't work on AARCH64.

So let's start getting rid of it, by dropping references to it in code
and in the various .INF and .DSC files. Once out-of-tree platforms have
been allowed to catch up, we can remove the library implementation and
its class definition entirely.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-30 16:01:56 +00:00
Leif Lindholm
74376f0b72 ArmPkg,ArmPkg/ArmExceptionLib: drop vector relocation variant/support
There were several bugs in the vector table relocation code which means
it can't really have been used by anyone on AArch64 in the last decade or
so. So delete the support code from the library, as well as the
ArmRelocateExceptionLib.inf file.

This gets rid of PcdDebuggerExceptionSupport (including a duff reference
in CpuDxe), PcdCpuVectorBaseAddress and PcdRelocateVectorTable.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-01-30 15:09:09 +00:00
Ard Biesheuvel
c558a3b18b ArmPkg/ArmGicDxe: Map GIC MMIO regions before use
The GIC driver itself has intimate knowledge of the hardware, and so it
is the best suited to create the mappings of the MMIO control regions,
in case they have not been mapped yet by the platform code.

So call in the the CPU arch protocol to map the CPU interface,
distributor and redistributor regions as they are discovered by the GIC
driver startup code.

Note that creating these mappings has no effect if the regions in
question have already been mapped with the correct attributes.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-30 13:07:05 +00:00
Ard Biesheuvel
3c4c7a0fc9 ArmPkg/ArmGicDxe: Remove pointless passing around of MMIO addresses
The GIC distributor and redistributor addresses that are passed into the
interrupt enable and disable routines are always the same, so just use
the global variables directly.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-30 13:07:05 +00:00
Ard Biesheuvel
e68e784649 ArmPkg/ArmGicDxe: Avoid pointless repeated iteration over GIC frames
The GIC DXE driver only runs on the boot CPU, and so there is really no
point in iterating over all the redistributor frames every time an
interrupt is enabled, disabled or its state tested. Instead, do this
only at load time.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-30 13:07:05 +00:00
Ard Biesheuvel
387fcf4fa1 ArmPkg/ArmGicDxe: Replace CpuArch registration event with DEPEX
Instead of relying on a protocol notification event to register the core IRQ
interrupt handler with CPU arch protocol once it becomes available, use
a DEPEX to ensure that the GIC driver is not dispatched at all until the
CPU arch protocol has turned up.

This will allow the GIC driver to use other CPU arch protocol methods,
such as the ones needed to map the GIC MMIO regions at driver startup.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-30 13:07:05 +00:00
Ard Biesheuvel
fb7497cbf9 ArmPkg/CpuDxe: Replace DEPEX on h/w protocol with event notification
Currently, ArmPkg's CpuDxe DEPEXes on the hardware interrupt protocol,
to ensure that it is not dispatched before the GIC driver. This way, the
CpuDxe driver is guaranteed not to enable interrupts on the CPU side
before the GIC driver has had the opportunity to configure the
interrupts on the distribution side.

However, this prevents the GIC driver from using any of the CPU arch
protocol interfaces, such as mapping memory, which it may need to do on
platforms where the GIC MMIO regions are not mapped yet when the driver
is started.

So instead, use a protocol notification on the hardware interrupt
protocol, which is installed by the GIC driver (as well as other
existing interrupt controller drivers for platforms that do not
implement a GIC) after it starts up and deasserts and disables all
incoming interrupts. Manipulate the interrupt state as usual only after
this notification has been received. Before that, keep track of the
caller's intent regarding the interrupt enabled state in a shadow
variable, but do not actually enable interrupt delivery to the CPU just
yet.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-30 13:07:05 +00:00