summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-12-20UefiPayloadPkg: Specifies SmmCpuSyncLib instanceJiaxin Wu1-0/+1
This patch is to specify SmmCpuSyncLib instance for UefiPayloadPkg. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Sean Rhodes <sean@starlabs.systems> Cc: James Lu <james.lu@intel.com> Cc: Gua Guo <gua.guo@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zeng Star <star.zeng@intel.com> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Gua Guo <gua.guo@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2023-12-20OvmfPkg: Specifies SmmCpuSyncLib instanceJiaxin Wu4-0/+4
This patch is to specify SmmCpuSyncLib instance for OvmfPkg. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zeng Star <star.zeng@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2023-12-20UefiCpuPkg: Implements SmmCpuSyncLib library instanceJiaxin Wu3-0/+688
Implements SmmCpuSyncLib Library instance. The instance refers the existing SMM CPU driver (PiSmmCpuDxeSmm) sync implementation and behavior: 1.Abstract Counter and Run semaphores into SmmCpuSyncCtx. 2.Abstract CPU arrival count operation to SmmCpuSyncGetArrivedCpuCount(), SmmCpuSyncCheckInCpu(), SmmCpuSyncCheckOutCpu(), SmmCpuSyncLockDoor(). Implementation is aligned with existing SMM CPU driver. 3. Abstract SMM CPU Sync flow to: BSP: SmmCpuSyncReleaseOneAp --> AP: SmmCpuSyncWaitForBsp BSP: SmmCpuSyncWaitForAPs <-- AP: SmmCpuSyncReleaseBsp Semaphores release & wait during sync flow is same as existing SMM CPU driver. 4.Same operation to Counter and Run semaphores by leverage the atomic compare exchange. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zeng Star <star.zeng@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2023-12-20MdePkg/MdeLibs.dsc.inc: Add SafeIntLib instanceJiaxin Wu1-0/+1
This patch is to add SafeIntLib in MdeLibs.dsc.inc Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zeng Star <star.zeng@intel.com> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-12-20UefiCpuPkg: Adds SmmCpuSyncLib library classJiaxin Wu2-0/+293
Intel is planning to provide different SMM CPU Sync implementation along with some specific registers to improve the SMI performance, hence need SmmCpuSyncLib Library for Intel. This patch is to: 1.Adds SmmCpuSyncLib Library class in UefiCpuPkg.dec. 2.Adds SmmCpuSyncLib.h function declaration header file. For the new SmmCpuSyncLib, it provides 3 sets of APIs: 1. ContextInit/ContextDeinit/ContextReset: ContextInit() is called in driver's entrypoint to allocate and initialize the SMM CPU Sync context. ContextDeinit() is called in driver's unload function to deinitialize SMM CPU Sync context. ContextReset() is called before CPU exist SMI, which allows CPU to check into the next SMI from this point. 2. GetArrivedCpuCount/CheckInCpu/CheckOutCpu/LockDoor: When SMI happens, all processors including BSP enter to SMM mode by calling CheckInCpu(). The elected BSP calls LockDoor() so that CheckInCpu() will return the error code after that. CheckOutCpu() can be called in error handling flow for the CPU who calls CheckInCpu() earlier. GetArrivedCpuCount() returns the number of checked-in CPUs. 3. WaitForAPs/ReleaseOneAp/WaitForBsp/ReleaseBsp WaitForAPs() & ReleaseOneAp() are called from BSP to wait the number of APs and release one specific AP. WaitForBsp() & ReleaseBsp() are called from APs to wait and release BSP. The 4 APIs are used to synchronize the running flow among BSP and APs. BSP and AP Sync flow can be easy understand as below: BSP: ReleaseOneAp --> AP: WaitForBsp BSP: WaitForAPs <-- AP: ReleaseBsp Cc: Laszlo Ersek <lersek@redhat.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zeng Star <star.zeng@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2023-12-20UefiCpuPkg/PiSmmCpuDxeSmm: Optimize Semaphore Sync between BSP and APJiaxin Wu1-14/+58
This patch is to define 3 new functions (WaitForBsp & ReleaseBsp & ReleaseOneAp) used for the semaphore sync between BSP & AP. With the change, BSP and AP Sync flow will be easy understand as below: BSP: ReleaseAllAPs or ReleaseOneAp --> AP: WaitForBsp BSP: WaitForAllAPs <-- AP: ReleaseBsp Cc: Laszlo Ersek <lersek@redhat.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zeng Star <star.zeng@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2023-12-19MdeModulePkg/UefiBootManagerLib: Signal ReadyToBoot on platform recoveryNeal Gompa1-0/+11
Currently, the ReadyToBoot event is only signaled when a formal Boot Manager option is executed (in BmBoot.c -> EfiBootManagerBoot ()). However, the introduction of Platform Recovery in UEFI 2.5 makes it necessary to signal ReadyToBoot when a Platform Recovery boot loader runs because otherwise it may lead to the execution of a boot loader that has similar requirements to a regular one that is not launched as a Boot Manager option. This is especially critical to ensuring that the graphical console is actually usable during platform recovery, as some platforms do rely on the ConsolePrefDxe driver, which only performs console initialization after ReadyToBoot is triggered. This patch fixes that behavior by calling EfiSignalEventReadyToBoot () in EfiBootManagerProcessLoadOption () when invoking platform recovery, which is the function that sets up the platform recovery boot process. The expected behavior has been clarified in the UEFI 2.10 specification to explicitly indicate this behavior is required for correct operation. This is a rebased version of the patch originally written by Pete Batard. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2831 Co-authored-by: Pete Batard <pete@akeo.ie> Signed-off-by: Neal Gompa <ngompa@fedoraproject.org> Reviewed-by: Jeremy Linton <jeremy.linton@arm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2023-12-19OvmfPkg/RiscVVirt: Override for RISC-V CPU FeaturesDhaval1-0/+1
This PCD provides a way for platform to override any HW features that are default enabled by previous stages of FW (like OpenSBI). For the case where previous/prev stage has disabled the feature, this override is not useful and its usage should be avoided. 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: Sunil V L <sunilvl@ventanamicro.com> Cc: Andrei Warkentin <andrei.warkentin@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Pedro Falcato <pedro.falcato@gmail.com> Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Andrei Warkentin <andrei.warkentin@...> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
2023-12-19MdePkg: Utilize Cache Management Operations Implementation For RISC-VDhaval Sharma4-28/+165
Use newly defined cache management operations for RISC-V where possible It builds up on the support added for RISC-V cache management instructions in BaseLib. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Pedro Falcato <pedro.falcato@gmail.com> Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Pedro Falcato <pedro.falcato@gmail.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
2023-12-19MdePkg: Implement RISC-V Cache Management OperationsDhaval4-1/+70
Implement Cache Management Operations (CMO) defined by RISC-V spec https://github.com/riscv/riscv-CMOs. Notes: 1. CMO only supports block based Operations. Meaning cache flush/invd/clean Operations are not available for the entire range. In that case we fallback on fence.i instructions. 2. Operations are implemented using Opcodes to make them compiler independent. binutils 2.39+ compilers support CMO instructions. Test: 1. Ensured correct instructions are refelecting in asm 2. Qemu implements basic support for CMO operations in that it allwos instructions without exceptions. Verified it works properly in that sense. 3. SG2042Pkg implements CMO-like instructions. It was verified that CpuFlushCpuDataCache works fine. This more of less confirms that framework is alright. 4. TODO: Once Silicon is available with exact instructions, we will further verify this. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Sunil V L <sunilvl@ventanamicro.com> Cc: Daniel Schaefer <git@danielschaefer.me> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Pedro Falcato <pedro.falcato@gmail.com> Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Sunil V L <sunilvl@...> Reviewed-by: Jingyu Li <jingyu.li01@...>
2023-12-19MdePkg: Rename Cache Management Function To Clarify Fence Based OpDhaval3-8/+8
There are different ways to manage cache on RISC-V Processors. One way is to use fence instruction. Another way is to use CPU specific cache management operation instructions ratified as per RISC-V ISA specifications to be introduced in future patches. Current method is fence instruction based, rename the function accordingly to add that clarity. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Sunil V L <sunilvl@ventanamicro.com> Cc: Daniel Schaefer <git@danielschaefer.me> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Pedro Falcato <pedro.falcato@gmail.com> Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2023-12-19MdePkg: Move RISC-V Cache Management Declarations Into BaseLibDhaval Sharma2-20/+20
The declarations for cache Management functions belong to BaseLib instead of instance source file. This helps with further restructuring of cache management code for RISC-V. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Pedro Falcato <pedro.falcato@gmail.com> Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2023-12-19StandaloneMmPkg/Core: Fix the failure to find uncompressed inner FVWei6 Xu1-0/+22
The MmCoreFfsFindMmDriver only checks for encapsulated compressed FVs. When an inner FV is uncompressed, StandaloneMmCore will miss the FV and all the MM drivers in the FV will not be dispatched. Add checks for uncompressed inner FV to fix this issue. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2023-12-19StandaloneMmPkg/Core: Fix issue that offset calculation might be wrongWei6 Xu1-14/+15
MmCoreFfsFindMmDriver() assumes FileHeader is EFI_FFS_FILE_HEADER. If FileHeader is an EFI_FFS_FILE_HEADER2, 'FileHeader + 1' will get a wrong section address. Use FfsFindSection to get the section directly, instead of 'FileHeader + 1' to avoid this issue. MmCoreFfsFindMmDriver() also assumes section is EFI_COMMON_SECTION_HEADER. If Section is EFI_COMMON_SECTION_HEADER2, 'Section + 1' will get a wrong wrong InnerFvHeader adress. Add section head detection and calculate the address accordingly. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2023-12-19StandaloneMmPkg/Core: Fix potential memory leak issueWei6 Xu1-9/+22
In MmCoreFfsFindMmDriver(), - ScratchBuffer is not freed in the error return path that DstBuffer page allocation fails. Free ScratchBuffer before return with error. - If the decoded buffer is identical to the data in InputSection, ExtractGuidedSectionDecode() will change the value of DstBuffer rather than changing the contents of the buffer that DstBuffer points at, in which case freeing DstBuffer is wrong. Introduce a local variable AllocatedDstBuffer for buffer free, free AllocatedDstBuffer immediately if it is not used. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2023-12-19StandaloneMmPkg/Core: Limit FwVol encapsulation section recursionWei6 Xu6-13/+49
MmCoreFfsFindMmDriver() is called recursively for encapsulation sections. Currently this recursion is not limited. Introduce a new PCD (fixed-at-build, or patchable-in-module), and make MmCoreFfsFindMmDriver() track the section nesting depth against that PCD. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2023-12-18ShellPkg: Tidy for code readabilityDaniel Nguyen1-19/+24
Use error handling instead of success handling. Less indented logic is easier to read. Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Daniel Nguyen <daniel.nguyen@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
2023-12-14FatPkg/FatPei: Check array offset before useMichael Kubacki1-1/+1
Move the range check before array access to enforce the bounds as expected. Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-12-14ArmPkg/DebugPeCoffExtraActionLib: Drop RVCT and Cygwin supportArd Biesheuvel1-69/+31
The DebugPeCoffExtraActionLib implemention in ArmPkg contains some cruft that dates back to the original RVCT based ARM port, and support for RVCT was dropped a while ago. Also drop the handling of Cygwin specific paths, which is highly unlikely to be still depended upon by anyone. Tweak the logic so that only two versions of the DEBUG() invocations remain: one for __GNUC__ when PdbPointer is set, and the fallback that just prints the image address and the address of the entrypoint. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2023-12-14CloudHv: Add CI for CloudHv on AArch64Jianyong Wu2-0/+45
Add the long lost CI for CloudHv on AArch64. As CloudHv CI works nearly the same way with other VMMs like KvmTool, thus we can easily create its CI configuration based on KvmTool. Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Jianyong Wu <jianyong.wu@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
2023-12-13RedfishPkg/RedfishDicovery: Remedy Redfish service discovery flowAbner Chang1-70/+39
Remedy Redfish service discovery flow changes made in commit 8736b8fd. The above fix creates the dependency with SMBIOS 42h record, which has a problem as SMBIOS 42h may not be created when RedfishDiscovery.Supported() is invoked even all of the required protocols are ready on the ControllerHandle. We can’t guarantee SMBIOS 42 structure will be always created before ConnectController(). USB NIC maybe detected late and it means PlatformHostInterfaceBmcUsbNicLib can populate SMBIOS 42h information late as well. Calling to RedfishServiceGetNetworkInterface with the previous fix may result in no network interface for BMC-exposed NIC as SMBIOS 42h is not ready yet.This is the first issue. Second, to skip the network interface when NetworkInterfaceGetSubnetInfo() returns a failure also has problem, as the NIC may be configured via RestEx->Configure(). This happens after the Host interface is discovered, as at this moment we have the sufficient network information to configure BMC-exposed NIC. Base on Redfish spec in 31.1.5.2, “EFI Redfish Client may provide selection UI of network interfaces for Redfish service discovery.", This means edk2 Redfish client gets all network interfaces through RedfishServiceGetNetworkInterface and choose the desired network interface at its discretion for Redfish service. So the fix here is: 1. In BuildNetworkInterface(), we don’t skip any network interface. In RedfishServiceGetNetworkInterface, we don’t skip any network interface even the subnet information is not retrieved. We will still return all of network interfaces to client. 2. In RedfishServiceAcquireService for EFI_REDFISH_RISCOVER_HOST_INTERFACE case, we don’t skip any network interface even the subnet information is not retrieved. 3. Added some more debug information. Note: The subnet information is used for the scenario the system is managed by a centralized Redfish service (not on BMC), says the multiple Redfish computer system instances. As it mentions in 31.1.5.2, Redfish client they may have to know the subnet information so they can know the network domain the NIC is connected. There may have multiple subnets in the corporation network environment. So the subnet information provides client an idea when they choose the network interface, so does VLAN ID. Signed-off-by: Abner Chang <abner.chang@amd.com> Cc: Nickle Wang <nicklew@nvidia.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Mike Maslenkin <mike.maslenkin@gmail.com> Reviewed-by: Igor Kulchytskyy <igork@ami.com> Acked-by: Mike Maslenkin <mike.maslenkin@gmail.com>
2023-12-12ArmVirtQemu: Allow EFI memory attributes protocol to be disabledArd Biesheuvel3-0/+73
Shim's PE loader uses the EFI memory attributes protocol in a way that results in an immediate crash when invoking the loaded image, unless the base and size of its executable segment are both aligned to 4k. If this is not the case, it will strip the memory allocation of its executable permissions, but fail to add them back for the executable region, resulting in non-executable code. Unfortunately, the PE loader does not even bother invoking the protocol in this case (as it notices the misalignment), making it very hard for system firmware to work around this by attempting to infer the intent of the caller. So let's introduce a QEMU command line option to indicate that the protocol should not be exposed at all, and a PCD to set the default for this option when it is omitted. Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://gitlab.com/qemu-project/qemu/-/issues/1990 Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2023-12-12UefiCpuPkg: Avoid assuming only one smmbasehobDun Tan1-32/+149
Modify the gSmmBaseHobGuid consumption code to remove the asuumption that there is only one gSmmBaseHobGuid. If the CPU number is big enough, there will be more than one SmmBaseHob in the HOB list. Signed-off-by: Dun Tan <dun.tan@intel.com> Cc: Eric Dong <eric.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com>
2023-12-12UefiCpuPkg: Cache core type in MpInfo2 HOBDun Tan2-2/+59
Cache core type in MpInfo2 HOB by CpuMpPei module. Signed-off-by: Dun Tan <dun.tan@intel.com> Cc: Eric Dong <eric.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com>
2023-12-12UefiCpuPkg: Add a new field in MpInfo2 HOBDun Tan1-0/+2
Add new field CoreType in gMpInformationHobGuid2 Signed-off-by: Dun Tan <dun.tan@intel.com> Cc: Eric Dong <eric.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com>
2023-12-12UefiCpuPkg: Consume MpInfo2Hob in PiSmmCpuDxeDun Tan3-51/+168
Consume MpInfo2Hob in PiSmmCpuDxe driver to get NumberOfProcessors, MaxNumberOfCpus and EFI_PROCESSOR_INFORMATION for all CPU from the MpInformation2 HOB. This can avoid calling MP service. Signed-off-by: Dun Tan <dun.tan@intel.com> Cc: Eric Dong <eric.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com>
2023-12-12UefiCpuPkg: Build MpInfo2HOB in CpuMpPeiDun Tan3-2/+96
Build MpInfo2HOB in CpuMpPei module so that later PiSmmCpuDxe or other StandaloneMm module can consume the HOB. Since there might be more one gMpInformationHobGuid2 in HOB list, CpuMpPei create a gMpInformationHobGuid2 with 0 value NumberOfProcessors field in the end of the process to indicate it's the last MP_INFORMATION2_HOB. Signed-off-by: Dun Tan <dun.tan@intel.com> Cc: Eric Dong <eric.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com>
2023-12-12UefiCpuPkg: Create gMpInformationHobGuid2 in UefiCpuPkgDun Tan2-0/+59
Create gMpInformationHobGuid2 in UefiCpuPkg. Currently, there is a gMpInformationHobGuid defined, created and consumed only in StandaloneMmPkg. The HOB contains the EFI_PROCESSOR_INFORMATION structure for each CPU and the number of processors. This is the same as the information that PiSmmCpuDxeSmm uses MpService Protocol to get. This new gMpInformationHobGuid2 also contains the NumberOfProcessors and the EFI_PROCESSOR_INFORMATION for each CPU. Also the HOB is extended to support the case that the maximum HOB length is not enough for all CPU. So there might be more than one HOB instance in the HOB list. Each HOB describes the corresponding CPU index range. The plan is to create gMpInformationHob2Guid in CpuMpPei module(implemented in next commit). Then PiSmmCpuDxeSmm and other MM_STANDALONE modules can consume the hob. This can avoid calling MpService Protocol in PiSmmCpuDxeSmm. Also the issue that one gMpInformationHobGuid might be not enough when CPU number is 1~2000 or bigger can be solved. Signed-off-by: Dun Tan <dun.tan@intel.com> Cc: Eric Dong <eric.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com>
2023-12-11MdePkg:simplify Fifo API in BaseIoLibIntrinsicDun Tan4-259/+222
Simplify IoRead/WriteFifo implement by repeatedly calling IoRead/Write in the C code. This can avoid calling assembly code to use string I/O instructions. With this change Ia32/IoFifo.nasm and X64/IoFifo.nasm can be removed. Then the source files for IA32 and X64 are the same. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Dun Tan <dun.tan@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Acked-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
2023-12-11MdePkg: Change IoLibFifo.c to IoLibFifoCc.cDun Tan2-2/+2
Change IoLibFifo.c to IoLibFifoCc.c since the file is for Tdx and SEV in BaseIoLibIntrinsicSev. It's also to distinguish with a new incoming IoLibFifo.c for BaseIoLibIntrinsic. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Dun Tan <dun.tan@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Acked-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
2023-12-11ArmVirtPkg: Sync debug level comments in ArmVirt.dsc.incRebecca Cran1-20/+22
Update the debug level comments in ArmVirt.dsc.inc to sync with MdePkg/Include/Library/DebugLib.h. Signed-off-by: Rebecca Cran <rebecca@os.amperecomputing.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2023-12-11MdePkg: Update MdePkg.uni with manageability debug levelRebecca Cran1-0/+2
Update MdePkg.uni with the manageability debug level. Signed-off-by: Rebecca Cran <rebecca@os.amperecomputing.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-12-11MdePkg: Add manageability debug level to PcdFixedDebugPrintErrorLevelRebecca Cran1-0/+1
Update MdePkg.dec to add the manageability debug level to PcdFixedDebugPrintErrorLevel. Signed-off-by: Rebecca Cran <rebecca@os.amperecomputing.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-12-11MdePkg: Improve wording of manageability debug level commentRebecca Cran1-2/+2
Improve the wording of the comment explaining the DEBUG_MANAGEABILITY debug level. Signed-off-by: Rebecca Cran <rebecca@os.amperecomputing.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-12-11BaseTools: fixing FMMT ShrinkFv issueYuwei Chen2-4/+8
1. FvLength not change issue; 2. FileSystemGuid align with File Size; Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2023-12-11BaseTools: FMMT support ELF UPLD parserYuwei Chen6-5/+383
FMMT add new function to support the .elf file parsing. Using '-v' option, the UPLD info will be printed out. ''' - UNIVERSAL_PAYLOAD_INFO - 4 bytes align (BOOLEAN) - Identifier - SpecRevision - Attribute - Revision - Capability - ProducerId - ImageId UPLD Buffer ''' Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2023-12-11BaseTools: FMMT replace output file is not generated successfullyYuwei Chen2-5/+18
For replace function, when target Ffs and new ffs are with same size, the output file can not be generated successfully. This patch fixes this issue. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2023-12-11BaseTools: FMMT replace new free space fixing in replaceYuwei Chen1-1/+1
In FMMT replace function, when newffs size <= targetffs size, the new free space is calculated wrong as loss the pad data delta size. That will cause invalid binary generated. This patch fixes this issue. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2023-12-11StandaloneMmPkg/StandaloneMmHobLib: Remove HOB creationNhi Pham1-120/+51
According to the discussion in "StandaloneMmPkg: Fix HOB space and heap space conflicted issue" [1], Standalone MM modules should be HOB consumers where HOB is read-only. Therefore, this patch removes the supported functions for HOB creation in the StandaloneMmHobLib. [1] https://edk2.groups.io/g/devel/message/108333 Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Oliver Smith-Denny <osde@linux.microsoft.com> Signed-off-by: Nhi Pham <nhiphambka@gmail.com>
2023-12-09MdePkg: Add UEFI v2.10 ISA memory type definitionManickamX Srinivasan1-0/+15
New memory type as defined in UEFI standard v2.10 Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: T V Krishnamoorthy <krishnamoorthy.t.v@intel.com> Signed-off-by: ManickamX Srinivasan <manickamx.srinivasan@intel.com> Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-12-08MdePkg: Define the DevicePath argument from LoadImage as optionalManickamX Srinivasan1-1/+1
Update the EFI LoadImage API in accordance with the UEFI v2.10 specification. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: T V Krishnamoorthy <krishnamoorthy.t.v@intel.com> Signed-off-by: ManickamX Srinivasan <manickamx.srinivasan@intel.com> Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-12-08Maintainers.txt: add Aaron Young as MptScsi and PvScsi reviewerLaszlo Ersek1-0/+5
I asked Aaron if he'd be willing to take the "R" role for the MptScsi and PvScsi drivers in OvmfPkg, given their low maintenance needs and previous commit 1774a44ad91d ("Maintainers.txt: Remove MptScsi and PvScsi reviewers", 2022-07-28). Designate Aaron as reviewer for those drivers, with many thanks. Cc: Aaron Young <aaron.young@oracle.com> Cc: Andrew Fish <afish@apple.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20231121140145.11151-1-lersek@redhat.com> Reviewed-by: Aaron Young <aaron.young@oracle.com>
2023-12-08Maintainers.txt: add Laszlo Ersek as a UefiCpuPkg maintainerLaszlo Ersek1-0/+1
I intend to assist with the maintenance of the following files and directories: UefiCpuPkg/CpuDxe/ UefiCpuPkg/CpuIo2Dxe/ UefiCpuPkg/CpuIo2Smm/CpuIo2Mm.c UefiCpuPkg/CpuIo2Smm/CpuIo2Mm.h UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf UefiCpuPkg/CpuMpPei/ UefiCpuPkg/CpuS3DataDxe/ UefiCpuPkg/Include/AcpiCpuData.h UefiCpuPkg/Include/CpuHotPlugData.h UefiCpuPkg/Include/Library/CpuPageTableLib.h UefiCpuPkg/Include/Library/LocalApicLib.h UefiCpuPkg/Include/Library/MmSaveStateLib.h UefiCpuPkg/Include/Library/MpInitLib.h UefiCpuPkg/Include/Library/SmmCpuFeaturesLib.h UefiCpuPkg/Include/Library/SmmCpuPlatformHookLib.h UefiCpuPkg/Include/Protocol/SmmCpuService.h UefiCpuPkg/Include/Register/ UefiCpuPkg/Include/StuffRsbNasm.inc UefiCpuPkg/Library/BaseXApicX2ApicLib/ UefiCpuPkg/Library/CpuExceptionHandlerLib/ UefiCpuPkg/Library/CpuPageTableLib/CpuPageTable.h UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableParse.c UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf UefiCpuPkg/Library/MpInitLib/DxeMpLib.c UefiCpuPkg/Library/MpInitLib/Ia32/CreatePageTable.c UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm UefiCpuPkg/Library/MpInitLib/MpEqu.inc UefiCpuPkg/Library/MpInitLib/MpHandOff.h UefiCpuPkg/Library/MpInitLib/MpLib.c UefiCpuPkg/Library/MpInitLib/MpLib.h UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf UefiCpuPkg/Library/MpInitLib/PeiMpLib.c UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.inf UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/ UefiCpuPkg/Library/SmmCpuRendezvousLib/ UefiCpuPkg/PiSmmCpuDxeSmm/ UefiCpuPkg/UefiCpuPkg.dec UefiCpuPkg/UefiCpuPkg.dsc UefiCpuPkg/Universal/Acpi/S3Resume2Pei/ Cc: Andrew Fish <afish@apple.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20231116215058.8113-4-lersek@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-08Maintainers.txt: add Laszlo Ersek as an OvmfPkg maintainerLaszlo Ersek1-0/+1
I intend to assist with the maintenance of the following files and directories: OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf OvmfPkg/AcpiPlatformDxe/EntryPoint.c OvmfPkg/CpuHotplugSmm/ OvmfPkg/CpuS3DataDxe/ OvmfPkg/EnrollDefaultKeys/ OvmfPkg/Fdt/FdtPciHostBridgeLib/ OvmfPkg/Fdt/FdtPciPcdProducerLib/ OvmfPkg/Fdt/HighMemDxe/ OvmfPkg/Fdt/VirtioFdtDxe/ OvmfPkg/Include/Dsc/NetworkComponents.dsc.inc OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc OvmfPkg/Include/Dsc/OvmfTpmComponentsDxe.dsc.inc OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc OvmfPkg/Include/Dsc/OvmfTpmPcds.dsc.inc OvmfPkg/Include/Dsc/OvmfTpmPcdsHii.dsc.inc OvmfPkg/Include/Dsc/OvmfTpmSecurityStub.dsc.inc OvmfPkg/Include/Fdf/FvmainCompactScratchEnd.fdf.inc OvmfPkg/Include/Fdf/OvmfPkgDefines.fdf.inc OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc OvmfPkg/Include/Fdf/VarStore.fdf.inc OvmfPkg/Include/Guid/MicrosoftVendor.h OvmfPkg/Include/Guid/OvmfPkKek1AppPrefix.h OvmfPkg/Include/Guid/OvmfPlatformConfig.h OvmfPkg/Include/Guid/QemuKernelLoaderFsMedia.h OvmfPkg/Include/Guid/QemuRamfb.h OvmfPkg/Include/Guid/RootBridgesConnectedEventGroup.h OvmfPkg/Include/Guid/VirtioMmioTransport.h OvmfPkg/Include/IndustryStandard/E820.h OvmfPkg/Include/IndustryStandard/I440FxPiix4.h OvmfPkg/Include/IndustryStandard/LegacyVgaBios.h OvmfPkg/Include/IndustryStandard/LinuxBzimage.h OvmfPkg/Include/IndustryStandard/Q35MchIch9.h OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h OvmfPkg/Include/IndustryStandard/QemuFwCfg.h OvmfPkg/Include/IndustryStandard/QemuLoader.h OvmfPkg/Include/IndustryStandard/QemuPciBridgeCapabilities.h OvmfPkg/Include/IndustryStandard/QemuTpm.h OvmfPkg/Include/IndustryStandard/Virtio.h OvmfPkg/Include/IndustryStandard/Virtio095.h OvmfPkg/Include/IndustryStandard/Virtio095Net.h OvmfPkg/Include/IndustryStandard/Virtio10.h OvmfPkg/Include/IndustryStandard/Virtio10Net.h OvmfPkg/Include/IndustryStandard/VirtioBlk.h OvmfPkg/Include/IndustryStandard/VirtioFs.h OvmfPkg/Include/IndustryStandard/VirtioGpu.h OvmfPkg/Include/IndustryStandard/VirtioNet.h OvmfPkg/Include/IndustryStandard/VirtioScsi.h OvmfPkg/Include/IndustryStandard/VirtioSerial.h OvmfPkg/Include/Library/AcpiPlatformLib.h OvmfPkg/Include/Library/NestedInterruptTplLib.h OvmfPkg/Include/Library/PciCapLib.h OvmfPkg/Include/Library/PciCapPciIoLib.h OvmfPkg/Include/Library/PciCapPciSegmentLib.h OvmfPkg/Include/Library/PciHostBridgeUtilityLib.h OvmfPkg/Include/Library/PlatformBmPrintScLib.h OvmfPkg/Include/Library/PlatformInitLib.h OvmfPkg/Include/Library/QemuBootOrderLib.h OvmfPkg/Include/Library/QemuFwCfgLib.h OvmfPkg/Include/Library/QemuFwCfgS3Lib.h OvmfPkg/Include/Library/QemuFwCfgSimpleParserLib.h OvmfPkg/Include/Library/QemuLoadImageLib.h OvmfPkg/Include/Library/VirtNorFlashPlatformLib.h OvmfPkg/Include/Library/VirtioLib.h OvmfPkg/Include/Library/VirtioMmioDeviceLib.h OvmfPkg/Include/OvmfPlatforms.h OvmfPkg/Include/Pcd/CpuHotEjectData.h OvmfPkg/Include/Protocol/OvmfLoadedX86LinuxKernel.h OvmfPkg/Include/Protocol/VirtioDevice.h OvmfPkg/IncompatiblePciDeviceSupportDxe/ OvmfPkg/Library/AcpiPlatformLib/ OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.h OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.inf OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf OvmfPkg/Library/BaseCachingPciExpressLib/ OvmfPkg/Library/BasePciCapLib/ OvmfPkg/Library/BasePciCapPciSegmentLib/ OvmfPkg/Library/DxePciLibI440FxQ35/ OvmfPkg/Library/GenericQemuLoadImageLib/ OvmfPkg/Library/LockBoxLib/ OvmfPkg/Library/NestedInterruptTplLib/ OvmfPkg/Library/PciHostBridgeLib/ OvmfPkg/Library/PciHostBridgeUtilityLib/ OvmfPkg/Library/PlatformBmPrintScLib/ OvmfPkg/Library/PlatformBootManagerLib/ OvmfPkg/Library/PlatformDebugLibIoPort/DebugIoPortQemu.c OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.c OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.h OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetectRom.c OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf OvmfPkg/Library/PlatformInitLib/Cmos.c OvmfPkg/Library/PlatformInitLib/MemDetect.c OvmfPkg/Library/PlatformInitLib/Platform.c OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf OvmfPkg/Library/PlatformSecureLib/ OvmfPkg/Library/PxeBcPcdProducerLib/ OvmfPkg/Library/QemuBootOrderLib/ OvmfPkg/Library/QemuFwCfgLib/ OvmfPkg/Library/QemuFwCfgS3Lib/ OvmfPkg/Library/QemuFwCfgSimpleParserLib/ OvmfPkg/Library/ResetSystemLib/BaseResetShutdown.c OvmfPkg/Library/ResetSystemLib/BaseResetSystemLib.inf OvmfPkg/Library/ResetSystemLib/DxeResetShutdown.c OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c OvmfPkg/Library/SmbiosVersionLib/ OvmfPkg/Library/SmmCpuFeaturesLib/ OvmfPkg/Library/SmmCpuPlatformHookLibQemu/ OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/ OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/ OvmfPkg/Library/TlsAuthConfigLib/ OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/ OvmfPkg/Library/UefiPciCapPciIoLib/ OvmfPkg/Library/VirtioLib/ OvmfPkg/Library/VirtioMmioDeviceLib/ OvmfPkg/Library/X86QemuLoadImageLib/ OvmfPkg/License.txt OvmfPkg/LinuxInitrdDynamicShellCommand/ OvmfPkg/LocalApicTimerDxe/ OvmfPkg/OvmfPkg.ci.yaml OvmfPkg/OvmfPkg.dec OvmfPkg/OvmfPkgIa32.dsc OvmfPkg/OvmfPkgIa32.fdf OvmfPkg/OvmfPkgIa32X64.dsc OvmfPkg/OvmfPkgIa32X64.fdf OvmfPkg/OvmfPkgX64.dsc OvmfPkg/OvmfPkgX64.fdf OvmfPkg/PciHotPlugInitDxe/ OvmfPkg/PlatformCI/ OvmfPkg/PlatformDxe/ OvmfPkg/PlatformHasAcpiDtDxe/ OvmfPkg/PlatformPei/ClearCache.c OvmfPkg/PlatformPei/FeatureControl.c OvmfPkg/PlatformPei/Fv.c OvmfPkg/PlatformPei/MemDetect.c OvmfPkg/PlatformPei/MemTypeInfo.c OvmfPkg/PlatformPei/Platform.c OvmfPkg/PlatformPei/Platform.h OvmfPkg/PlatformPei/PlatformPei.inf OvmfPkg/QemuFlashFvbServicesRuntimeDxe/ OvmfPkg/QemuKernelLoaderFsDxe/ OvmfPkg/QemuRamfbDxe/ OvmfPkg/QemuVideoDxe/ OvmfPkg/README OvmfPkg/Sec/Ia32/SecEntry.nasm OvmfPkg/Sec/SecMain.c OvmfPkg/Sec/SecMain.inf OvmfPkg/Sec/X64/SecEntry.nasm OvmfPkg/SioBusDxe/ OvmfPkg/SmbiosPlatformDxe/EntryPoint.c OvmfPkg/SmbiosPlatformDxe/Qemu.c OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf OvmfPkg/SmmAccess/ OvmfPkg/SmmControl2Dxe/ OvmfPkg/Tcg/Tcg2Config/ OvmfPkg/VirtNorFlashDxe/ OvmfPkg/Virtio10Dxe/ OvmfPkg/VirtioBlkDxe/ OvmfPkg/VirtioFsDxe/ OvmfPkg/VirtioGpuDxe/ OvmfPkg/VirtioNetDxe/ OvmfPkg/VirtioPciDeviceDxe/ OvmfPkg/VirtioRngDxe/ OvmfPkg/VirtioScsiDxe/ Cc: Andrew Fish <afish@apple.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20231116215058.8113-3-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-08Maintainers.txt: add Laszlo Ersek as an ArmVirtPkg maintainerLaszlo Ersek1-0/+1
I intend to assist with the maintenance of the following files and directories: ArmVirtPkg/ArmVirt.dsc.inc ArmVirtPkg/ArmVirtPkg.dec ArmVirtPkg/ArmVirtQemu.dsc ArmVirtPkg/ArmVirtQemu.fdf ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc ArmVirtPkg/ArmVirtRules.fdf.inc ArmVirtPkg/Include/Guid/EarlyPL011BaseAddress.h ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h ArmVirtPkg/Include/Library/FdtSerialPortAddressLib.h ArmVirtPkg/Library/ArmVirtDxeHobLib/ ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/ ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ ArmVirtPkg/Library/DebugLibFdtPL011Uart/ ArmVirtPkg/Library/FdtPL011SerialPortLib/ ArmVirtPkg/Library/FdtSerialPortAddressLib/ ArmVirtPkg/Library/NorFlashQemuLib/ ArmVirtPkg/Library/PlatformBootManagerLib/ ArmVirtPkg/Library/PlatformPeiLib/ ArmVirtPkg/Library/QemuVirtMemInfoLib/ ArmVirtPkg/MemoryInitPei/ ArmVirtPkg/PlatformCI/ ArmVirtPkg/PrePi/ ArmVirtPkg/VarStore.fdf.inc Cc: Andrew Fish <afish@apple.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20231116215058.8113-2-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-08OvmfPkg/MemEncryptSevLib: Fix address overflow during PVALIDATEMichael Roth1-2/+3
The struct used for GHCB-based page-state change requests uses a 40-bit bit-field for the GFN, which is shifted by PAGE_SHIFT to generate a 64-bit address. However, anything beyond 40-bits simply gets shifted off when doing this, which will cause issues when dealing with 1TB+ addresses. Fix this by casting the 40-bit GFN values to 64-bit ones prior to shifting it by PAGE_SHIFT. Fixes: ade62c18f474 ("OvmfPkg/MemEncryptSevLib: add support to validate system RAM") Signed-off-by: Michael Roth <michael.roth@amd.com> Message-Id: <20231115175153.813213-1-michael.roth@amd.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-08UefiCpuPkg/PiSmmCpuDxeSmm: Get processor extended informationWu, Jiaxin1-0/+10
This patch is to extend SmmAddProcessor function to get processor extended information. It's to complete commit 1fadd18d. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Star Zeng <star.zeng@intel.com> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20231115111553.6592-3-jiaxin.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2023-12-08UefiCpuPkg/BaseXApicLib: Fix CPUID_V2_EXTENDED_TOPOLOGY detectionWu, Jiaxin1-5/+16
This patch is to complete 170d4ce8, sync the change to BaseXApicLib. Checking the max cpuid leaf is not enough to figure whenever CPUID_V2_EXTENDED_TOPOLOGY is supported. Intel SDM says: Software must detect the presence of CPUID leaf 1FH by verifying (a) the highest leaf index supported by CPUID is >= 1FH, and (b) CPUID.1FH:EBX[15:0] reports a non-zero value. The same is true for CPUID leaf 0BH. This patch adds the EBX check to GetProcessorLocation2ByApicId(). The patch also fixes the existing check in GetProcessorLocationByApicId() to be in line with the spec by looking at bits 15:0. The comments are updated with a quote from the Intel SDM. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Star Zeng <star.zeng@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Message-Id: <20231115111553.6592-2-jiaxin.wu@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2023-12-08ShellPkg: Fix typosPage Chen34-104/+104
begining->beginning dirve->drive duplicat->duplicate fuly->fully Funciton->Function Functino->Function optioanl->optional poitners->pointers rountine->routine sucessful->successful sucessfully->successfully Signed-off-by: Page Chen <paiching_chen@apple.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Andrew Fish <afish@apple.com> Message-Id: <829d2bed2a848229d719d7ae7b64ef1a47782720.1699557986.git.paiching_chen@apple.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
2023-12-07OvmfPkg: remove CSM_ENABLE build macroLaszlo Ersek6-21/+1
At this point, the CSM_ENABLE conditionals only bracket the !error directives that we added at the front of this series; it's time to remove CSM_ENABLE. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Corvin Köhne <corvink@freebsd.org> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Rebecca Cran <rebecca@bsdio.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20231110235820.644381-38-lersek@redhat.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Corvin Köhne <corvink@FreeBSD.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com>