Off by one error in the code of NvmExpressMediaClear() causes the last
LBA to be missed when clearing the media.
This patch fixes the issue by adjusting the loop condition to ensure
that all LBAs are cleared properly.
Signed-off-by: Sean Brogan <sebrogan@microsoft.com>
CoreSetMemoryTypeInformationRange() currently calculates the bin
size needed independently from the CalculateTotalMemoryBinSizeNeeded()
function. This commit updates to use that function and remove the
duplication.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
Currently CalculateTotalMemoryBinSizeNeeded() does not take
runtime alignment granularity considerations into account. This
means that the GCD initialization code can choose resource desc
HOBs to use for the bin region that are actually too small and
fail to initialize the bins.
This fixes CalculateTotalMemoryBinSizeNeeded() to take the
alignment requirements into consideration, both for size and for
alignment of the bin address range.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
The SecPeiDxeTimerLibCpu library from the MdePkg accesses the Local APIC
timer exclusively via MMIO and explicitly asserts that x2APIC mode is
not enabled. This causes failures when vCPUs are pre-enabled in x2APIC
mode, which might be necessary for domains with more than 128 vCPUs.
So, this commit switches the TimerLib to SecPeiDxeTimerLibUefiCpu from
the UefiCpuPkg, which delegates APIC mode handling to the LocalApicLib.
OvmfXen already uses BaseXApicX2ApicLib as its LocalApicLib, which
transparently supports both xAPIC (MMIO) and x2APIC (MSR) modes.
Signed-off-by: Julian Vetter <julian.vetter@vates.tech>
GCC may emit a call to __ashlti3 for 128-bit left shifts when
compiling code that uses unsigned __int128, such as OpenSSL Curve448
code in CryptoPkg. The LoongArch64 firmware build does not link against
libgcc, so provide the helper from CompilerIntrinsicsLib.
Implement __ashlti3 using the LoongArch64 ABI: the low and high 64-bit
halves are passed in $a0 and $a1, the shift count is passed in $a2, and
the result is returned in $a0 and $a1.
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Chao Li <lichao@loongson.cn>
Signed-off-by: zhubo <zhubo@loongson.cn>
Add EArchCommonObjMemoryArrayMappedAddress to ArchCommonNameSpaceObjects.h
and a corresponding parser entry in ConfigurationManagerObjectParser.c.
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Add EArchCommonObjMemoryDeviceInfo to ArchCommonNameSpaceObjects.h
and a corresponding parser entry in ConfigurationManagerObjectParser.c.
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Add EArchCommonObjPhysicalMemoryArray to ArchCommonNameSpaceObjects.h
and a corresponding parser entry in ConfigurationManagerObjectParser.c.
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Add AllocateSmbiosRecord() to SmbiosStringTableLib to encapsulate the
SMBIOS spec Section 6.1.3 string-area termination rule. Callers pass
the fixed structure size and an optional string table; the function
appends the correct string area (two-byte double-NULL when no strings
are present, or the full string set size from
StringTableGetStringSetSize() when strings exist).
This removes the need for each generator to open-code the double-NULL
or manually compute the string area size.
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
In HttpsReceive(), the return value of TlsCommonTransmit() was not
checked. Add error handling with proper cleanup of PacketOut and
BufferOut before returning on failure.
Cc: Saloni Kasbekar <saloni.kasbekar@intel.com>
Cc: Zachary Clark-williams <zachary.clark-williams@intel.com>
Signed-off-by: abuthahirm <abuthahirm@ami.com>
In GetDns4ServerFromDhcp4(), the return value of Dhcp4->Build()
was not checked. Add error handling and a NULL check on the
resulting Token.Packet before use.
Cc: Saloni Kasbekar <saloni.kasbekar@intel.com>
Cc: Zachary Clark-williams <zachary.clark-williams@intel.com>
Signed-off-by: abuthahirm <abuthahirm@ami.com>
Add EArchCommonObjPlatformFwInfo to ArchCommonNameSpaceObjects.h and a
corresponding parser entry in ConfigurationManagerObjectParser.c.
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
NanoSecondDelay() currently has a microsecond rounding/precision.
Re-implement the function to have a nanosecond precision.
A MulDivWithRounding() function is added to allow ticks to
nanoseconds or nanoseconds to ticks conversions. This
function is now also used in GetTimeInNanoSecond().
MicroSecondDelay() now relies on NanoSecondDelay() to avoid
having a duplicated implementation.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Replace:
- EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
by:
- MdeModulePkg/Universal/Metronome/Metronome.inf
None of the ArmVirtPkg platform sets PcdMetronomeTickPeriod,
so the Metronome TickPeriod is changed from
PcdMetronomeTickPeriod == 100 (*100ns) to 1 (*100ns)
MdeModulePkg's WaitForTick() implementation also uses
NanoSecondDelay() when EmbeddedPkg only uses MicroSecondDelay(),
so the precision should be improved.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
produces the following PCDs:
- gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation
- gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
- gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration
UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.inf
relies on:
- gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation
MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
relies on:
- gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
doesn't rely on any of the above PCDs.
Remove the dependency of
- MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
over:
- OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
Note:
The module still waits for the gFdtClientProtocolGuid.
Indeed, PciHostBridgeDxe.inf depends on gEfiCpuIo2ProtocolGuid
which itself depends on gFdtClientProtocolGuid.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Move the SCSI Bus and Disk Driver components to
the common ArmVirtPkg.dsc.inc file.
No functional change.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Move the Platform Driver components to
the common ArmVirtPkg.dsc.inc file.
No functional change.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Move the Multiple Console IO components to
the common ArmVirtPkg.dsc.inc file.
No functional change.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Move the Architectural protocols components to
the common ArmVirtPkg.dsc.inc file.
No functional change.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Following patches will factorize libraries and components
that are duplicated in the platforms present in ArmVirtPkg/.
They will be factorized in ArmVirtPkg.dsc.inc.
To try to factorize components while allowing some platform
specifc inclusion/exclusion, add platform specific definitions
to identify which platform is including ArmVirtPkg.dsc.inc.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Following the EDKII Platform Description (DSC),
section 3.8 [LibraryClasses] Sections:
"""
1. If a Library Class Instance (INF) is specified in the EDK II
[Components] section (INF file's <LibraryClasses> sub-section,)
then it will be used.
2. If not specified in the [Components] section, then the Library
Class Instance that is defined in the
[LibraryClasses.$(ARCH).$(MODULE_TYPE)] section will be used.
3. If not specified in the [LibraryClasses.$(ARCH).$(MODULE_TYPE)]
section, then the Library Class Instance that
is defined in the [LibraryClasses.Common.$(MODULE_TYPE)] section
will be used.
4. If not specified in the [LibraryClasses.Common.$(MODULE_TYPE)]
section, then the Library Class Instance that is defined in the
[LibraryClasses.$(ARCH)] section will be used.
5. If not specified in the [LibraryClasses.$(ARCH)] section,
then the Library Class Instance that is defined in the
[LibraryClasses] Section or [LibraryClasses.Common] section
will be used.
6. It is an error if it has not been specified in one of the
above section
"""
Remove the library definitions that could inherit from a
more generic sections with the same definition.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Move libraries that are common to all the platforms
except ArmVirtXen in ArmVirtPkg/ to ArmVirtPkg.dsc.inc.
The concerned libraries are not used by ArmVirtXen
and should not be built for the platform.
No functional change.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Move libraries that are common to all the platforms in
ArmVirtPkg/ to ArmVirtPkg.dsc.inc.
No functional change.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
ACPI defines Injection Header Size as the length of the EINJ
injection header, not necessarily the absolute offset of the
instruction entries. Update parser validation to use the correct
entry offset calculation and accept the layout used by Linux and
existing firmware tables.
Signed-off-by: Simon Wang <simowang@nvidia.com>
[Packages] appears twice in ArmStandaloneMmCoreEntryPoint.inf, remove the
redundant one to make the file more concise.
Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
[Pcd] appears twice in PL011SerialPortLib.inf, remove the redundant one
to make the file more concise.
Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
[Sources] appears twice in BaseMemoryLibOptDxe.inf, [Sources.X64]
appears twice in StandaloneMmCoreEntryPoint.inf, remove the redundant
ones to make the files more concise.
Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
[Sources.X64] and [Sources.AARCH64] appear twice in
XenHypercallLib.inf, remove the redundant ones to make the files more
concise.
Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
[Sources.AARCH64] appears twice in RngDxe.inf, remove the redundant
one to make the file more concise.
Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
[LibraryClasses] appears twice in InSecPeiDxeTimerLibUefiCpu.inf, so
remove the redundant one to make file more concise.
Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
After allocating Private via AllocateZeroPool and successfully opening
both gEfiDevicePathProtocolGuid and gEfiPciIoProtocolGuid BY_DRIVER,
the function attempts PciIo->Attributes(EfiPciIoAttributeOperationGet)
If this call fails, the code executes return Status instead of goto Exit.
Trigger path:
NvmExpressDriverBindingStart is called.
OpenProtocol for DevicePath succeeds (opens BY_DRIVER).
OpenProtocol for PciIo succeeds (opens BY_DRIVER).
AllocateZeroPool for Private succeeds.
PciIo->Attributes(Get) returns an error.
return Status bypasses the Exit: label.
Consequence:
Memory leak of NVME_CONTROLLER_PRIVATE_DATA. Two protocols remain opened
BY_DRIVER on the controller handle, preventing other drivers from binding.
Signed-off-by: Sean Brogan <sebrogan@microsoft.com>
In GetMemoryPermissions(), PageCount from FFA_MEM_PERM_GET couldn't
be over EFI_SIZE_TO_PAGES(Length) otherwise that's bug of SPMC.
But, current ASSERT() checks PageCount > EFI_SIZE_TO_PAGES(Length)
which is reverse condition for validation.
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Check the return status from StringTableInitialize() before using the
SMBIOS Type 7 string table.
Free the string table when adding the socket designation string fails and
after publishing the final string set into the SMBIOS record.
Also free any Type 7 records already added to TableList on the common
error path before freeing TableList itself.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>