Commit Graph

32840 Commits

Author SHA1 Message Date
Zhiguang Liu 6fe3137fe5 UefiCpuPkg: Change RestoreVolatileRegisters second parameter
Analysis of the current usage patterns revealed that this parameter
should consistently set to TRUE.

Specifically, the parameter was found to be False in the following
scenarios:
1. During the initial volatile register setup for the first AP wake-up
in both the PEI and DXE phases. In these instances, the volatile
registers are pre-initialized in MpInitLibInitialize(),
and manually setting them to zero does not require altering the DR
state.
2. When switching the BSP, the new BSP does not synchronize the DR.
This behavior is now adjusted to ensure the DR state is synchronized,
aligning with a more logical and expected behavior when transitioning
BSP roles.

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2024-07-24 02:47:34 +00:00
Zhiguang Liu 3912aa3d32 UefiCpuPkg: Combine the code to set ApInitDone
In previoud commit, we remove the ApInitReconfig status. Now there
are only two status ApInitConfig and ApInitDone.
Only the very first waking up AP needs to set ApInitConfig status.
Therefore, if this is not the first wake up, set ApInitDone status

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2024-07-24 02:47:34 +00:00
Zhiguang Liu 9f06e5c702 UefiCpuPkg: Remove ApInitReconfig status
ApInitReconfig status is used to indicate that when AP wakes up, AP
need to restore volatile registers from BSP and use InitSipiSipi. Since
we handle the volatile registers well, we can use WakeUpByInitSipiSipi
flag to replace ApInitReconfig. Avoid using ApInitReconfig can simplify
code.

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2024-07-24 02:47:34 +00:00
Zhiguang Liu 4a0c77be68 UefiCpuPkg: Let AP always save/restore volatile registers
When enable stack guard, APs needs separate GDTs.
In current code, APs will lose their separate GDTs when AP get disabled
and later re-enabled. This is because when re-enabling AP, AP restores
volatile registers from BSP.
This patch updates the AP management to ensure that each AP saves and
restores its own set of volatile registers to solve this issue.

Key changes include:
- APs now maintain their own volatile register space, eliminating
dependency on the BSP's register state.
- Special handling is implemented for the first AP wake-up during the
PEI and DXE phases, where the volatile registers are synchronized from
the BSP.
- When switching BSP, remove manual handling the global variable
CpuMpData->CpuData[Index].VolatileRegisters. The manually handling
in previous code is because, old BSP may not save volatile registers
after the AP procedure and new BSP's VolatileRegisters buffer may be
used by other APs. Now, since AP always save/restore volatile registers
from their own buffer, no need to do the special handling.

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2024-07-24 02:47:34 +00:00
Zhiguang Liu 7fc08c68cd UefiCpuPkg: Sync the init timer count instead of current timer count
BSP should save and sync to AP the init timer count instead of
current timer count.
Also, BSP can check the init timer count to know if the local apic
timer is enabled. Only sync the setting when it is enabled.

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2024-07-24 02:47:34 +00:00
Zhiguang Liu 7033f359a9 UefiCpuPkg: Preserve Local APIC Timer Settings During BSP Switch
This update ensures the consistency of Local APIC timer settings across
all processors when a BSP switch occurs.
The Local APIC timer is utilized in two distinct scenarios:
1. As a delay mechanism within the timer library.
2. To generate periodic timer interrupts during the DXE phase.

For scenario 1, APs can simply inherit the initial settings from the
BSP. Even the local APIC timer setting is changed by BSP later, AP
can still use the old setting. Therefore, the code to save the Local
APIC timer can be moved to MpInitLibInitialize().

