| Age | Commit message (Collapse) | Author | Files | Lines |
|
CI reports spell-check error in ArmPkg:
ERROR - SpellCheck found 7 failing words. See CI log for details.
CRITICAL - If these are not errors add this to your ci.yaml file.
"SpellCheck": {
"ExtendWords": [
"discoery",
"evlog",
"icdiptr",
"itlines",
"mstrict",
"ppihmr",
"trnasfer"
]
}
Fix this problem.
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
The MISC_MM_COMMUNICATE_BUFFER stored the FF-A direct message
registers in a DIRECT_MSG_ARGS structure. Populating and reading it
required manually re-indexing every register (EventSvcArgs->Arg4..Arg17
into DirectMsgArgs.Arg0..Arg13). This shifted the register positions and
left the buffer layout inconsistent with the raw FF-A argument register
file, making it error prone to correlate a slot with its architectural
register.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
Add ArmSmcccSocIdLib to provide a shared interface for checking support
for the SMCCC Architecture SoC ID service and retrieving the JEP106
identification code and SoC revision.
Move the existing SMCCC SoC ID handling out of ProcessorSubClassDxe and
update the driver to use the new library. Continue to use the MIDR value
for the SMBIOS Processor ID when the SMCCC SoC ID service is unavailable.
This allows other SMBIOS implementations to reuse the SMCCC handling
without duplicating it or depending on the legacy ProcessorSubClassDxe
driver.
Signed-off-by: Varshit Pandya <Varshit.Pandya@arm.com>
|
|
The SMBIOS Type 4 field SocketType was added in commit
7f505d377b44aeee59f34b3d898f6caf0a0df538 in 2024. This
caused the table size to be invalid when platforms specify
versions of SMBIOS before 3.8.
Update ProcessorSubClassDxe to handle fetching the string for the
socket type including calling into OemMiscLib to retrieve it.
Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
|
|
In StandaloneMm, the allowed memory permission combinations are ROX, RO,
and RW.
At the initial stage, all regions are mapped as ROX.
When drivers are loaded for relocation, the image is first mapped as RW.
However, the current mechanism introduces significant overhead
when changing memory permissions. For example, when changing permissions
from ROX to RW, the process is performed in two steps:
1. Clear the execute (X) permission (ROX → RO)
2. Add the write (W) permission (RO → RW)
To execute step (1), the system first retrieves the permissions of
the target region. This may trigger multiple SMC calls,
depending on the permissions of the pages within that region.
This permission retrieval operation is redundant, as there is no need
to maintain an intermediate state. Nevertheless,
it can cause additional SMC calls and coherence operations
from the SPMC (e.g., TLB flushes).
Therefore, this redundant operation should be removed, and in most cases,
the memory permission should be updated with a single
“set memory permission” operation.
Note:
The ArmxxxMemoryRegionxxx() interfaces e.g. ArmSetMemoryRegionNoExec(),
etc. return success when the Length parameter is 0 as
the SectionHeader.Misc.VirtualSize could be 0 Length
like .reloc section:
UpdateMmFoundationPeCoffPermissions: Section 2 of image at 0x7004000
has 0x42000040 permissions
UpdateMmFoundationPeCoffPermissions: Section 2 of image at 0x7004000
has .reloc name
api_ffa_mem_perm_set page_count 0
ERROR: FFA_MEM_PERM_SET: page_count was zero
Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
Some functions in ArmMmuStandaloneMmLib lack documentation.
Add appropriate documentation for each function.
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
Merge DefaultExceptionHandlerLib into CpuExceptionHandlerLib.
Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Vishal Oliyil Kunnil <vishalo@qti.qualcomm.com>
|
|
Replace traditional `#ifndef`/`#define`/`#endif` include guards with
`#pragma` once.
`#pragma once` is a widely supported preprocessor directive that
prevents header files from being included multiple times. It is
supported by all toolchains used to build edk2: GCC, Clang/LLVM, and
MSVC.
Compared to macro-based include guards, `#pragma once`:
- Eliminates the risk of macro name collisions or copy/paste errors
where two headers inadvertently use the same guard macro.
- Eliminate inconsistency in the way include guard macros are named
(e.g., some files use `__FILE_H__`, others use `FILE_H_`, etc.).
- Reduces boilerplate (three lines replaced by one).
- Avoids polluting the macro namespace with guard symbols.
- Can improve build times as the preprocessor can skip re-opening the
file entirely, rather than re-reading it to find the matching
`#endif` ("multiple-include optimization").
- Note that some compilers may already optimize traditional include
guards, by recognzining the idiomatic pattern.
This change is made acknowledging that overall portability of the
code will technically be reduced, as `#pragma once` is not part of the
C/C++ standards.
However, this is considered acceptable given:
1. edk2 already defines a subset of supported compilers in
BaseTools/Conf/tools_def.template, all of which have supported
`#pragma once` for over two decades.
2. There have been concerns raised to the project about inconsistent
include guard naming and potential macro collisions.
Approximate compiler support dates:
- MSVC: Supported since Visual C++ 4.2 (1996)
- GCC: Supported since 3.4 (2004)
(http://gnu.ist.utl.pt/software/gcc/gcc-3.4/changes.html)
- Clang (LLVM based): Since initial release in 2007
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
|
|
The Firmware Handoff specification has withdrawn
the use of the “XOR” checksum and updated
the checksum calculation to use “SUM” [0].
Accordingly, libtl has also been updated to reflect this change [1].
The “XOR” checksum calculation existed in version 1;
however, as mentioned above, it has been withdrawn, and
TF-A always provides the checksum using the “SUM” calculation.
Therefore, the xferlist version is updated to version 2.
Link: https://github.com/FirmwareHandoff/firmware_handoff/pull/81 [0]
Link: https://review.trustedfirmware.org/c/shared/transfer-list-library/+/46033 [1]
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
The Platform Security Firmware Update specification, 1.0 for A-profile
(https://developer.arm.com/documentation/den0118/latest) describes
a standard mechanism for performing firmware updates on Arm platform.
This mechanism utilises the Arm Firmware Framework for Arm A-profile
specification to transfer the firmware update binaries
from the Normal World to the Secure World.
An update agent on the Secure world then updates the flash area with the new update image.
Add related headers for firmware update feature.
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
Pass ARM_MM_HANDLER_CONTEXT to MmHandler
so it can determine:
- whether the request came via FF-A or SPM_MM mode
- the service type
- whether it is a secure request or the source partition ID
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
Introduce ArmMmHandlerContext.h, which defines the ARM_MM_HANDLER_CONTEXT
structure passed to each MmHandler’s Context argument. This structure
provides:
- The current communication protocol type
- The service type
- Protocol-specific details
This enables MM drivers to differentiate requests from MM communication
versus DIRECT_MSG_REQ2, support both SPM_MM and FF-A v1.2, and determine
whether a request originated from the secure world.
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
edk2 is dropping support for the ARM32 architecture. This
commit removes ARM32 code from the remaining parts of ArmPkg.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
|
|
edk2 is dropping support for the ARM32 architecture. This
commit removes ARM32 files from ArmMonitorLib.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
|
|
Add TRANSFER_EVENT_LOG information according to firmware hand-off spec[0].
and related helper.
Links: https://github.com/FirmwareHandoff/firmware_handoff/blob/main/source/transfer_list.rst#tpm-event-log-table-entry-layout-xferlist_evlog
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
Add helper to get TrnasferList from HOB list.
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
ArmTransferListHobGuid will hold the TransferList base address
https://firmwarehandoff.github.io/firmware_handoff
Signed-off-by: Prachotan Reddy Bathi <Prachotan.Bathi@arm.com>
|
|
Added functionality TransferList Library
TransferListVerifyChecksum - Verify TransferList CheckSum
TransferListCheckHeader - Check if TransferList header is valid,
return suitable opcodes validating the header
TransferListFindEntry - Find a specific entry on the TransferList
using the TagId
TransferListDump - Dump the contents of the TransferList header
and the entry headers
Signed-off-by: Prachotan Reddy Bathi <Prachotan.Bathi@arm.com>
|
|
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>
|
|
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>
|
|
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: d6d2f68e3801 ("ArmPkg/Drivers/ArmGicDxe: ...")
|
|
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>
|
|
Corrects some typos.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
No longer used anywhere so can be retired.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
When re-entering EDK2 from a high level OS such as Linux, the GICv3 may
be configured to use split priority drop and deactivate (EOImode == 1),
whereas EDK2's GICv3 driver assumes the default setting of EOImode == 0.
So clear the EOImode bit explicitly when taking control of the GIC.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
Move the remaining code in ArmGicLib into ArmGicDxe, its only user, and
drop the dependency on ArmGicLib. Note that ArmGicDxe has an undeclared
dependency on ArmLib, so declare that instead.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
ArmGicArchLib is no longer use so remove all remaining references and
implementations.
Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
Before getting rid of ArmGicArchLib entirely, preserve some GIC
architecture related preprocessor defines by moving them into
ArmGicLib.h instead.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
ArmGicArchLib implements a check on the accessibility of the GIC system
register interface, which is a prerequisite for using the GIC in v3
mode. It might be possible to use GICv2 compatibility mode on poorly
configured platforms where the GIC is v3 capable but not accessible, but
in most cases, the GIC is driven in its native mode.
This check is now only carried out in a single place, and there is not
really any reason to keep this in a separate library. Even though
ArmVirtPkg implements its own version, the basic check (and enablement
of the sysreg interface) is still needed.
So move this check into the DXE driver itself, and drop the dependency
on ArmGicArchLib. This allows it to be retired in a subsequent patch.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
ArmGicDxe is the only remaining user of ArmGicLib, and so there is no
need for the abstraction, which is drawn at an arbitrary boundary
anyway. So remove the remaining V2 specific code into the DXE driver.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
Move the remaining ArmGicLib code that is shared between the v2 and v3
GIC DXE drivers into ArmGicCommonDxe.c
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
Drop some ArmGicLib declarations that don't actually exist in the code.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
Split ArmGicEnableDistributor () into GICv2 and v3 specific versions,
and move them into their single respective callers, so that the original
can be dropped from ArmGicLib altogether.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
ArmGicLib is agnostic about the difference between v2 and v3, but its
APIs are only called from code that is either v2-specific or
v3-specific. That makes the generic interface kind of pointless, and we
can just merge this code into the callers.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
ArmGicEndOfInterrupt () is never used: the v2 and v3 versions of the
driver call respective specific versions directly, and so this API can
be removed.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
ArmGicSendSgiTo () is never used, and is fundamentally tied to multi-CPU
operation which is no longer supported. So drop the implementation.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
The ArmGicLib API exposes ArmGicEnableInterruptInterface () and
ArmGicDisableInterruptInterface (), but only the former is actually
used, and only from the GICv2 driver. So drop the API entirely, and
invoke the v2 version of the underlying interface directly.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
StandaloneMmCpu driver is only used for Arm architecture and
StandaloneMmCoreEntryPointLib for Arm has specific implementation with
StandaloneMmCpu driver.
Move StandaloneMmCpu Driver and StandaloneMmCoreEntryPointLib for Arm
to ArmPkg.
Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Levi Yun <yeoreum.yun@arm.com>
|
|
MmCommunication.h is used in MmCommunicationDxe/Pei both.
Move this header file to common include.
Signed-off-by: Levi Yun <yeoreum.yun@arm.com>
|
|
Add ArmFfaLib.h which defines interfaces correspond to FF-A ABIs.
Signed-off-by: Levi Yun <yeoreum.yun@arm.com>
|