Age | Commit message (Collapse) | Author | Files | Lines |
|
ArmFfaRxTxMap.c is built by both ArmFfaPeiLib and ArmFfaDxeLib.
ArmFfaSecRxTxMap.c is built by ArmFfaSecLib.
ArmFfaStandaloneMmRxTxMap.c is built by ArmFfaStandaloneMm*Lib.
The files depend on `MemoryAllocationLib` APIs such as
`AllocateAlignedPages()`. This change adds `MemoryAllocationLib` to
those library INF files.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
|
|
ArmFfaCommon.c is built by both ArmFfaStandaloneMmCoreLib and
ArmFfaStandaloneMmLib. It links against HobLiib APIs such as
`GetFirstHob()`. Right now, the symbols fail to link:
```
lld-link: error: undefined symbol: GetFirstHob
ArmFfaStandaloneMmCoreLib.lib(ArmFfaCommon.obj)
```
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
|
|
commit b534cabbdac4 ("ArmFfaLib: Add Rx/Tx support for Stmm secure partition")
makes ArmFfaStandlaoneMm(Core)Lib map Rx/Tx buffer in its constructor.
This makes a failure of loading StandaloneMm in legacy platform
which doesn't implements Rx/Tx buffer related API since it doesn't need to.
StandaloneMm could be only service provider not cosumer in some platform
where doesn't need to map RxTx buffer.
Therefore, Considier EFI_UNSUPPORTED return in ArmFfaStandaloneMmLib's
constructor.
Fixes: b534cabbdac4 ("ArmFfaLib: Add Rx/Tx support for Stmm secure partition")
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
When ArmFfaLibDirectMsgReq(2) is preempted, caller of these functions
should resume it works via ArmFfaLibRun() and the secure partition
will be return with FFA_DIRECT_MSG_RESP(2) with return arguments.
However, since ArmFfaLibRun() gets its return in its stack variable,
So caller of ArmFfaLibRun() doesn't get the return arguments from
secure partition.
To resolve this, add output parameter to ArmFfaLibRun() to
receive return arguments.
Continuous-integration-options: PatchCheck.ignore-multi-package
Fixes: 5d1b38dd07c4 ("ArmPkg: Add ArmFfaLib used in Dxe driver")
Reported-by: Mariam Elshakfy <Mariam.Elshakfy@arm.com>
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
RealTimeClockLib is an architectural implementation that is not
restricted to the embedded segment or any platform in particular.
So the header has been moved to MdeModulePkg.
And the package has been added to the relevant INF files.
Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
|
|
Adding to the previous commit deprecating
EFI_UNICODE_COLLATION_PROTOCOL_GUID in MdeModulePkg.
Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
|
|
Since the variable mLanguageString is not used at all, remove it
to make code clean.
Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
|
|
Signed-off-by: Yang Gang <yanggang@byosoft.com.cn>
|
|
Commit 9224a2b91764ab17b2c1dbc9fdcb012eaed62da6
adds support for larger terminal dimensions; however, the ANSI control
sequences to manipulate the terminal cursor are not built to accomodate
terminal dimensions that are three digits long.
For example, suppose we want to move the cursor 163 columns to the
right. The required control sequence would be `^[[163C`; however, the
existing code will create a control sequence of `^[[@3C` due to trying
to add 16 to the character '0' instead of either 1 or 6.
This fix adds a third digit to the sequence templates for moving the
cursor forward, moving it backwards, and setting the cursor position.
Signed-off-by: Jack Little <jack.tay.little@hpe.com>
|
|
When set to TRUE, bit EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED of
OsIndications is set.
At the moment EDK never sets this bit (there is only definition with no
uses), maybe nothing actually checks its value. Whatever the reason is,
it seems like a good idea to make setting it possible.
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
|
|
When a BIOS implementation splits the PEIMs in multiple firmware volumes and
the FVs are reported to PEI Core by different PEIMs at different time,
it is hard to conclude the exact FV dispatch order.
The change updates the existing PEI dispatch logic to print the GUID of the
firmware volume and the FFS file which contains a nested FV.
It helps developers to match the FV being dispatched to the FV defined in
FDF file.
Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
|
|
Fix TestString() to be compatible with wide/narrow string in
GraphicsConsole driver. If WIDE_CHAR or NARROW_CHAR is hit in
TestString function, ignore it since OutputString function will
correctly handle it.
Fix OutputString() to skip wide/narrow char in TerminalDxe. Because
they are not displayable in terminal emulation tool, ingore to
output if they are hit in OutputString function.
Signed-off-by: Gao Qihang <gaoqihang@loongson.cn>
|
|
According to UEFI Spec, only Bit0...6 is valid in mode attribute, other
bits are undefined and must be 0. So attribute with EFI_WIDE_ATTRIBUTE
is unacceptable as EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetAttribute() input
parameter. In current PrintInternal function, wide character removed
WIDE_CHAR, and is used as EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.OutputString()
input parameter. So, wide character is mistakenly be treated as narrow
character.
Because EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.OutputString() can handle unicode
string with NARROW_CHAR and WIDE_CHAR, we can directly invoke
OutputString() with whole unicode string in PrintInternal function instead
of separated wide/narrow string. And then, the logic of computing unicode
string width is also simplified.
Signed-off-by: Gao Qihang <gaoqihang@loongson.cn>
|
|
If string default is set to zero in vfr file and VfrCompile may not
found the invalid operation, assert is trigged. This patch will check
whether StringId is 0 to avoid assert.
Cc: Chao Li <lichao@loongson.cn>
Signed-off-by: Gao Qihang <gaoqihang@loongson.cn>
|
|
Clarify wording of the comment before the callback in XhcMonitorAsyncRequests.
Signed-off-by: Sherry Fan <sherryfan@microsoft.com>
|
|
As noted in the comment above the callback invocation,
the URB's callback may free the URB, so any
operations, including updates, must occur before the callback.
Signed-off-by: Sherry Fan <sherryfan@microsoft.com>
|
|
`XhcFreeUrb` attempts to unmap `Urb->DataMap` after
`FreePool(Urb->Data)` has already been called in some cases, causing a
use after free. Change the ordering so `Data` is freed after `Unmap`and
only freed when appropriate.
Signed-off-by: Sherry Fan <sherryfan@microsoft.com>
|
|
Add SkipHceReenable and SkipLinkStartup flags to
the EDKII_UFS_HC_PLATFORM_PROTOCOL to support
using a UFS controller that has already been
initialized.
Signed-off-by: Bob Morgan <bobm@nvidia.com>
|
|
This PPI is no longer used - the EHCI and XHCI host controller PEIMs
expose PEI_USB2_HOST_CONTROLLER_PPI instead.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
There are two versions of the USB host controller PPI, and only the
newer one, called PEI_USB2_HOST_CONTROLLER_PPI, is actually produced by
the EHCI and XHCI host controller PEIMs in EDK2. (The other PPI was only
produced by UhciPei which has been removed)
So remove all the conditionally executed code based on the distinction
between the two PPIs, and only support the newer one.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
Remove the UHCI PEI module, which is unused (in edk2-platforms) and
obsolete. It also implements an older version of the USB host controller
PPI, which can be dropped from EDK2 entirely once this driver is gone.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
|
|
Running Codeql on the MdeModulePkg\Bus\Usb drivers results in
codeql errors stemming for the following two checks.
- cpp/comparison-with-wider-type
- cpp/overflow-buffer
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
Co-authored-by: Taylor Beebe <tabeebe@microsoft.com>
Co-authored-by: pohanch <125842322+pohanch@users.noreply.github.com>
Co-authored-by: kenlautner <85201046+kenlautner@users.noreply.github.com>
Co-authored-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Co-authored-by: Sean Brogan <sean.brogan@microsoft.com>
Co-authored-by: Aaron <aaronpop@microsoft>
|
|
Running Codeql on MdeModulePkg/Universal/Variable drivers results
in codeql errors stemming for the following two checks.
- cpp/comparison-with-wider-type
- cpp/overflow-buffer
- cpp/missing-null-test
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
Co-authored-by: Taylor Beebe <tabeebe@microsoft.com>
Co-authored-by: pohanch <125842322+pohanch@users.noreply.github.com>
Co-authored-by: kenlautner <85201046+kenlautner@users.noreply.github.com>
Co-authored-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Co-authored-by: Sean Brogan <sean.brogan@microsoft.com>
Co-authored-by: Aaron <aaronpop@microsoft>
|
|
Added Google Mock test support for SecurityManagementLib
Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
|
|
The ramdisk is modelled as an NVDIMM which have a naturally higher
alignment than 4K. Operating systems may wish to map NVDIMMs using large
pages, so force the allocation alignment to 2MB.
This change was tested using HTTP ramdisk boot, targeting a flat windows
image.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
|
|
Move PcdSerialRegisterBase from [PcdsFixedAtBuild, PcdsPatchableInModule]
section to [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic,
PcdsDynamicEx] section to enable dynamic configuration.
Signed-off-by: Pranav V V <pranav.v.v@intel.com>
|
|
The various cores all attempt to print the EfiFileName when
loading/dispatching drivers, but they are not unified on
approach. This commit ensures they are using the same buffer
size and the loop parsing variables are unsigned, as we should
not have a negative index.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
|
|
Today, DXE/PEI/SMM Core's image loaders only print driver load messages
if debug code is enabled. However, these are some of the most
important prints in the codebase: on a given system even if you
have nothing else to debug with, you can see the last driver
executed.
Debug code blocks are used to skip logic that only exists for
debug purposes and wastes time on a release build. However, the
logic to print a line and determine the filename from the PDB
is not extensive and provides critical information, so it is
inappropriate to wrap in a debug code section.
Platforms can still choose to disable logging at DEBUG_INFO/DEBUG_LOAD
and will not see the error messages.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
|
|
Running Codeql on MdeModulePkg/Universal/Console drivers results
in codeql errors stemming for the following checks.
- cpp/comparison-with-wider-type
- cpp/missing-null-test
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
Co-authored-by: Taylor Beebe <tabeebe@microsoft.com>
Co-authored-by: pohanch <125842322+pohanch@users.noreply.github.com>
Co-authored-by: kenlautner <85201046+kenlautner@users.noreply.github.com>
Co-authored-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Co-authored-by: Sean Brogan <sean.brogan@microsoft.com>
Co-authored-by: Aaron <aaronpop@microsoft>
|
|
Running Codeql on MdeModulePkg/Universal/FvSimpleFileSystemDxe drivers results
in codeql errors stemming from missing null tests.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
Co-authored-by: Taylor Beebe <tabeebe@microsoft.com>
Co-authored-by: pohanch <125842322+pohanch@users.noreply.github.com>
Co-authored-by: kenlautner <85201046+kenlautner@users.noreply.github.com>
Co-authored-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Co-authored-by: Sean Brogan <sean.brogan@microsoft.com>
Co-authored-by: Aaron <aaronpop@microsoft>
|
|
Change type of buffer address type in ArmFfaRxTxBufferInfo
so that reduce the type casting.
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
Some of code for handling Rx/Tx buffer is duplicate.
This patch commonize some of duplication routine used in
Rx/Tx buffer related functions.
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
To use Arm-FFA intereface in PeilessSec, implments
ArmFfaSecLib used by PeilessSec.
For example, communicate with TPM service using CRB over ARM-FFA
(via Tpm2DeviceLibFfa), PeilessSec need to use Arm-FFA interface.
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
The PcdFfaTxRxPageCount can never be changed dynamically
and is configured at build time to specify the size of
the Rx/Tx buffers.
Therefore, make PcdFfaTxRxPageCount a PcdsFixedAtBuild PCD.
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
The commit e15fe066036da
("MdeModulePkg/Library: make ArmFfaPeiLib available early PEIM stage")
uses ArmFfaPeiLib in the early PEIM stage.
However, the Rx/Tx buffer allocated in the early PEIM stage uses
temporary memory. This results in a memory leak when the temporary
memory's heap is relocated to permanent memory.
For example, if the Rx/Tx buffer memory is allocated at 0x20006000
in temporary memory, and if offset between temporary memory and
permanent is 0x40000000, then:
- Once permanent memory installed the temporary memory at 0x20006000
is migrated to 0x60006000.
- However, ArmFfaPeiLib allocates new Rx/Tx buffer without freeing
the migrated Rx/Tx buffers, i.e. the buffers at 0x60006000.
This results in a memory leak as the migrated Rx/Tx buffer area is
lost.
To address this memory leak, use the MemoryAllocationHob's name, so
that the migrated memory area will be reused as Rx/Tx buffer.
This patch also includes rename ArmFfaRxTxStmm.c to
ArmFfaStandaloneMmRxTxMap.c to keep the file name convention in
ArmFfaLib with ArmFfa{Phase}{...}.c
Fixes: e15fe066036da ("MdeModulePkg/Library: ...")
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Continuous-integration-options: PatchCheck.ignore-multi-package
|
|
During USB device enumeration, issuing a hot reset on a port is skipped if
there is a reset change status already detected on the port. This can
happen when enumerating devices after a host controller soft reset (which
drives a hot reset down the ports).
However, in certain cases an attached device may not be responsive even if
the reset change and connection status bits are set. For e.g., according
to xHCI spec section 4.19.5.1 the port reset change bits can be set when
a hot reset driven on the port transitions to a warm reset and completes
with errors. For such instances it is worthwhile to force a hot reset
during enumeration to try and recover unresponsive devices.
During enumeration check whether querying port status returns
EFI_DEVICE_ERROR and try a port reset if there is a device attached to
the port.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
|
|
Update the comments for PcdDxeNxMemoryProtectionPolicy
which contained old information.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
Co-authored-by: Oliver Smith-Denny <osde@microsoft.com>
|
|
Currently, if the DebugClearMemory bit is set in the
PcdDebugPropertyMask, CoreConvertPagesEx will attempt to write
a pattern to the pages being freed. However, it does not check
that the page is writeable, which will cause a page fault if not.
Furthermore, if NX protections are not enabled, the core does not
ensure that any freed pages are RW, which is the state expected
when they are allocated next. If they are not RW, the allocating
driver will crash trying to use them.
This patch updates the page freeing code to query the memory
attributes protocol, if present, for the attributes. If this call
fails or the attributes are not RW at a minimum, the core leaks
the memory (returning success to the caller). If the memory
attribute protocol is not present (either because a platform doesn't
produce it or it is before the protocol has been produced, the core
continues with freeing memory. This is either before the CPU Arch
protocol is available (so drivers can't change memory attributes) or
otherwise matches existing behavior. This was deemed the best
approach to let memory that can't be guaranteed to be RW leak
instead of letting a driver crash when allocating it. It was deemed
less brittle to simply leak the memory instead of attempting to
change the attributes.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
|
|
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>
|
|
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>
|
|
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>
|
|
Currently DxeIpl attempts to set page 0 to all 0's and to
create a memory allocation HOB for it. However, DxeIpl will
also unmap the page when mapping page tables and if null
detection is not enabled, DxeCore will set the page to 0,
regardless of allocation status.
Because no consumers are using the memory allocation HOB for
page 0, drop it. Instead, ensure that PeiCore and DxeCore do
not allow allocating page 0; it should always be reserved for
null pointer detection. It also complicates the story for
platforms that are attempting to audit the system and ensure that
no modules are using page 0. With these memory allocation HOBs
in place, it is difficult to tell if it is simply DxeIpl who
has allocated the memory or another module.
This commit drops the memory allocation HOB publishing and ensures
that DxeCore and PeiCore do not allocate page 0. DxeCore already
will not allocate page 0 to callers of AllocatePages who call with
a type other than AllocateAddress, this just changes so that
AllocateAddress cannot allocate at page 0 (which if null detection
is enabled will cause a page fault). PeiCore does not have
AllocateAddress and so this ensures standard allocations do not
receive page 0.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
|
|
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
|
|
Running Codeql on MdeModulePkg/Universal/SectionExtractionPei drivers results
in codeql errors stemming from missing null tests.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
Co-authored-by: Taylor Beebe <tabeebe@microsoft.com>
Co-authored-by: pohanch <125842322+pohanch@users.noreply.github.com>
Co-authored-by: kenlautner <85201046+kenlautner@users.noreply.github.com>
Co-authored-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Co-authored-by: Sean Brogan <sean.brogan@microsoft.com>
Co-authored-by: Aaron <aaronpop@microsoft>
|
|
Running Codeql on MdeModulePkg/Universal/SmmCommunicationBuffer drivers results
in codeql errors stemming from missing null tests.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
Co-authored-by: Taylor Beebe <tabeebe@microsoft.com>
Co-authored-by: pohanch <125842322+pohanch@users.noreply.github.com>
Co-authored-by: kenlautner <85201046+kenlautner@users.noreply.github.com>
Co-authored-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Co-authored-by: Sean Brogan <sean.brogan@microsoft.com>
Co-authored-by: Aaron <aaronpop@microsoft>
|
|
Add validation for FtwWorkSpaceHeader within the
WorkSpaceRefresh() function to address an issue where the
variable store cannot recover from the FTW spare block if the
variable store is erased or corrupted during an FTW write or
reclaim operation.
Signed-off-by: Wenbo Hou <wenbo.hou@microsoft.com>
|
|
As the MM cores begin to support MM Communicate v3, this update moves the
driver to communicate to MM agent through MM Communicate v3 PPI.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
As MM cores start to support MM communciate v3. This change moves the
variable driver to use MM communicate v3 if it is available, otherwise the
driver will fallback to v2 to keep the same functionality.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
This change adds a check to ensure the incoming buffer is correctly using
MM communicate v3 header before dereferencing the content.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
FFA is a framework that supports various protocols built on top. i.e.
memory protocol, which is nothing that can be done through existing
interfaces.
Instead of requiring protocol authors to check conduit PCD in every
implementation, exposing the ArmCallFfa is a unified way to allow other
protocols to leverage FFA interfaces.
Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|