For scenario 2, because normal AP doesn't enable timer interrupt, we
only need to care SwitchBsp case. It is crucial that the periodic
timer interrupts remain operational after BSP is switched. To achieve
this, the Local APIC timer settings on old BSP are now preserved and
synced to new BSP.

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2024-07-24 02:47:34 +00:00
Zhiguang Liu 76f441c57c UefiCpuPkg: Also exchange CPU_AP_DATA in SortApicId()
CPU_AP_DATA contains AP's information such as CpuHealthy and
VolatileRegisters. Exchange the whole CPU_AP_DATA buffer instead
some fields to make code more simple.

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2024-07-24 02:47:34 +00:00
Oliver Smith-Denny f5901ff2a4 ArmPkg: Remove Deprecated ArmPsciResetSystemLib
ArmPsciResetSystemLib has been deprecated since commit
b2c55e7328 in 2017. The
lib itself has not been meaningfully updated in 10 years.
This commit removes the library to complete the deprecation
process and remove confusion over which library to use for
resetting an ARM platform.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-07-23 16:04:35 +00:00
Oliver Smith-Denny da591416ee BaseTools: Move GnuNoteBti.bin to BaseTools
This patch moves GnuNoteBti.bin from ArmPkg to BaseTools as it
is used during the build by GCC. This removes an unnecessary
dependency on ArmPkg from BaseTools and keeps build related
files in BaseTools.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-07-23 15:07:41 +00:00
Oliver Smith-Denny 990bc4e562 BaseTools: Move GccLto Files to BaseTools
This moves the GccLto files from ArmPkg to BaseTools as they
are files that are only used in the build. This removes an
artificial dependency on ArmPkg from BaseTools and keeps build
related files in BaseTools.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-07-23 15:07:41 +00:00
levi.yun f96298d75c ShellPkg/Acpiview: Add HEST Parser
Add a new pareser for the Hardware Error Source Table (HEST).

The HEST table is used to describe a system's hardware error sources
to OSPM.

Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Pierre Gondois <pierre.gondois@arm.com>
Signed-off-by: levi.yun <yeoreum.yun@arm.com>
2024-07-23 11:07:42 +00:00
Dun Tan 32e7f9aa6c UefiCpuPkg: Revert "UefiCpuPkg/PiSmmCpuDxeSmm:Map SMRAM in 4K..."
This reverts commit ae59b8ba41.
The commit ae59b8ba41 was added to modify the GenSmmPageTable()
to map SMRAM in 4K page granularity. It was to urgently fix a
smm hang issue by avoiding page split in paging structures that
covers SMRAM range when SMI happens. But finally the smm hang
issue was root caused and fixed by commit 839bd17973.

Meanwhile a smm page table creation related issue was introduced
by commit ae59b8ba41:
In the function GenSmmPageTable(), the paging level for the range
outside SMRAM is depend on the Input parameter PagingMode. However,
the paging level for SMRAM range is depend on m5LevelPagingNeeded.
If the two paging levels are different, then the smm page table is
created incorrectly.

So let's revert the commit "UefiCpuPkg/PiSmmCpuDxeSmm:Map SMRAM
in 4K page granularity"

Signed-off-by: Dun Tan <dun.tan@intel.com>
2024-07-23 09:38:47 +00:00
Shenbagadevi R 46eb0ca29b ShellPkg: Changes to print Type17 in Smbiosview
Add changes to print PMIC and RCD details of Smbios Type17 in Shell
smbiosview command.

Cc: Gaoliming <gaoliming@byosoft.com.cn>
Cc: Sainadh N <sainadhn@ami.com>
Cc: Sundaresan S <sundaresans@ami.com>
Cc: Srinivasan M <srinivasanm@ami.com>
Cc: Ramesh R <rameshr@ami.com>
Cc: Karthika R <karthikar@ami.com>

