| Age | Commit message (Collapse) | Author | Files | Lines |
|
This makes sure the set of devices for ConOut and ErrOut is identical.
Without this things get a bit messy because ConSplitterDxe can not deal
very well with the situation that a ConOut + ErrOut share some but not
all devices (i.e. vga + serial for ConOut and serial only for ErrOut).
It ends up running ConOut in 128x40 and ErrOut in 80x50 mode.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Previously EfiBootManagerBoot reported
EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED when a boot option returned an
error, but reported nothing on success. Report the PI 1.10 status
code EFI_SW_DXE_BS_PC_BOOT_OPTION_COMPLETE when a boot option loads,
executes, and returns success, so status code listeners can tell that
a boot option was attempted and that control returned to firmware.
Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
|
|
PI 1.10 defines a new progress status code,
EFI_SW_DXE_BS_PC_BOOT_OPTION_COMPLETE (EFI_SUBCLASS_SPECIFIC | 0x0A),
reported when a boot option loads, executes, and returns success with
control returned to firmware.
Add the definition to PiStatusCode.h.
Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
|
|
This change adds a fast path for simple VOID* hexadecimal byte arrays,
avoiding the generic expression tokenizer's repeated processing of large
PCD values. Regression tests for both paths. It does not change the
existing parser for structured and symbolic expressions.
This reduces parsing time for a 28 KiB generated PCD from roughly 2
seconds to 50 milliseconds.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
This change fixes some ECC check failures around the usage of doxygen
keywords.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
This change updates the host based units for AArch64 systems.
The RngLib is updated to use timer based , rather hardware based library
to allow usage on various host systems.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
This change updates the header file guard to #pragma once to adhere to
the coding convention of this repository.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
This change updates the host based units for AArch64 systems.
The RngLib is updated to use timer based , rather hardware based library
to allow usage on various host systems.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
This change fixes a few noticable NO-TARGET ECC check failures when
building using GCC.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
The current RngLib directly queries the random number from the hardware
register. But this has the limiation on imposing the host hardware
capability to the target test. i.e. for AArch64 unit tests, rndr
instruction is not always available.
This change moves the unit tests to use timer based RngLib for general
testability.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
This change introduces an instance of TimerLib based on the host's
standard C library to provide a free running performance counter and
calibrated delays for host-based unit tests.
This change paves way to support other host based tests that depends on
the availability of this interface.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
This change adds the support of reading CNTPCT_EL0 and ID_AA64ISAR0_EL1
through current BaseLib definition.
This paves way to allow the linkage of these functions needed on other
host based unit tests.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
PatchSmmSaveStateMap() applies the extended 32KB data tail to the final
SmBase[] entry, assuming that the array is ordered by physical address
SMM_BASE_HOB_DATA indexes SmBase[] by processor index and does not
require a physical address order. A valid producer can therefore supply
a descending SMBASE layout. In that case, extending the data range from
the final array element overlaps SMI entry code in higher physical
tiles and marks it non-executable.
Find the SMBASE tile with the highest physical address and apply the
extended data tail only to that tile. Existing ascending layouts do not
change their current behavior
Signed-off-by: Aleksandr Goncharov <chat@joursoir.net>
|
|
This patch fixes the building error with llvm 23.1:
edk2-dev/OvmfPkg/LoongArchVirt/Drivers/StableTimerDxe/Timer.c:25:16: error: variable 'mTimerTicks' set but not used [-Werror,-Wunused-but-set-global]
25 | STATIC UINT64 mTimerTicks = 0;
| ^
1 error generated.
Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
|
|
ArmVirtQemu.dsc sets PcdPlatformBootTimeOut to 3 seconds as a
PcdsDynamicDefault and to 5 seconds as the default of the HII-backed
"Timeout" variable. With a fresh variable store, and unless QEMU is
started with "-boot menu=on", an AArch64 guest therefore idles for
about 5 seconds in BDS on every boot. OVMF defaults the same PCD to
0 and boots immediately under the same conditions.
The timeout logic is otherwise identical on both platforms: the
PlatformBootManagerLib calls GetFrontPageTimeoutFromQemu(), which
honours "-boot menu=on[,splash-time=N]" and falls back to the platform
default, and hands the result to the common BdsDxe wait loop. Only
the DSC default differs.
The delay is a measurable penalty for short-lived AArch64 VMs. In a
time-to-ssh comparison a QEMU guest on an AArch64 host took 14.6s
versus 11.8s on x86; with the timeout at 0 the AArch64 guest came in
at 8s.
Set both defaults to 0 to match OVMF. Users who want the boot menu
prompt keep the same controls as on x86: "-boot menu=on" still yields
a 3 second (or splash-time) wait, and because the PCD remains backed
by the UEFI "Timeout" variable, "efibootmgr -t N" from the guest
continues to work.
Fixes: https://github.com/tianocore/edk2/issues/13068
Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com>
|
|
Signed-off-by: Kirk Chou <kirk.chou@hpe.com>
|
|
In eMMC status detection logic in the `MmcIoBlocks' function, if a timeout
occurs, the Timeout variable will end with a value -1 as the self-
subtraction operation is performed after determining 0 in the while loop.
This means that the function could never return a `EFI_NOT_READY' status.
As Timeout is of a signed type, change the conditional statement to
less-than-or-equal to 0 to fix timeout/busy detection.
Signed-off-by: snowpiaoling <1972997989@qq.com>
|
|
Add a path environment descriptor for IntelFsp2Pkg/Tools under the
fsptools scope. Allows stuart build system to add the directory to
PATH and PYTHONPATH so its command-line tools and Python modules
are available to build workflows without manual environment setup.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
|
|
Since TPM CRB over FF-A specification v1.1 EAC [0], get_crb_info
interface is added.
Add get_crb_info function-id and relevant information.
Link: https://support.arm.com/documentation/den0138/latest/ [0]
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
Use PromptForUserConfirmation() function from library
so it is abstracted at the platform level.
Signed-off-by: Raymond Diaz <raymonddiaz@microsoft.com>
Signed-off-by: Bret Barkelew <brbarkel@microsoft.com>
|
|
Add Tcg2PhysicalPresencePromptLib to support breaking out
the PromptForUserConfirmation() function into a platform
specific library.
Signed-off-by: Raymond Diaz <raymonddiaz@microsoft.com>
Signed-off-by: Bret Barkelew <brbarkel@microsoft.com>
|
|
This reverts commit 2c2f74a581473d20b54c4310f27abbd73c8e9687.
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
|
|
The Len field is set to string length. Since the array is zero-based,
the terminator index should be set to Len instead of Len + 1.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
|
|
Jump to the Done cleanup label when `ShellCommandLineParse()` fails, and move
the success path (unchanged) out of the now-unnecessary else block. This patch
does not introduce behavioral change.
Generated by the following Coccinelle semantic patch:
```smpl
@@
identifier status, problem, ret, hii;
statement S;
@@
if (EFI_ERROR (status)) {
if ((status == EFI_VOLUME_CORRUPTED) && (problem != NULL)) {
ShellPrintHiiDefaultEx (STRING_TOKEN (STR_GEN_PROBLEM), hii, ..., problem);
FreePool (problem);
ret = SHELL_INVALID_PARAMETER;
} else {
ASSERT (FALSE);
}
+ goto Done;
}
- else {
...
- }
...
Done:
S
```
Signed-off-by: Mingjie Shen <shen497@purdue.edu>
|
|
The ArmGicDxe.inf name has been repurposed to refer to the driver
currently known as GicV3Dxe, which supports GIC versions 3 and newer.
Refer to this driver by its new name, so that the old name can be
retired.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
Now that all platforms that do require GIC v2 support to be retained
have implemented their own logic to dispatch either the v2 version or
the v3+ version, depending on what the platform implements, the unified
version that supports both in a single driver is no longer used.
Delete the driver, and repurpose the ArmGicDxe.inf name by turning it
into an alias of ArmGicV3Dxe.inf. That way, existing platforms that
incorporate ArmGicDxe.inf will lose GICv2 support rather than break
entirely (which is unlikely to make a difference in most cases), and
going forward, the confusing V3 naming (considering the fact that the V3
driver supports v4 and v5 as well) can be phased out as well.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
Applies a UEFI variable policy to the "MTC" variable to ensure that it
is the size of a UINT32 and the variable attributes are restricted
to BS, RT, and NV.
A protocol dependency on the Variable Policy Protocol is not added to
the driver's dependency expression to allow it to be dispatched in
firmware that does not have the Variable Policy Protocol installed.
Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
|
|
In the `MmcTransferBlock' function, the `Timeout' variable is defined but not
processed, so timeout handling is added.
Signed-off-by: snowpiaoling <1972997989@qq.com>
|
|
Replace the open-coded read of the 3-byte FFS file Size[] field in
FindFfsFileAndSection() with the FFS_FILE_SIZE() macro from
Pi/PiFirmwareFile.h. The macro reads exactly the three Size[] bytes
(endianness-safe) instead of a 4-byte load that over-reads the
adjacent byte. No functional change.
Verified by building the module for LOONGARCH64 with a GCC cross
toolchain:
build -p OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc -a LOONGARCH64 \
-t GCC -b DEBUG -m OvmfPkg/LoongArchVirt/Sec/SecMain.inf
SecMain.c compiles and links into SecMain.efi.
Generated with the following Coccinelle semantic patch:
```smpl
@@
EFI_FFS_FILE_HEADER *E;
typedef UINT32;
@@
(
- *(UINT32 *)(E->Size) & 0x00FFFFFF
+ FFS_FILE_SIZE (E)
|
- *(UINT32 *)E->Size & 0x00FFFFFF
+ FFS_FILE_SIZE (E)
)
```
Signed-off-by: Mingjie Shen <shen497@purdue.edu>
|
|
Replace the open-coded read of the 3-byte section Size[] field with
the SECTION_SIZE() macro from Pi/PiFirmwareFile.h. The macro reads
exactly the three Size[] bytes (endianness-safe) instead of a 4-byte
load that over-reads the adjacent byte. No functional change.
Verified by building BaseTools and running GenSec:
python3 BaseTools/Edk2ToolsBuild.py -t GCC
GenSec -s EFI_SECTION_RAW -o out.sec in.bin # in.bin: 100 bytes
out.sec is 104 bytes: the 100-byte payload plus the 4-byte
EFI_COMMON_SECTION_HEADER. The Size field of the header reads
0x000068, matching out.sec's size that is calculated by SECTION_SIZE.
Generated with the following Coccinelle semantic patch:
```smpl
@@
EFI_COMMON_SECTION_HEADER *E;
typedef UINT32;
@@
(
- *(UINT32 *)(E->Size) & 0x00FFFFFF
+ SECTION_SIZE (E)
|
- *(UINT32 *)E->Size & 0x00FFFFFF
+ SECTION_SIZE (E)
)
```
Signed-off-by: Mingjie Shen <shen497@purdue.edu>
|
|
Currently, UefiPayloadPkg has the same incorrect behavior
copied from DxeIpl to have two memory allocation HOBs for
the DXE stack. This follows the previous two commits in
updating that behavior, with the same behavior as EmbeddedPkg
to free the old stack region, instead of preserving it as
DxeIpl does.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
|
|
Currently, PrePiHobLib will produce two memory allocation
HOBs for the stack, based on the behavior it copied from
DxeIpl. This is an incorrect description of handoff state.
This commit follows the DxeIpl logic change to only produce
a single memory allocation HOB for the new stack. The
difference is that PrePiHobLib does not preserve the old
stack region and instead frees it. That behavior is
preserved.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
|
|
Currently, DxeIpl will allocate memory for the new DXE stack,
which creates a memory allocation HOB for that region. It will
then call UpdateStackHob() to find the stack HOB with the old
stack info and update the memory address/length to correspond
to the new stack. It then creates a new memory allocation HOB
for the old stack region as it needs to remain mapped.
This ends up creating two memory allocation HOBs for the new
stack: a regular memory allocation HOB for the AllocatePages()
call and then the stack HOB (which is a memory allocation HOB
with a special name).
When DXE Core ingests these, it will ignore one of the two HOBs
when it goes to allocate memory. However, this is incorrectly
describing handoff state. There never should be overlapping
memory allocation HOBs.
This commit updates DxeIpl behavior to instead find the old
stack HOB, convert it to a regular memory allocation HOB,
then find the memory allocation HOB for the new stack range
and convert it into the stack HOB.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
|
|
Add multiple library class entries for libraries that multiple implement
library classes.
Signed-off-by: Khalid Ali <khaliidcaliy@gmail.com>
|
|
After SecTemporaryRamSupport restores its saved registers and moves RSP to
permanent memory, the stack is 16-byte aligned. The existing 0x28-byte
allocation for the ZeroMem call adds an unnecessary 8-byte padding slot
and leaves RSP misaligned immediately before the call.
Reserve only the 32-byte EFIAPI register spill area for ZeroMem. This
preserves 16-byte stack alignment at the call site while providing the
required home space to the callee.
https://github.com/tianocore/edk2/pull/12244 causes the X64 GCC and CLANG
tools to generate a prologue in InternalMemZeroMem() that requires a
16-byte aligned stack. With the previous stack allocation, that prologue
can execute with an incorrectly aligned stack. Without this change, a
seg fault is generated when SecTemporaryRamSupport calls ZeroMem.
The earlier CopyMem call continues to require its 0x28-byte allocation
because its preceding stack state differs.
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
|
|
DumpUicCmdExecResult & DumpQueryResponseResult are called to dump the
result of UIC commands after a failure. Depending on the nature of the
failure, not all information may have been properly initialized. This is
already handled in callers with existing retry logic, but the assert in
the dump command can cause a crash in debug builds for due to hardware
race conditions on first attempt.
Signed-off-by: Chris Fernald <chfernal@microsoft.com>
|
|
The SMBIOS Type 7 generator unconditionally reports associativity as
Other when aggregating caches at the same level, even when all caches
have identical associativity.
Preserve the existing associativity when the incoming cache matches it,
and report Other only when the associativities differ.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
|
|
This library is no longer used so it can be removed.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
Use the separate v2 and v3 versions of the GIC driver, rather than the
unified one, which is a bit odd because a platform never implements
both, and GICv2 is obsolete by now.
The only reason the unified driver is being kept alive is for virtual
platforms that could decide to expose either. Let's refactor this a bit
so that the version detection is separated from the driver dispatch
itself, so that ordinary DEPEX resolution can be used to load either the
v2 or the v3 driver.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
Allow the unified ArmGicDxe driver to be replaced with either the v2 or
the v3 one, depending on what the platform actually implements.
This involves injecting a DEPEX on the ArmVirtPkg specific GUID that
conveys whether the GIC is a revision 2 or a newer one.
This DEPEX injection is done by adding a NULL library class resolution
to each driver when incorporating it into the platform build. So add a
library for GICv2 and one for GICv3 or newer.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
Take the code from ArmVirtGicArchLib, which is injected into the unified
GIC driver by NULL library class resolution to set the associated PCDs
as the driver loads, and implement a DXE driver that performs the same
DT based detection.
However, in this case, the driver installs a NULL protocol under a GUID
that indicates the presence of either a V2 or a V3 (or later) GIC, in a
way that allows the DXE driver dispatcher to take this into account.
This will allow the unified GIC driver to be replaced with the split V2
and V3 versions, which is all we care to support going forward.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
This change adds 5 unit tests to cover the incoming buffer validation
routine in the MmCommunicate function.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
`ProcessCommunicationBuffer()` computes BufferSize by adding a fixed
offset (24 bytes) to an attacker-controlled MessageLength (UINT64):
`BufferSize = OFFSET_OF(EFI_MM_COMMUNICATE_HEADER, Data) +
CommunicateHeader->MessageLength;`
When `MessageLength >= 0xFFFFFFFFFFFFFFE8`, the addition wraps to a small
value (0–23 bytes) after UINTN truncation.
The subsequent bounds check evaluates FALSE on the wrapped value,
bypassing size validation and allowing CopyMem to proceed with a
corrupted size into the fixed MM communication buffer.
This change added an overflow check before the addition - rejects with
EFI_INVALID_PARAMETER if `MessageLength` is greater than `MAX_UINTN -
OFFSET_OF(EFI_MM_COMMUNICATE_HEADER, Data).`
Co-authored-by: Gowtham Manikandan <gowthammanikandan@ami.com>
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
This change adds the SafeIntLib to communication input routine to
validate the incoming MM communication buffer length before using.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
This change adds the SafeIntLib to communication input routine to
validate the incoming MM communication buffer length before using.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
This change adds the SafeIntLib to communication input routine to
validate the incoming MM communication buffer length before using.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
This change adds the SafeIntLib to communication input routine to
validate the incoming MM communication buffer length before using.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
This change adds the SafeIntLib to communication input routine to
validate the incoming MM communication message length before using.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
Implemented a TPM UEFI shell application that can be used to test the
platform's physical presence interface through the TCG2 protocol that is
installed during DXE. Functionality includes verifying active PCR banks
which are masked against platform support, event log replay, dumping the
event log, setting active PCRs, etc. Includes documentation detailing
the app and its use.
Signed-off-by: Raymond Diaz <raymonddiaz@microsoft.com>
|
|
Add EFIAPI to the functions published in BasePldmProtocolLib.h.
Signed-off-by: Abner Chang <abner.chang@amd.com>
|