summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' into leiflindholm-pr-templateleiflindholm-pr-templatemergify[bot]2024-07-109-11/+396
|\
| * BaseTools/Ecc: Allow `static` as a modifierMichael Kubacki2024-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, `STATIC` is allowed as a function modifier but `static` results in the below ECC errors: ``` *Error code: 5001 *Return type of a function should exist and in the first line *file: D:\src\edk2\Build\.pytool\Plugin\EccCheck\MdePkg\Library\UefiDebugLibDebugPortProtocol\DebugLibConstructor.c *Line number: 37 *[UefiDebugLibDebugPortProtocolExitBootServicesCallback] Return Type should appear at the start of line EFI coding style error *Error code: 5002 *Any optional functional modifiers should exist and next to the return type *file: D:\src\edk2\Build\.pytool\Plugin\EccCheck\MdePkg\Library\UefiDebugLibDebugPortProtocol\DebugLibConstructor.c *Line number: 37 ``` This is because `GetDataTypeFromModifier()` will return both `static` and the return type (e.g. `VOID`) whereas for a modifier in the list (e.g. `STATIC`) it will return only the return type allowing logic in Ecc/c.py to process the modifier and return type with current logic. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
| * RedfishPkg/RedfishPlatformConfigDxe: remove false alarmNickle Wang2024-07-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Change the debug message level to DEBUG_INFO for protocol notification functions. The protocol notification function is invoked at least one time. So, the failure of locating protocol is expected because protocol may not be installed when Redfish platform config driver is launched. Signed-off-by: Nickle Wang <nicklew@nvidia.com> Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Rebecca Cran <rebecca@bsdio.com>
| * ShellPkg: UefiShellDebug1CommandsLib: Conformance Profiles in Dmem.cSam Kaynor2024-07-103-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352 Implemented dumping of the UEFI Conformance Profiles Table using Dmem.c Uses header file for GUIDs added in previous patches Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com> Tested-by: Stuart Yoder <stuart.yoder@arm.com> Reviewed-by: Stuart Yoder <stuart.yoder@arm.com>
| * MdePkg: Adding EBBR EFI_CONFORMANCE_PROFILE_TABLE GUIDsSam Kaynor2024-07-102-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352 Adding additional GUIDs for the EFI_CONFORMANCE_PROFILE_TABLE that are defined in the Embedded Base Boot Requirments (EBBR) Specification. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com>
| * MdePkg: Adding support for EFI_CONFORMANCE_PROFILE_TABLESam Kaynor2024-07-102-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352 Adding support for EFI_CONFORMANCE_PROFILE_TABLE by adding an associated header file and relevant GUIDs to MdePkg.dec as defined in the UEFI 2.10 spec. This table is needed to address changes being made within ShellPkg. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com>
| * ShellPkg: UefiShellDebug1CommandsLib: Image Execution Table in Dmem.cSam Kaynor2024-07-102-0/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352 Implemented dumping of the Image Execution Table using Dmem.c Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com> Tested-by: Stuart Yoder <stuart.yoder@arm.com> Reviewed-by: Stuart Yoder <stuart.yoder@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
| * ShellPkg: UefiShellDebug1CommandsLib: Dumping RT Properties in Dmem.cSam Kaynor2024-07-102-4/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352 Implemented the dumping of the UEFI RT Properties Table using Dmem.c Added new entry to the help command for the -verbose option Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com> Tested-by: Stuart Yoder <stuart.yoder@arm.com> Reviewed-by: Stuart Yoder <stuart.yoder@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
| * MdeModulePkg: Remove PeiAllocatePool() AssertKun Qin2024-07-101-2/+0
| | | | | | | | | | | | | | | | | | Removes an assert if PeiAllocatePool() fails to allocate memory to defer error handling to the caller so the error can be handled gracefully or asserted at that location which is more specific to the call that led to the allocation. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
| * FmpDevicePkg: Correct broken Depex in FmpDxeThamballi Sreelalitha2024-07-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | Commit 2f6f3329add3 ("FmpDevicePkg/FmpDxe: Use new Variable Lock interface"), moved to using gEdkiiVariablePolicyProtocolGuid instead of gEdkiiVariableLockProtocolGuid however the Depex was not updated to reflect the change. Correct the dependency. Signed-off-by: Vishal Oliyil Kunnil <quic_vishalo@quicinc.com>
* | .github: Update pull_request_template.mdLeif Lindholm2024-07-091-4/+4
|/ | | | | Slightly reword the template to be more specific and use active language. Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
* BaseTools: change non-ASCII characters in LinuxGcc5ToolChain.pyLeif Lindholm2024-07-091-1/+1
| | | | | | | | | | Commit ea56fa3d4706 ("BaseTools: Enable RISC-V architecture for RISC-V EDK2 CI") introduced a UTF-8 NBSP (0xc2a0) inside a comment block otherwise copied identically from pre-existing architectures. This was clearly unintentional and confuses things when looking for which files contain UTF-8 encodings, so change it to good old 0x20. Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
* BaseTools: Add VS2022 support.Matthew Carlson2024-07-085-7/+392
| | | | | | | | Adding tools_def for VS2022. Update WindowsVsToolChain to support VS2022. Update set_vsPrefix_envs and toolsetup and edksetup to support VS2022. Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
* StandaloneMmPkg/Core: Dump all HOB info in entrypointWei6 Xu2024-07-074-1/+7
| | | | | | | | | | Print HOB information at top of StandaloneMmMain(). Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
* UefiPayloadPkg/UefiPayloadEntry: Use HobPrintLib to dump HOBsWei6 Xu2024-07-074-326/+20
| | | | | | | | | | | | | Leverage generic HOB print code in MdeModulePkg/Library/HobPrintLib. Print UefiPayload specified GUID HOB info as custom HOB print handler when calling the PrintHobList() interface. 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> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
* MdeModulePkg: Add HobPrintLib instanceWei6 Xu2024-07-073-0/+504
| | | | | | | | | | | | The HobPrintLib prints all HOB info from the HOB list. The code is abstracted from UefiPayloadPkg/UefiPayloadEntry/PrintHob.c. 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> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
* MdeModulePkg: Add HobPrintLib header fileWei6 Xu2024-07-072-0/+50
| | | | | | | | | | Interface PrintHobList() is added to dump all HOBs info in the HobList. Caller could specify a custom HOB print handler to replace the default print handler when calling the interface. Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
* SecurityPkg/Tcg: Correct buffer valid check funcJiaxin Wu2024-07-074-13/+88
| | | | | | | | | | | | | | | | | | | For SMM, the SMM Handlers is to validate the buffer outside MMRAM including the Primary & NonPrimary buffer. For MM, the MM Handlers do not need to validate the Primary buffer if it is passed from MmCore through the MmiHandler() parameter. Return TRUE directly in this case. But need to validate NonPrimary buffer that outside MMRAM. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
* MdeModulePkg/VariableSmm: Fix NonPrimary Buffer check issueJiaxin Wu2024-07-075-13/+14
| | | | | | | | | | | | | | | | | | VariableSmmIsBufferOutsideSmmValid function is to check the buffer is outside SMM or not. This patch fix the issue that always return true for MM. Meanwhile, this patch renames VariableSmmIsBufferOutsideSmmValid to VariableSmmIsNonPrimaryBufferValid. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
* MdeModulePkg/VariableSmm: Add func for Primary Buffer valid checkJiaxin Wu2024-07-074-6/+57
| | | | | | | | | | | | | | | | | Add a new function (VariableSmmIsPrimaryBufferValid) to check Primary Buffer valid or not. original function (VariableSmmIsBufferOutsideSmmValid) is used to check the buffer outside MMRAM. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
* MdeModulePkg/VarCheckPolicyLib: Fix buffer valid check for MMJiaxin Wu2024-07-071-1/+1
| | | | | | | | | | | | | | | | For MM, the MM Handlers do not need to validate the buffer if it is the CommBuffer passed from MmCore through the MmiHandler() parameter. Return TRUE directly in this case. Fix buffer valid check for MM in this patch. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
* MdeModulePkg/VarCheckPolicyLib: Update buffer valid check func nameJiaxin Wu2024-07-074-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | In the MdeModulePkg/VarCheckPolicyLib, the Primary Buffer (CommBuffer) check function has been updated to match the buffer validation behavior. For SMM, the SMM Handlers is to validate the buffer outside MMRAM. For MM, the MM Handlers do not need to validate the buffer if it is the CommBuffer passed from MmCore through the MmiHandler() parameter. Return TRUE directly in this case. Existing code is incorrect for the MM check. This will be fixed in the following patch. There is no function impact. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
* MdeModulePkg/FaultTolerantWriteSmm: Update buffer valid check func nameJiaxin Wu2024-07-074-22/+16
| | | | | | | | | | | | | | | | | | | | | | | In the MdeModulePkg/FaultTolerantWriteSmm, the Primary Buffer (CommBuffer) check function has been updated to match the buffer validation behavior: For SMM, the SMM Handlers is to validate the buffer outside MMRAM. For MM, the MM Handlers do not need to validate the buffer if it is the CommBuffer passed from MmCore through the MmiHandler() parameter. Return TRUE directly in this case. There is no function impact. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
* BaseTools/GenerateCapsule.py: Fix checking for DepExp presenceSergii Dmytruk2024-07-051-2/+2
| | | | | | | | | | | struct.unpack() returns a tuple even for a single-element pack, resulting in signature verification being evaluated to false even when the signature is there. This fixes --decode and --dump-info actions incorrectly reporting issues with parsing capsule dependencies when there are none. Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
* BaseTools/GenerateCapsule.py: Fix inconsistent error formattingSergii Dmytruk2024-07-051-2/+2
| | | | | | | Just add a space between colon and a more detailed error message in two places. Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
* BaseTools/GenerateCapsule.py: Require --output for --decodeSergii Dmytruk2024-07-051-0/+4
| | | | | | | | | | | --decode unconditionally uses args.OutputFile.name as a prefix for output files that it creates and fails in a non-pretty way without --output option. This doesn't address creation/truncation of the file specified via --output, but at least you're able to decode a capsule. Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
* BaseTools/GenerateCapsule.py: Better error message on --decode failureSergii Dmytruk2024-07-051-2/+2
| | | | | | Print error text from the exception. Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
* BaseTools/GenerateCapsule.py: Disallow UpdateImageIndex == 0 on --encodeSergii Dmytruk2024-07-051-3/+3
| | | | | | | | | This field seems to be one-based according UEFI specification, default value is 1 and --decode of GenerateCapsule.py errors upon seeing UpdateImageIndex less than 1. So align --encode behaviour to enforce a value within the 1..255 range. Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
* BaseTools/GenerateCapsule.py: Fix --decode operationSergii Dmytruk2024-07-051-1/+1
| | | | | | | | | | | Commit b68d566439683d0ebe60d52c85ff0e90331db740 added support for input subject name with signtool and broke --decode operation by using incorrect identifier in one place (could be an incomplete rename during review). It's `args.SignToolSubjectName`, not `args.SignSubjectName`. Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
* BaseTools/FmpCapsuleHeader.py: Explain error when throwing exceptionsSergii Dmytruk2024-07-051-11/+11
| | | | | | This gives a caller a chance to report a meaningful error to the user. Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
* UefiCpuPkg/PiSmmCpuDxeSmm: Consume PcdCpuSmmApSyncTimeout2Yanbo Huang2024-07-054-13/+28
| | | | | | | | | | | | | | | | | | | | | | This patch is to consume the PcdCpuSmmApSyncTimeout2 to enhance the flexibility of timeout configuration. In some cases, certain processors may not be able to enter SMI, and prolonged waiting could lead to kernel soft/hard lockup. We have now defined two timeouts. The first timeout can be set to a smaller value to reduce the waiting period. Processors that are unable to enter SMI will be woken up through SMIIPL to enter SMI, followed by a second waiting period. The second timeout can be set to a larger value to prevent delays in processors entering SMI case due to the long instruction execution. This patch adjust the location of PcdCpuSmmApSyncTimeout2 to avoid conflict. Signed-off-by: Yanbo Huang <yanbo.huang@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com>
* Revert "UefiCpuPkg/PiSmmCpuDxeSmm: Consume PcdCpuSmmApSyncTimeout2"Yanbo Huang2024-07-054-28/+13
| | | | | | | | | | This reverts commit cb3134612d11102fe066c94c8fa7edb20d62c1a8. Intel server platform sync this commit will hit conflict since our code base is old. We don't want to cherry-pick the dependent patches to avoid potential issue. We need to revert this commit first and then fix the conflict and reapply the change. Sorry for the incovenience. Signed-off-by: Yanbo Huang <yanbo.huang@intel.com>
* OvmfPkg/LoongArchVirt: Optimize the use of serial port librariesXianglai Li2024-07-051-11/+1
| | | | | | | | | | | | | | | | Because the complex dependency between SerialPortLib and PciExpressLib leads to multiple references to the lib library in the loongarch dsc file, optimizing SerialPortLib now simplifies multiple references to lib in the dsc file. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Bibo Mao <maobibo@loongson.cn> Cc: Chao Li <lichao@loongson.cn> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Xianglai Li <lixianglai@loongson.cn> Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
* MdeModulePkg/StandaloneMmReportStatusCodeLib: Support MM_CORE_STANDALONEJiaxin Wu2024-07-051-1/+1
| | | | | | Support the module type for MM_CORE_STANDALONE Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
* MdePkg/StandaloneMmServicesTableLib: Support MM_CORE_STANDALONEJiaxin Wu2024-07-051-1/+1
| | | | | | Support the module type for MM_CORE_STANDALONE Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
* StandaloneMmPkg: Fix section data length returned larger than actual dataMichael Kubacki2024-07-052-8/+8
| | | | | | | | | | This change fixes an issue where the returned section data length is always 4 bytes larger than the actual section length. This could cause an issue where the caller accesses the final 4 bytes which would be invalid. Co-authored-by: Kun Qin <kuqin@microsoft.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
* UefiCpuPkg/PiSmmCpuDxeSmm: Fix system hang when SmmProfile enableJiaxin Wu2024-07-051-10/+30
| | | | | | | | | | | | | | | | | | MMIO ranges within the mProtectionMemRange array may exceed 4G and should be configured as 'Present & NX'. However, the initial attribute for these MMIO addresses in the page table is 'non-present'. Other attributes should not be set or updated for a non-present range if the present bit mask is zero, as this could result in an error during the InitPaging for the page table update process. This patch is to resolve the error to make sure MMIO page table can be configured correctly. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com>
* MdePkg/Tdx.h: Fix the order of NumVcpus and MaxVcpusXiaoyao Li2024-07-041-1/+1
| | | | | | | | | | | | For TDCALL leaf TDG.VP.INFO, the bit 31:0 in R8 returns NUM_VCPUS and bit 63:32 in R8 returns MAX_VCPUS. Current struct TDCALL_INFO_RETURN_DATA defines them in wrong order. Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Laszlo Ersek <lersek@redhat.com>
* SecurityPkg/Tcg2Config: avoid potential build errorDun Tan2024-07-041-2/+2
| | | | | | | | | | Cast pointer type to VOID* to avoid potential build error. If the two PCD are FixAtBuild, PcdGetPtr will return a const type pointer. Since the second parameter of BuildGuidDataHob is VOID*, build error may happen with following log: C4090: 'function': different 'const' qualifiers Signed-off-by: Dun Tan <dun.tan@intel.com>
* OvmfPkg: Enable AMD SEV-ES DebugVirtualizationAlexey Kardashevskiy2024-07-043-5/+20
| | | | | | | | | | | | | | | | | | | | | Write the feature bit into PcdConfidentialComputingGuestAttr and enable DebugVirtualization in PEI, SEC, DXE. 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> Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Alexey Kardashevskiy <aik@amd.com> --- Changes: v5: * "rb" from Tom v4: * s/DebugSwap/DebugVirtualization/g
* UefiCpuPkg: Add AMD SEV-ES features supportAlexey Kardashevskiy2024-07-041-3/+9
| | | | | | | | | | | | | | | | | | | | | | CONFIDENTIAL_COMPUTING_GUEST_ATTR is not a simple SEV level anymore and includes a feature mask since the previous commit. Fix AmdMemEncryptionAttrCheck to check the level and feature correctly and add DebugVirtualization support. Since the actual feature flag is not set yet, this should cause no behavioural change. Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Ray Ni <ray.ni@intel.com> Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Alexey Kardashevskiy <aik@amd.com> --- Changes: v5: * "rb" from Tom
* OvmfPkg: Add AMD SEV-ES DebugVirtualization feature supportAlexey Kardashevskiy2024-07-045-3/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SEV-ES DebugVirtualization feature enables type B swapping of debug registers on #VMEXIT and makes #DB and DR7 intercepts unnecessary and unwanted. When DebugVirtualization is enabled, this stops booting if interaction from the HV. Add new API to PEI, SEC, DXE. This does not change the existing behaviour yet. 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> Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Alexey Kardashevskiy <aik@amd.com> --- Changes: v5: * "rb" from Tom v4: * s/DebugSwap/DebugVirtualization/
* MdePkg: Add AMD SEV features to PcdConfidentialComputingGuestAttrAlexey Kardashevskiy2024-07-041-2/+13
| | | | | | | | | | | | | | | | | | | | | | PcdConfidentialComputingGuestAttr so far only contained an SEV mode bit but there are more other features which do not translate to levels such as DebugVirtualization or SecureTsc. Add the feature mask and the DebugVirtualization feature bit to the PCD. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Alexey Kardashevskiy <aik@amd.com> --- Changes: v4: * s/CCAttrFeatureAmdSevDebugSwap/CCAttrFeatureAmdSevEsDebugVirtualization/ v2: * expanded features mask * added type mask
* MdePkg/Register/Amd: Define all bits from MSR_SEV_STATUS_REGISTERAlexey Kardashevskiy2024-07-041-4/+91
| | | | | | | | | | | | | | | | For now we need DebugSwap but others are likely to be needed too. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Alexey Kardashevskiy <aik@amd.com> Changes: v5: * "rb" from Tom v4: * added more from April/2024 APM
* EmbeddedPkg/VirtualRealTimeClockLib: Support SOURCE_DATE_EPOCHChun-Yi Lee2024-07-041-1/+1
| | | | | | | | | | | | | | | | | | RISC-V ovmf used VirtualRealTimeClockLib but the default epoch is a compilation time. It causes that the RISC-V ovmf binary image is NOT reproducible. This patch added the support of SOURCE_DATE_EPOCH by printenv command. If SOURCE_DATE_EPOCH be found then we use it as BUILD_EPOCH. Otherwise we run date command for setting BUILD_EPOCH. For distributions want a reproducible RISC-V ovmf image, they should export SOURCE_DATE_EPOCH environment variable before building ovmf. References: https://reproducible-builds.org/docs/source-date-epoch/ Cc: Pete Batard <pete@akeo.ie> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: "Lee, Chun-Yi" <jlee@suse.com>
* MdePkg/Nvme.h: Add missing NVMe capability descriptionsMichael Kubacki2024-07-041-6/+6
| | | | | | | | | Most of the definitions in this file are currently well documented. This adds documentation for a few missing fields in the NVMe Controller Capabilities structure. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
* AmdSev: enable kernel hashes without initrdTobin Feldman-Fitzthum2024-07-041-10/+0
| | | | | | | | | | | | | | If kernel hashes are enabled but no initrd is provided, QEMU will still create an entry in the hash table, but it will be the hash of an empty buffer. Remove the explicit check for the length of the blob. This logic will be handled by the later hash comparison, which will still fail when the blob is not present but is expected, but will pass when the blob is not present and the hash table contains a hash of an empty buffer. Signed-off-by: Tobin Feldman-Fitzthum <tobin@linux.ibm.com>
* MdeModulePkg/NvmExpressDxe: use format "0x%lx" for UINT64 values.Mike Maslenkin2024-07-041-3/+3
| | | | | Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* MdeModulePkg/NvmExpressDxe: fix format used for Eui64 conversionMike Maslenkin2024-07-041-1/+1
| | | | | | | | Eui64 is a 64 bit value, so the "L" or "l" is required for format specifier, otherwise only lower 32 bit will be converted. Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* BaseTools: InfBuildData: Fix Private value retrievalJoey Vagedes2024-07-041-7/+7
| | | | | | | | | | | | | | | | | Update retrieval of private guids, protocols, or ppis from a package's declaration file to use the original path of the module's INF file rather than the current path. When building the same module multiple times in the same INF (by override the define's FILE_GUID), a temporary instance of the module is generated outside the package, causing the retrieval of private values to fail as the check to access private values is done by verifying the module to build, is inside the package. Signed-off-by: Joey Vagedes <Joey.Vagedes@gmail.com> Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com>