Signed-off-by: Shenbagadevi R <shenbagadevir@ami.com>
Reviewed-by: Giri Mudusuru <girimudusuru@microsoft.com>
2024-07-23 08:31:44 +00:00
Oliver Smith-Denny c5ab17430b ArmPlatformPkg: PL031RealTimeClockLib: Set MMIO Memory XP
PL031RealTimeClockLib will clear EFI_MEMORY_XP if a platform
has set it for MMIO memory when it does not include that bit
in its SetMemoryAttributes call. This region is not intended
to be executed from and as such the lib should explicitly set
EFI_MEMORY_XP to this region.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-07-23 06:07:45 +00:00
Oliver Smith-Denny 1b8ca81133 ArmVirtPkg: KvmtoolRtcFdtClientLib: Set MMIO Memory NX
When setting memory attributes on its MMIO region,
KvmtoolRtcFdtClientLib will clear EFI_MEMORY_XP from
the region if a platform has it set. This MMIO region is
not intended to be executed from, so fix this by explicitly
setting EFI_MEMORY_XP on this region in the lib.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-07-23 06:07:45 +00:00
Oliver Smith-Denny e10de1cb03 ArmPkg: ArmMmuLib: Add AARCH64 Memory Attribute Update Failure Log
This adds logging in failure cases of SetMemoryAttributes. This
is useful generally as if an attribute update fails, code will
typically break, but is added in particular to make debugging
incorrect bootloader usage of the Memory Attribute Protocol. This
patch updates the AARCH64 UpdateRegionMapping.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-07-23 03:32:41 +00:00
Oliver Smith-Denny 74833ca459 ArmPkg: ArmMmuLib: Add ARM32 Memory Attribute Update Failure Logging
This adds logging in failure cases of SetMemoryAttributes. This
is useful generally as if an attribute update fails, code will
typically break, but is added in particular to make debugging
incorrect bootloader usage of the Memory Attribute Protocol. This
patch updates the ARM32 SetMemoryAttributes.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-07-23 03:32:41 +00:00
Oliver Smith-Denny 37287bf9ad ArmPkg: CpuDxe: Add Memory Attribute Protocol Logging
The memory attribute protocol is primarily used by bootloaders
and there are many released bootloaders who use the protocol
incorrectly. It is challenging to debug these situations
because the bootloaders are generally black boxes and we
silently fail on the FW side.

This patch adds logging to some common memory attribute
protocol failures in CpuDxe.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-07-23 03:32:41 +00:00
Michael Kubacki c5582e435c ArmVirtPkg: QemuVirtMemInfoPeiLib: Allow Dynamic PcdSystemMemorySize
Platforms today may use this PCD as a dynamic PCD as that is an
allowed type in its PCD declaration. From `ArmPkg.dec`:

[PcdsFixedAtBuild.common, PcdsDynamic.common, PcdsPatchableInModule.common]
  gArmTokenSpaceGuid.PcdSystemMemorySize|0|UINT64|0x0000002A

This library causes a build error if it used as a dynamic PCD since
it places the PCD in a `[FixedPcd]` section in the INF.

Other libraries do set the PCD and depend on the dynamic PCD behavior.

Since this library accesses the PCD with `PcdGet64 ()` which is
compatible with FixedAtBuild PCDs, this change moves the PCD out an
explicit `[FixedPcd]` section to resolve the following build error:

```
  INFO -  : error 3000: Building modules from source INFs, following
                        PCD use Dynamic and FixedAtBuild access method.
                        It must be corrected to use only one access
                        method.
  INFO - 	gArmTokenSpaceGuid.PcdSystemMemorySize
```

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-07-22 23:16:15 +00:00
Oliver Smith-Denny 8984fba2f2 EmbeddedPkg: Mark DMA Memory Allocations XP By Default
When allocating memory for a non-coherent DMA device, the current core
code removes the XP attribute, allowing code to execute from that
region. This is a security vulnerability and unneeded. This change
updates to mark the region as XP when allocating memory for the
non-coherent DMA device.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-07-22 21:44:47 +00:00
Michael Kubacki 469f29fe76 MdeModulePkg/VariablePolicyLib: Use wildcard character constant
Makes the `#` character used for comparison against wildcard
characters in `CHAR16` strings to be prefixed with `L` so the
character is treated as a wide character constant.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-07-22 11:52:02 +00:00
Bret Barkelew 734aaff862 ArmPlatformPkg: Update LcdHwNullLib to prevent init
Library previously returned EFI_SUCCESS which causes the platform to
continue initializing LCD HW. Should return EFI_NOT_FOUND.

Resolves TCBZ3351.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-07-21 12:00:19 +00:00
Bret Barkelew 489e4a60ea MdeModulePkg/SmiHandlerProfileInfo: Include profile SMI in profile
Includes the profiler SMI in the profile itself for completeness.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-07-18 19:22:36 +00:00
Michael Kubacki 62bf2aefc7 .pytool/Plugin: Improve plugin log messages
Improves the CI output with more actionable messages and downgrades
some errors/warnings.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-07-17 23:19:06 +00:00
Kun Qin cee9d1b16b MdeModulePkg: DxeCore: Fix Use-After-Free guard causing page fault
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2411

