Commit Graph

32713 Commits

Author SHA1 Message Date
Gaurav Pandya ae09721a65 MdeModulePkg/DisplayEngineDxe: Support "^" and "V" key on pop-up form
BZ #4790
Support "^" and "V" key stokes on the pop-up form. Align the
implementation with key support on the regular HII form.

Signed-off-by: Gaurav Pandya <gaurav.pandya@amd.com>
2024-06-26 16:21:24 +00:00
Nhi Pham 89377ece8f MdeModulePkg/ImagePropertiesRecordLib: Reduce debug level
The presense of PdbPointer (PDB file name) is not an error. Hence, the
debug message should be categorized as VERBOSE or INFO. However, the
DEBUG_VERBOSE is more appropriate since the PDB file name is already
output by the PeCoffLoaderRelocateImageExtraAction() function with the
inline "add-symbol-file" when a platform uses the library instance
DebugPeCoffExtraActionLib.

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
2024-06-26 12:40:30 +00:00
Wenxing Hou dc002d4f2d CryptoPkg: Fix wrong comment for CryptoPkg
Fix the wrong comment.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Yi Li <yi1.li@intel.com>
Signed-off-by: Wenxing Hou <wenxing.hou@intel.com>
2024-06-26 07:48:42 +00:00
Gerd Hoffmann 78bccfec9c OvmfPkg/Sec: use cache type #defines from ArchitecturalMsr.h
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-06-26 06:04:49 +00:00
Gerd Hoffmann 71e6cc8dad UefiCpuPkg/MtrrLib.h: use cache type #defines from ArchitecturalMsr.h
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-06-26 06:04:49 +00:00
Gerd Hoffmann 5bef25dca4 MdePkg/ArchitecturalMsr.h: add #defines for MTRR cache types
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-06-26 06:04:49 +00:00
Gerd Hoffmann ce4c76e46d OvmfPkg/Sec: Setup MTRR early in the boot process.
Specifically before running lzma uncompress of the main firmware volume.
This is needed to make sure caching is enabled, otherwise the uncompress
can be extremely slow.

Adapt the ASSERTs and MTRR setup in PlatformInitLib to the changes.

Background:  Depending on virtual machine configuration kvm may uses EPT
memory types to apply guest MTRR settings.  In case MTRRs are disabled
kvm will use the uncachable memory type for all mappings.  The
vmx_get_mt_mask() function in the linux kernel handles this and can be
found here:

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/x86/kvm/vmx/vmx.c?h=v6.7.1#n7580

In most VM configurations kvm uses MTRR_TYPE_WRBACK unconditionally.  In
case the VM has a mdev device assigned that is not the case though.

