Commit Graph

32183 Commits

Author SHA1 Message Date
Dhaval 26727c2ae2 MdePkg: Implement RISC-V Cache Management Operations
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-19 12:48:14 +00:00
Dhaval 30faafd024 MdePkg: Rename Cache Management Function To Clarify Fence Based Op
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-19 12:48:14 +00:00
Dhaval Sharma 286b30f517 MdePkg: Move RISC-V Cache Management Declarations Into BaseLib
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-19 12:48:14 +00:00
Wei6 Xu 3c66390e4a StandaloneMmPkg/Core: Fix the failure to find uncompressed inner FV
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-19 09:29:07 +00:00
Wei6 Xu 4a9fcab124 StandaloneMmPkg/Core: Fix issue that offset calculation might be wrong
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-19 09:29:07 +00:00
Wei6 Xu 0904161f6f StandaloneMmPkg/Core: Fix potential memory leak issue
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-19 09:29:07 +00:00
Wei6 Xu c012284048 StandaloneMmPkg/Core: Limit FwVol encapsulation section recursion
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-19 09:29:07 +00:00
Daniel Nguyen 74daeded0c ShellPkg: Tidy for code readability
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-18 06:11:49 +00:00
Michael Kubacki 3ce5f2d445 FatPkg/FatPei: Check array offset before use
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-14 21:52:09 +00:00
Ard Biesheuvel 7f5e75895b ArmPkg/DebugPeCoffExtraActionLib: Drop RVCT and Cygwin support
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-14 16:29:17 +00:00
Jianyong Wu 59a952d9ab CloudHv: Add CI for CloudHv on AArch64
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-14 14:38:15 +00:00
Abner Chang b8a3eec88c RedfishPkg/RedfishDicovery: Remedy Redfish service discovery flow
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-13 03:07:43 +00:00
Ard Biesheuvel cee7ba349c ArmVirtQemu: Allow EFI memory attributes protocol to be disabled
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-12 10:53:16 +00:00
Dun Tan 725acd0b9c UefiCpuPkg: Avoid assuming only one smmbasehob
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-12 01:37:41 +00:00
Dun Tan e51965ddd1 UefiCpuPkg: Cache core type in MpInfo2 HOB
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-12 01:37:41 +00:00
Dun Tan fc4f6627f8 UefiCpuPkg: Add a new field in MpInfo2 HOB
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-12 01:37:41 +00:00
Dun Tan be44fff723 UefiCpuPkg: Consume MpInfo2Hob in PiSmmCpuDxe
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-12 01:37:41 +00:00
Dun Tan e10f1f5a04 UefiCpuPkg: Build MpInfo2HOB in CpuMpPei
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-12 01:37:41 +00:00
Dun Tan c02eed8e5a UefiCpuPkg: Create gMpInformationHobGuid2 in UefiCpuPkg
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-12 01:37:41 +00:00
Dun Tan 1d50544aa2 MdePkg:simplify Fifo API in BaseIoLibIntrinsic
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-11 21:11:37 +00:00
Dun Tan 3c73532a8a MdePkg: Change IoLibFifo.c to IoLibFifoCc.c
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-11 21:11:37 +00:00
Rebecca Cran aa2f32cefa ArmVirtPkg: Sync debug level comments in ArmVirt.dsc.inc
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-11 17:07:03 +00:00
Rebecca Cran 9e9c35970a MdePkg: Update MdePkg.uni with manageability debug level
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-11 17:07:03 +00:00
Rebecca Cran 20ca600d67 MdePkg: Add manageability debug level to PcdFixedDebugPrintErrorLevel
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-11 17:07:03 +00:00
Rebecca Cran 03be51e106 MdePkg: Improve wording of manageability debug level comment
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-11 17:07:03 +00:00
Yuwei Chen 5b5481526f BaseTools: fixing FMMT ShrinkFv issue
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-11 10:12:52 +00:00
Yuwei Chen 59f0d350a9 BaseTools: FMMT support ELF UPLD parser
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-11 10:12:52 +00:00
Yuwei Chen 9627447625 BaseTools: FMMT replace output file is not generated successfully
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-11 10:12:52 +00:00
Yuwei Chen b5f5106c1e BaseTools: FMMT replace new free space fixing in replace
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-11 10:12:52 +00:00
Nhi Pham bb13a4adab StandaloneMmPkg/StandaloneMmHobLib: Remove HOB creation
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-11 03:30:39 +00:00
ManickamX Srinivasan 85a5141a32 MdePkg: Add UEFI v2.10 ISA memory type definition
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-09 01:50:07 +00:00
ManickamX Srinivasan 3c40ee8c68 MdePkg: Define the DevicePath argument from LoadImage as optional
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-08 22:52:02 +00:00
Laszlo Ersek 2cd9d5f6fa Maintainers.txt: add Aaron Young as MptScsi and PvScsi reviewer
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 1774a44ad9 ("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-08 13:25:11 +00:00
Laszlo Ersek ff22700fc0 Maintainers.txt: add Laszlo Ersek as a UefiCpuPkg maintainer
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-08 13:25:11 +00:00
Laszlo Ersek 408ca20a95 Maintainers.txt: add Laszlo Ersek as an OvmfPkg maintainer
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-08 13:25:11 +00:00
Laszlo Ersek b59574a066 Maintainers.txt: add Laszlo Ersek as an ArmVirtPkg maintainer
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-08 13:25:11 +00:00
Michael Roth e8c23d1e27 OvmfPkg/MemEncryptSevLib: Fix address overflow during PVALIDATE
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: ade62c18f4 ("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-08 13:25:11 +00:00
Wu, Jiaxin 7eb5040607 UefiCpuPkg/PiSmmCpuDxeSmm: Get processor extended information
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-08 13:25:11 +00:00
Wu, Jiaxin ad0b1cc144 UefiCpuPkg/BaseXApicLib: Fix CPUID_V2_EXTENDED_TOPOLOGY detection
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-08 13:25:11 +00:00
Page Chen fe2abc9b74 ShellPkg: Fix typos
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-08 13:25:11 +00:00
Laszlo Ersek eccdab611c OvmfPkg: remove CSM_ENABLE build macro
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>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 605248f0fd OvmfPkg: remove Pcd8259LegacyModeEdgeLevel and Pcd8259LegacyModeMask
The following PCDs are unused at this point; remove them:

- Pcd8259LegacyModeEdgeLevel
- Pcd8259LegacyModeMask

This shrinks the list of resources scheduled for removal to nil.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael Roth <michael.roth@amd.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-37-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>
2023-12-07 18:04:57 +00:00
Laszlo Ersek cf9030f69f OvmfPkg: remove gEfiLegacy8259ProtocolGuid
At this point, gEfiLegacy8259ProtocolGuid is unused; remove it.

This shrinks the list of resources scheduled for removal to:

- PCDs:
  - Pcd8259LegacyModeEdgeLevel
  - Pcd8259LegacyModeMask

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-36-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>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 67864ffd52 OvmfPkg: remove 8259InterruptControllerDxe
8259InterruptControllerDxe is not used by any platforms at this point,
remove it.

This patch removes mentions of the following CSM resources from the source
code:

- GUIDs (protocols or otherwise):
  - gEfiLegacy8259ProtocolGuid

- headers:
  - Protocol/Legacy8259.h

- PCDs:
  - Pcd8259LegacyModeEdgeLevel
  - Pcd8259LegacyModeMask

which extends the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - gEfiLegacy8259ProtocolGuid

- headers:
  - Protocol/Legacy8259.h

- PCDs:
  - Pcd8259LegacyModeEdgeLevel
  - Pcd8259LegacyModeMask

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-35-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>
2023-12-07 18:04:57 +00:00
Laszlo Ersek fb5c153abd OvmfPkg: exclude 8259InterruptControllerDxe
With 8254TimerDxe gone, no module in OVMF consumes
gEfiLegacy8259ProtocolGuid; exclude 8259InterruptControllerDxe therefore.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-34-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>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 05cffb6637 OvmfPkg: remove 8254TimerDxe
8254TimerDxe is not used by any platforms at this point, remove it.

This patch removes mentions of the following CSM resources from the source
code:

- GUIDs (protocols or otherwise):
  - gEfiLegacy8259ProtocolGuid

- headers:
  - Protocol/Legacy8259.h

which extends the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - gEfiLegacy8259ProtocolGuid

- headers:
  - Protocol/Legacy8259.h

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-33-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>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 89bd992b1f OvmfPkg: exclude 8254TimerDxe
In the original three OVMF platforms, CSM_ENABLE selects the legacy timer
driver; exclude it. Instead, include LocalApicTimerDxe unconditionally
(which in turn consumes PcdFSBClock).

Background: commits c37cbc030d ("OvmfPkg: Switch timer in build time for
OvmfPkg", 2022-04-02) and 07c0c2eb0a ("OvmfPkg: fix PcdFSBClock",
2022-05-25).

Regression test: verified that the BDS progress bar still advanced at
normal speed in each platform.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-32-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>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 0e0a0a5ee8 OvmfPkg: remove Csm16
Csm16 is not used by any platform at this point, remove it.

This shrinks the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - gEfiLegacy8259ProtocolGuid

- headers:
  - Protocol/Legacy8259.h

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-31-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>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 528ae029ad OvmfPkg: remove Rule.Common.USER_DEFINED.CSM from all FDF files
We no longer have

  INF  RuleOverride=CSM OvmfPkg/Csm/Csm16/Csm16.inf

lines in any of the OVMF platform FDF files; remove the CSM rules
themselves.

(Note that some of the more recent platforms had cargo-culted this rule
from the original ones, without ever referencing the rule with
RuleOverride=CSM. Remove those rules as well.)

Cc: Anatol Belski <anbelski@linux.microsoft.com>
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: Jianyong Wu <jianyong.wu@arm.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-30-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>
2023-12-07 18:04:57 +00:00
Laszlo Ersek e8f860d924 OvmfPkg: exclude Csm16.inf / Csm16.bin
The Csm16 module wraps the CONFIG_CSM build of SeaBIOS. "Csm16.inf" has
FILE_GUID 1547B4F3-3E8A-4FEF-81C8-328ED647AB1A, which was previously
referenced by the (now removed) CsmSupportLib, under the name
SYSTEM_ROM_FILE_GUID.

Nothing relies on the SeaBIOS binary any longer, so exclude the Csm16
module from all OVMF platforms.

(Note that the "OvmfPkg/Bhyve/Csm/BhyveCsm16/BhyveCsm16.inf" pathname that
the BhyveX64 platform refers to is bogus anyway.)

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-29-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>
2023-12-07 18:04:57 +00:00