With Use-After-Free heap guard feature enabled, the DxeCore would blindly
attempt to "level-up" when the `GuardAllFreedPages` inspect a non-max
level table entry from the last loop. This could cause the next round of
inspection to dereference a potentially null pointer and as such causing
a page fault.

This change adds a null pointer check to prevent such case from happening.

Cc: Liming Gao <gaoliming@byosoft.com.cn>

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2024-07-17 20:56:50 +00:00
Dongyan Qian 0adc868b36 MdePkg/BaseLib: Optimize LOONGARCH64 csr usage
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4812

When the Select is out of support, use method break exception
instead of method return -1, avoid unknown errors caused by untimely
detection.

Cc: Chao Li <lichao@loongson.cn>
Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
2024-07-17 19:33:57 +00:00
Jason1 Lin 11c50d6ca1 MdeModulePkg/UfsBlockIoPei: Wait fDeviceInit Be Cleared by Devices
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4655

[Feature Description]
- UFS device would clear fDeviceInit flag once the device initialization
  is completed.
- This change is polling to check the flag is cleared or not with
  specific timeout (UFS_INIT_COMPLETION_TIMEOUT - 600ms).
- This behavior is the same as UfsPassThruDxe module.

[Notes]
- This change included as a partial of below SHA1-ID
    - 95ad8f7f6a
    - c5740f3606

Signed-off-by: Jason1 Lin <jason1.lin@intel.com>
2024-07-17 18:03:35 +00:00
levi.yun 23d3fc056d ShellPkg/Acpiview: Add EINJ Parser
Add a new parser for the Error Injection Table (EINJ).

The EINJ table provides machinism through which OSPM
can inject hardware errors to the platform without requiring platform
specific OSPM software.

Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Pierre Gondois <pierre.gondois@arm.com>
Signed-off-by: levi.yun <yeoreum.yun@arm.com>
2024-07-17 16:01:23 +00:00
levi.yun 873f35625d MdePkg/IndustryStandard: Update EINJ information according to ACPI 6.5
ACPI 6.5 specification updates EINJ revision to 0x02 and
adds new Error Injection Actions
    - EINJV2_SET_ERROR_TYPE
    - EINJV2_GET_ERROR_TYPE

This patches updates EINJ information based on ACPI 6.5 specification.
Also, add missing Error Injection Actions too.

Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Pierre Gondois <pierre.gondois@arm.com>
Signed-off-by: levi.yun <yeoreum.yun@arm.com>
2024-07-17 16:01:23 +00:00
levi.yun 5b429acec7 MdePkg/IndustryStandard: Add GET_EXECUTE_OPERATION_TIMINGS define
GET_EXECUTE_OPERATION_TIMINGS Error Injection Actions was added from
ACPI 6.1 specification.

Update Error Injection Action with the ACPI spec.

Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Pierre Gondois <pierre.gondois@arm.com>
Signed-off-by: levi.yun <yeoreum.yun@arm.com>
2024-07-17 16:01:23 +00:00
levi.yun c2d6e2e18a MdePkg/IndustryStandard: Add SET_ERROR_TYPE_WITH_ADDRESS define
SET_ERROR_TYPE_WITH_ADDRESS Error Injection Actions was added from
ACPI 5.1 specification.

Update Error Injection Action with the ACPI spec.

Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Pierre Gondois <pierre.gondois@arm.com>
Signed-off-by: levi.yun <yeoreum.yun@arm.com>
2024-07-17 16:01:23 +00:00
Shenbagadevi R dd58d1227c MdePkg: Added support for Smbios 3.7.0 Spec
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4563

As per Smbios 3.7.0 spec, added CXL 3.0 support in Type 9,
also added PMIC & RCD manufacturer ID and Revision information in Type17.

Cc: Sainadh N <sainadhn@ami.com>
Cc: Sundaresan S <sundaresans@ami.com>
Cc: Srinivasan M <srinivasanm@ami.com>
Cc: Ramesh R <rameshr@ami.com>