Before commit e8aa4c6546 ("UefiCpuPkg/ResetVector: Cache Disable
should not be set by default in CR0") kvm also ended up using
MTRR_TYPE_WRBACK due to KVM_X86_QUIRK_CD_NW_CLEARED.  After that commit
kvm evaluates guest mtrr settings, which why setting up MTRRs early is
important now.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-06-26 06:04:49 +00:00
Wenxing Hou e21bfae345 ReadMe.rst: Add mbedtls submodule license
This patch add mbedtls submodule license.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Wenxing Hou <wenxing.hou@intel.com>
2024-06-26 04:30:21 +00:00
Leif Lindholm 0333faf50e ArmPkg: delete PcdArmArchTimerFreqInHz
PcdArmArchTimerFreqInHz lets platforms override the architectural timer
frequency, but this really isn't supported in hardware by anything lower
than EL3. And we no longer support running edk2 at EL3.

So drop this Pcd and update ArmArchTimerLib to unconditionally use
ArmGenericTimerGetTimerFreq () instead.

Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-06-26 01:51:15 +00:00
Leif Lindholm 7ee89453b5 ArmVirtPkg: drop use of PcdArmArchTimerFreqInHz
PcdArmArchTimerFreqInHz lets platforms override the architectural timer
frequency, but this really isn't supported in hardware by anything lower
than EL3. Setting it to 0 skips the override - but that is also the
default. So drop the explicit setting in ArmVirtPkg platforms in
preparation for deleting the Pcd completely.

Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-06-26 01:51:15 +00:00
Leif Lindholm a715d456de ArmPkg: drop manual ARM programming of generic timer frequency
There is a bit of legacy code in ArmArchTimerLib that attempts to program
the generic timer based on a Pcd. This was only ever done for (32-bit)
ARM in case the cpu lacked the Security Extensions (because if they were
there, Secure firmware would be expected to have configured this before
switching to Non-secure state).

We don't support operation without Secure firmware anymore, but also the
code has been incorrectly invoked only on platforms that *do* implement
the Security Extensions since December 2020 and commit 0dd0d42ab5
("ArmPkg: use helper to check for Security extensions in ArmArchTimerLib")

As a result, edk2 has been overriding any programming done by Secure
Firmware on ARM platforms. Which is wrong.

Drop this programming in preparation for deleting the Pcd completely.

Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-06-26 01:51:15 +00:00
Dongyan Qian 2fbaaa96d1 MdePkg/BaseLib: Fix an instruction write width error in LoongArch64
Cpucfg fetch is a 32-bit register, and AsmCpucfg's function
 declaration is a 32-bit address storage operation in BaseLib.h,
So, fix it by replacing stptr.d with stptr.w instrcution.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4797

Cc: Chao Li <lichao@loongson.cn>
Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
Co-authored-by: Chao Li <lichao@loongson.cn>
2024-06-26 00:52:39 +00:00
Dongyan Qian 5db0091418 UefiCpuPkg/ExceptionHandler: Fix a context error in LoongArch64
On the LoongArch platform:
 the a0 register can be used as both a function parameter and a return value.

Due to parameter EFI_SYSTEM_CONTEXT being overwritten by an invalid context address,
when calling GetExceptionType, incorrect parameter address causes memory access exception.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4796

Cc: Chao Li <lichao@loongson.cn>
Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
2024-06-26 00:52:39 +00:00
Sebastian Witt dc93ff8a55 CryptoPkg: Extend TLS handshake debug output
The error codes during TLS handshake errors are sometimes
not enough to understand the root cause of the problem.
Extending the debug output by the function and optional data helps
in some cases.

Signed-off-by: Sebastian Witt <sebastian.witt@siemens.com>
2024-06-25 23:18:36 +00:00
Sebastian Witt 84d8eb08e1 CryptoPkg: Add SNI extension to TLS ClientHello
Webservers hosting multiple websites require the TLS SNI
(Server Name Indication) in the ClientHello to know which certificate
to return.
The current TLS code does not include the server name in the
ClientHello handshake, which leads to failed HTTPS boots when the
server does not return the correct certificate.

This sets the host name for SNI in TlsSetVerifyHost which receives the
host name also for verification against the certificates.

Signed-off-by: Sebastian Witt <sebastian.witt@siemens.com>
2024-06-25 21:46:50 +00:00
Tobin Feldman-Fitzthum 10b4bb8d6d AmdSev: Halt on failed blob allocation
A malicious host may be able to undermine the fw_cfg
interface such that loading a blob fails.

In this case rather than continuing to the next boot
option, the blob verifier should halt.

For non-confidential guests, the error should be non-fatal.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@linux.ibm.com>
2024-06-25 15:27:42 +00:00
Tobin Feldman-Fitzthum 56059941ec AmdSev: Rework Blob Verifier
The Blob Verifier checks boot artifacts against a hash table
injected by the hypervisor and measured by hardware.

Update the Blob Verifier to enter a dead loop if the artifacts
do not match.

The verifier still returns ACCESS_DENIED in some cases, but this
is considered non-fatal. These non-fatal cases occur when the
artifact cannot be verified because the hashes table makes no
claims about the artifiact (e.g. if the hashes table is not present
or if there is no entry for the blob in question).
Since the hash table is reflected in the launch measurement,
it is okay to continue the boot in these cases.

If the hash table does contain expected hash values, the boot cannot
continue if the provided blobs do not match.
In these cases we enter a dead loop to make sure no guest can boot
with a TCB that does not reflect the launch measurement.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@linux.ibm.com>
2024-06-25 15:27:42 +00:00
Mike Maslenkin be38c01da2 OvmfPkg: refine TdTcg2Dxe
This patch removes unused references to ResetNotification code.
ACPI table generation refined by removing excessive CopyMem() call.

Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
2024-06-21 06:43:23 +00:00
xieyuanh d512bd3129 UefiCpuPkg: Correct the count of different type of Cache.
This patch fixes an error in calculating cache sizes for cores from
different Dies. The original code incorrectly cleared cache sizes for
different core types during intermediate calculation steps, leading to
mistakes in counting duplicate entries. This patch adds a check for
cache size to distinguish between different cache types.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: xieyuanh <yuanhao.xie@intel.com>
2024-06-21 02:44:34 +00:00
Rebecca Cran 57a890fd03 MdePkg: Check if compiler has __has_builtin before trying to use it
When building AArch64 code, cpp gets run with the `-undef` flag which on
Fedora 40 with gcc version 14.1.1 20240607 (Red Hat 14.1.1-5) causes
__has_builtin to be undefined. When running the check for
__builtin_unreachable in Base.h it causes an error
"missing binary operator before token "("".

Check that we have __has_builtin before trying to use it.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-06-20 01:55:03 +00:00
Ard Biesheuvel 95e220e95d MdePkg/ArmLib: Drop obsolete library declarations
Drop obsolete library declarations that are no longer (and should not
be) implemented in EDK2 or UEFI, given that they are specific to the
secure world.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-06-19 17:25:11 +00:00
Ard Biesheuvel e76be772aa ArmPkg/ArmLib ArmMmuLib: Drop support for EL3/MON execution
Drop logic from the ARM architectural support libraries that can only
execute in EL3 on AArch64 or Monitor mode on 32-bit ARM. While early
32-bit ports (and even some early 64-bit code) included some monitor
logic in EDK2, UEFI per the spec runs in non-secure execution contexts
only, and secure monitor and other secure world duties are usually
delegated to TF-A (Trusted Firmware for the A profile).

Since there are no longer users of this code in EDK2 or the
edk2-platforms tree, let's remove it from the core support libraries.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-06-19 17:25:11 +00:00
Dhaval 4d4f569924 MdeModulePkg: Avoid efi memory allocation for SP memory
HBM/CXL memory systems are treated as special purpose memories. In many
cases it is desirable not to use special purpose memory for regular edk2
usages as these memories (HBm/CXL) are either meant for special purposes
or are less reliable to be used. Until such memory systems evolve and
we have better clarity from UEFI spec, avoid using them for edk2
boot memory purposes.

Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Oliver Smith-Denny <osde@linux.microsoft.com>
Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
Co-authored-by: Tim Wawrzynczak <tim@rivosinc.com>
2024-06-19 13:12:40 +08:00
Nhi Pham 26a30abdd0 MdeModulePkg/DxeCapsuleLibFmp: Fix compilation error
The commit "MdeModulePkg/DxeCapsuleLibFmp: Fix crash if no ESRT is
found" leads to a compilation error in
MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.inf. The issue
occurs because the variable mDxeCapsuleLibReadyToBootEvent which is
declared as extern does not exist, while it is defined in
DxeCapsuleRuntime.c, a file not included in DxeCapsuleLib.inf. This
patch is to fix this by moving the variable defintion to DxeCapsuleLib.c
and declare it as extern in DxeCapsuleRuntime.c.

Reported-by: Gua Guo <gua.guo@intel.com>
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
2024-06-19 08:53:42 +08:00
Ard Biesheuvel c1d1910be6 OvmfPkg/QemuVideoDxe: add feature PCD to remap framebuffer W/C
Some platforms (such as SBSA-QEMU on recent builds of the emulator) only
tolerate misaligned accesses to normal memory, and raise alignment
faults on such accesses to device memory, which is the default for PCIe
MMIO BARs.

When emulating a PCIe graphics controller, the framebuffer is typically
exposed via a MMIO BAR, while the disposition of the region is closer to
memory (no side effects on reads or writes, except for the changing
picture on the screen; direct random access to any pixel in the image).

In order to permit the use of such controllers on platforms that only
tolerate these types of accesses for normal memory, it is necessary to
remap the memory. Use the DXE services to set the desired capabilities
and attributes.

Hide this behavior under a feature PCD so only platforms that really
need it can enable it. (OVMF on x86 has no need for this)

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-06-18 20:52:56 +00:00
Corvin Köhne ffce430d2b OvmfPkg/BhyvePkg: honor FwCfg when setting the bootorder
Bhyve has added support for the bootorder FwCfg file some time ago
[1][2].  This FwCfg file is currently ignored by the OVMF and has no
effect. Copy the relevant code from Qemu to Bhyve to make it usable.

[1] 6632a0a4e3
[2] 480bef9481

Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com>
2024-06-18 19:18:07 +00:00
Chao Li bfda27ddc8 Maintainers.txt: Update maintainers and reviewers for OvmfPkg/LoongArchVirt
Update Maintainers.txt to add Chao Li and Bibo Mao as LoongArchVirt Qemu
virt-machine platform maintainers, add Xianglai Li as the reviewer.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Xianglai Li <lixianglai@loongson.cn>
Signed-off-by: Chao Li <lichao@loongson.cn>
2024-06-18 15:02:15 +00:00
Chao Li 7a1739d896 OvmfPkg/PlatformCI: Add CI coverage for LoongArchVirtQemu
Add support for building LoongArchVirtQemu platform in CI

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584

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-06-18 15:02:15 +00:00
Chao Li c2d6efaef9 OvmfPkg/LoongArchVirt: Add self introduction file
Add self introduction file for LoongArch virtual machine.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Dongyan Qian <qiandongyan@loongson.cn>
Signed-off-by: Chao Li <lichao@loongson.cn>
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
2024-06-18 15:02:15 +00:00
Chao Li d6dcf621df OvmfPkg/LoongArchVirt: Add build file
Add infrastructure files to build edk2 for LoongArch QEMU virtual
machine.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Dongyan Qian <qiandongyan@loongson.cn>
Signed-off-by: Chao Li <lichao@loongson.cn>
Co-authored-by: Xianglai Li <lixianglai@loongson.cn>
Co-authored-by: Bibo Mao <maobibo@loongson.cn>
2024-06-18 15:02:15 +00:00
Chao Li e5e2cf48a9 OvmfPkg/LoongArchVirt: Support PEI phase
Platfrom PEI module for LoongArch platfrom initialization.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Dongyan Qian <qiandongyan@loongson.cn>
Signed-off-by: Chao Li <lichao@loongson.cn>
Co-authored-by: Xianglai Li <lixianglai@loongson.cn>
Co-authored-by: Bibo Mao <maobibo@loongson.cn>
2024-06-18 15:02:15 +00:00
Chao Li 9912434785 OvmfPkg/LoongArchVirt: Support SEC phase
Add SEC code for LoongArch virtual machine.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Dongyan Qian <qiandongyan@loongson.cn>
Signed-off-by: Chao Li <lichao@loongson.cn>
Co-authored-by: Xianglai Li <lixianglai@loongson.cn>
Co-authored-by: Bibo Mao <maobibo@loongson.cn>
2024-06-18 15:02:15 +00:00
Chao Li c63d90085b OvmfPkg/LoongArchVirt: Add reset system library
This library provides interface related to restart and shudown the
LoongArch64 virtual machine.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Dongyan Qian <qiandongyan@loongson.cn>
Signed-off-by: Chao Li <lichao@loongson.cn>
Co-authored-by: Xianglai Li <lixianglai@loongson.cn>
Co-authored-by: Bibo Mao <maobibo@loongson.cn>
2024-06-18 15:02:15 +00:00
Chao Li 79835e08f5 OvmfPkg/LoongArchVirt: Add real time clock library
This library is provides real time clock for LoongArch virtual machine.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Dongyan Qian <qiandongyan@loongson.cn>
Signed-off-by: Chao Li <lichao@loongson.cn>
Co-authored-by: Baoqi Zhang <zhangbaoqi@loongson.cn>
Co-authored-by: Xianglai Li <lixianglai@loongson.cn>
2024-06-18 15:02:15 +00:00
Chao Li 74433f66b1 OvmfPkg: Add a new GUID called gRtcRegisterBaseAddressHobGuid
Added a new GUID use for store the RTC register base address if the
platform can not uses the dynamic PCD in PEI stage.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584

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-06-18 15:02:15 +00:00
Chao Li ab4b1f113d OvmfPkg/LoongArchVirt: Add the early serial port output library
Add a early serial port output library into LoongArchVirt that named
EarlyFdtSerialPortLib16550, this library is referenced from
MdeModulePkg.

This library is used in the PEI phase. Since the serial port address can
not be saved in memory of the LoongArch QEMU virtual machine in the PEI
phase, the serial prot base address will be obtained from the FDT before
each output.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Dongyan Qian <qiandongyan@loongson.cn>
Signed-off-by: Chao Li <lichao@loongson.cn>
Co-authored-by: Xianglai Li <lixianglai@loongson.cn>
2024-06-18 15:02:15 +00:00
Chao Li 05f74f1ca7 OvmfPkg/LoongArchVirt: Add serial port hook library
Add a serial port hook library in LoongArchVirt named
Fdt16550SerialProtHookLib, this library is referenced from ArmVirtPkg.

LoongArch QEMU virtual machine uses register of LOONGARCH_CSR_KS1 to
transfer serial port base addres from the PEI phase to the DXE phase.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Dongyan Qian <qiandongyan@loongson.cn>
Signed-off-by: Chao Li <lichao@loongson.cn>
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2024-06-18 15:02:15 +00:00
Chao Li ace279c036 OvmfPkg/LoongArchVirt: Add CpuMmuInit library
Added a new library for LoongArch, it use for initialization the CPU
MMU, it consumed the CpuMmuLib.

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>
Co-authored-by: Baoqi Zhang <zhangbaoqi@loongson.cn>
Co-authored-by: Dongyan Qian <qiandongyan@loongson.cn>
Co-authored-by: Xianglai Li <lixianglai@loongson.cn>
Co-authored-by: Bibo Mao <maobibo@loongson.cn>
2024-06-18 15:02:15 +00:00
Chao Li e3e27f22d2 OvmfPkg/LoongArchVirt: Add stable timer driver
Add a CPU timer driver named StableTimerDxe, which proviedes
EFI_TIMER_ARCH_PROTOCOL for LoongArch.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Dongyan Qian <qiandongyan@loongson.cn>
Signed-off-by: Chao Li <lichao@loongson.cn>
Co-authored-by: Baoqi Zhang <zhangbaoqi@loongson.cn>
2024-06-18 15:02:15 +00:00
Rebecca Cran b0c5781671 .devcontainer: bump Fedora version to 39
Fedora 35 is EOL. Use Fedora 39 instead: don't use 40 for now since it
comes with gcc 14 which still has some problems building edk2.

Fix the git command to disable the safe directory checks.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-06-18 11:32:59 +00:00
Zhihao Li 176b9d41f8 MdeModulePkg/Core/Pei: Install MigrateTempRamPpi
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4716

Migrate FSP-T/M binary from temporary RAM to permanent RAM before NEM
tear down. Tcg module will use permanent address of FSP-T/M for
measurement. In MdeModulePkg, PeiCore installs mMigrateTempRamPpi if
PcdMigrateTemporaryRamFirmwareVolumes is True before NEM tear down and
after permanent memory ready.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Duggapu Chinni B <chinni.b.duggapu@intel.com>
Cc: Chen Gang C <gang.c.chen@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>

Signed-off-by: Zhihao Li <zhihao.li@intel.com>
2024-06-18 07:23:19 +00:00
Paul Grimes 537a81ae81 MdePkg/Include: Update AMD specification references
Update AMD sepcification references (code comments) as part of a refactor of
MSR definitions and SEV-SNP related defines, which aims to remove
family-specific references (filename) as these defines are common to all
modern EPYC Processors.

Signed-off-by: Paul Grimes <paul.grimes@amd.com>
2024-06-18 05:45:15 +00:00
Paul Grimes a9def1ed9d MdePkg/Include: Update Msr.h header guard define
Update the Msr.h eader guard to comply with latest edk2 coding guidelines. This
change is part of a refactor of MSR definitions and SEV-SNP related defines,
which aims to remove family-specific references (filename) as these defines are
common to all modern EPYC Processors.

Signed-off-by: Paul Grimes <paul.grimes@amd.com>
2024-06-18 05:45:15 +00:00
Paul Grimes 17424fae4f MdePkg/Include: Remove deprecated AMD SEV-SNP header file
Delete Fam17Msr.h as part of a refactor of MSR definitions and SEV-SNP related
defines, which aims to remove family-specific references (filename) as these
defines are common to all modern EPYC Processors.

Signed-off-by: Paul Grimes <paul.grimes@amd.com>
2024-06-18 05:45:15 +00:00
Paul Grimes 55c3ecde32 UefiCpuPkg/MpInitLib: Update references to SEV-SNP header file
Update reference to SevSnpMsr.h as part of a refactor of MSR definitions and
SEV-SNP related defines. Remove family-specific references (filename) as these
defines are common to all modern EPYC Processors.

Signed-off-by: Paul Grimes <paul.grimes@amd.com>
2024-06-18 05:45:15 +00:00
Paul Grimes d40c71ef3f MdePkg/Include: Update reference to SEV-SNP header file
Update reference to SevSnpMsr.h as part of a refactor of MSR definitions and
SEV-SNP related defines. Remove family-specific references (filename) as these
defines are common to all modern EPYC Processors.

Signed-off-by: Paul Grimes <paul.grimes@amd.com>
2024-06-18 05:45:15 +00:00
Paul Grimes 6eaeef2c9b MdePkg/Include: Add AMD SEV-SNP header file
Add SevSnpMsr.h as part of a refactor of MSR definitions and SEV-SNP related
defines, which aims to remove family-specific references (filename) as these
defines are common to all modern EPYC Processors.

Signed-off-by: Paul Grimes <paul.grimes@amd.com>
2024-06-18 05:45:15 +00:00
Dun Tan 128513afcd MdeModulePkg:Add global variable mVariableRtCacheInfo
Add global variable mVariableRtCacheInfo to save the
content in gEdkiiVariableRuntimeCacheInfoHobGuid. With
this new global variable, 7 global variables can be
removed.

Signed-off-by: Dun Tan <dun.tan@intel.com>
2024-06-17 13:42:43 +00:00
Dun Tan 081df0ec20 MdeModulePkg: Refine InitVariableCache()
Refine the code logic in InitVariableCache().
In this commit, three times calling of
InitVariableCache() for different type cache are
merged into one calling. This commit is to make
the code looks cleaner and doesn't change any
code functionality.

Signed-off-by: Dun Tan <dun.tan@intel.com>
2024-06-17 13:42:43 +00:00
Dun Tan 92974e3d18 MdeModulePkg:Remove the usage of PcdEnableVariableRuntimeCache
Remove the usage of PcdEnableVariableRuntimeCache. We can
use the existence of gEdkiiVariableRuntimeCacheInfoHobGuid
to indicate if variable runtime cache is enabled or not.

Signed-off-by: Dun Tan <dun.tan@intel.com>
2024-06-17 13:42:43 +00:00