Signed-off-by: Shenbagadevi R <shenbagadevir@ami.com>
Reviewed-by: Gaoliming <gaoliming@byosoft.com.cn>
2024-07-17 12:46:40 +00:00
Dongyan Qian e32d24ef8c MdePkg: Define SMBIOS Protocol header according IndustryStandard
As the SMBIOS table types belong to the SMBIOS standard,
they were moved from the SMBIOS IndustryStandard into the
SMBIOS Protocol header with the EFI_-prefix.

Filling in definitions facilitates consistent use of header files:
EFI_SMBIOS_TYPE_TPM_DEVICE
EFI_SMBIOS_TYPE_PROCESSOR_ADDITIONAL_INFORMATION
EFI_SMBIOS_TYPE_FIRMWARE_INVENTORY_INFORMATION
EFI_SMBIOS_TYPE_STRING_PROPERTY_INFORMATION

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Chao Li <lichao@loongson.cn>
Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
2024-07-17 08:35:44 +00:00
Jason1 Lin b3441e0100 MdeModulePkg/Core/DxeIplPeim: Enhance Code in DxeIplFindDxeCore Function
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4653

In DxeIplFindDxeCore function, there exists different behavior between
Debug and Release built BIOS. This change is used to unify both of
the code flow and fix the potential overflow of "Instance" variable.

In this change,
  [1] Move the ASSERT_EFI_ERROR (Status) in failure to find DxeCore
      in any firmware volume condition.
  [2] Break the while-loop when not found required DxeCore.
      This would make the Instance variable not overflow in while-loop.
  [3] Add the CpuDeadLoop () in the end of the function and do not
      return since DxeCore is mandatory for the following booting
      to hand-off the PEI phase to DXE phase.
  [4] In case of the CpuDeadLoop () is de-assert by debugger,
      return the NULL pointer.

Signed-off-by: Jason1 Lin <jason1.lin@intel.com>
2024-07-17 05:46:12 +00:00
Rebecca Cran 43b7a856fa RedfishPkg: Reduce DEBUG_ERROR to DEBUG_MANAGEABILITY in various places
The Redfish drivers log messages as errors in various places when they
don't find an appropriate network interface - even when one has already
been found. Reduce those log messages to DEBUG_MANAGEABILITY to avoid
spamming the console in Release builds.

Signed-off-by: Rebecca Cran <rebecca@os.amperecomputing.com>
2024-07-17 02:02:55 +00:00
Michael Kubacki 6b4dd3625b MdeModulePkg/SmiHandlerProfileInfo: Declare correct XML encoding
The code prints wide strings, so the content should be "utf-16"
rather than "utf-8".

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-07-17 01:06:00 +00:00
Michael Kubacki 55b043732d MdePkg/UefiDebugLibDebugPortProtocol: ExitBootServicesCallback() static
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3083

Since this is a library, make the function ExitBootServicesCallback()
STATIC to prevent the likelihood that it collides with other symbols.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-07-16 23:17:04 +00:00
levi.yun 690f13fcb4 ArmPlatformPkg/Driver/PL061Gpio: Error checking for pin on release build
ASSERT_EFI_ERROR would be removed in release build.
This means it would trigger wrong behavior when invalid pin number given
to Get(), Set() and GetMode().

Adding error check routine for invalid pin number and before check the
pin number, check first other argument given to each function.

Signed-off-by: Levi Yun <yeoreum.yun@arm.com>
2024-07-16 15:19:27 +00:00
Mario Bălănică f9c373c838 EmbeddedPkg: Add option to disable EFI Memory Attribute Protocol
Introduce a driver that allows users to disable the EFI Memory Attribute
protocol through an HII setup option, in order to work around a broken
version of rhboot's shim used in some distros (e.g. CentOS Stream 9)
which incorrectly invokes the protocol and results in a Synchronous
Exception.

Default is enabled, which can also be overridden at build time by
changing `gEmbeddedTokenSpaceGuid.PcdMemoryAttributeEnabledDefault`.

It is only applicable to ARM64 and there isn't any other technical
reason for disabling this security feature.

See:
- https://github.com/microsoft/mu_silicon_arm_tiano/issues/124
- https://edk2.groups.io/g/devel/topic/99631663
- https://github.com/tianocore/edk2/pull/5840

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2024-07-16 09:54:07 +00:00
Michael Kubacki 1bb9f47739 BaseTools/CodeQL: Removed unused static function query
This query seems to produce a rate of false positives with some
common patterns in edk2 like passing function pointers for callback.

Due to the usage of `STATIC` instead of `static` particularly for
functions, this query was rarely used in the past. It is removed
here to prevent future false positives.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-07-16 04:04:33 +00:00
v-bhavanisu 8e6ba0dcae BaseTools/HostBasedUnitTestRunner: Promote Unittest error to CI fail.
Some unit tests would fail to execute or execute and not produce any output
logs. In these cases, the only output would be in the CI Log as
`UnitTest Execution Error`.

A UnitTest Execution Error should be considered the same as a unit tests
test failing.

Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
2024-07-15 16:50:00 +00:00
Leif Lindholm 5366def8d0 BaseTools: drop GeneralCheckNonAscii() from ECC
The GeneralCheckNonAscii() function is a sledgehammer rejecting any file
containing any character outside of the 7-bit ASCII encoding space, as
well as the DEL character (which seems unrelated).

This conflicts with basic stuff like correctly spelling certain proper
nouns in comments (like copyright statements), or string literals (for
example in multi-language driver binding ComponentNames).

So rip it out, to be replaced by more fine-grained checks to be added as
identified and needed.

Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-07-15 13:27:00 +00:00
Leif Lindholm 8ade6d7bd1 BaseTools: fix consistent Ecc misspelling of ASCII
Ecc concistently referred to ASCII/Ascii as ACSII/Acsii, which
bugged me to no end when trying to figure out how those tests
worked. Fix all instances.

Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-07-15 13:27:00 +00:00
Chao Li 8bb9145ad1 OvmfPkg: Add network support for LoongArch QEMU platform
Open the network option to enable networking on the LoongArch QEMU
platform.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Chao Li <lichao@loongson.cn>
2024-07-15 08:37:23 +00:00
Dhaval 91226e1eec OvmfPkg/RiscVVirt: Configure zkr PCD for Virt
Keep ZKR feature disabled by default until HW supports
it. Feature is implemented in RISC-V BaseRngLib.

Cc: Andrei Warkentin <andrei.warkentin@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>

Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
Co-authored-by: Tim Wawrzynczak <tim@rivosinc.com>
2024-07-15 04:05:56 +00:00
Dhaval b54bc983c6 MdePkg/Library: Add RISCV64 support to BaseRngLib
The ratified RISC-V crypto scalar extensions provide entropy bits via the
seed CSR, as exposed by the Zkr extension. The Zkr extension is ratified
and provides 16 bits of entropy seed when reading the SEED CSR.
Guarded by a RISCV64 Feature PCD, 64-bit random numbers can be
accumulated from the `seed` CSR. This driver is based on the driver in
the Linux kernel.

Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
Co-authored-by: Tim Wawrzynczak <tim@rivosinc.com>
2024-07-15 04:05:56 +00:00
Michael Kubacki d4dbe5e101 SecurityPkg/Tcg2Acpi: Revise debug print
This debug print may attempt to print a string without a null
terminator that can lead to a machine check.

The value printed is substituted with a source buffer to still
allow debug.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-07-12 16:04:10 +00:00
KasimX Liu 807ab61359 UefiPayloadPkg:Modify the PCD PcieResizableBar to dynamic PCD
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4808

Synchronize the use of the PCD PcieResizableBar
attribute state

Signed-off-by: KasimX Liu <kasimx.liu@intel.com>
2024-07-12 11:08:36 +00:00
Chao Li 5dc6f19b38 OvmfPkg: Fix the wild pointer in Fdt16550SerialProtHookLib
There was a wild pointer in Fdt16550SerialProtHookLib which pointed to
an unknown space, which was very wrong and has been fixed.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Chao Li <lichao@loongson.cn>
2024-07-12 10:11:17 +00:00
Chao Li b92e16d5c3 BaseTools: Remove fno-plt from LoongArch CC flags
Static relocation types have been handled in GenFw if using the PIC, and
the CC flags not enable `fno-pic` by default.
The option `fno-plt` is not necessary, as is not created by defualt in
edk2(static linking) regardless of wether `fplt` is used or not, so
remove this option from the LoongArch common CC flags.

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Chao Li <lichao@loongson.cn>
2024-07-12 10:11:17 +00:00