Re: [edk2-devel] [PATCH edk2-platforms 1/1] Platform/Socionext/DeveloperBox: add SMBIOS type 17 table
On Wed, 1 Dec 2021 at 03:45, Masahisa Kojima wrote: > > Hi Ard, > > Thank you for your review. > > On Tue, 30 Nov 2021 at 20:39, Ard Biesheuvel wrote: > > > > Hello Masahisa, > > > > Thanks for this patch. > > > > On Tue, 30 Nov 2021 at 09:37, Masahisa Kojima > > wrote: > > > > > > This commit adds the SMBIOS type 17 table support for Developerbox. > > > The SPD can be accessed only from the SCP through I2C bus, > > > so this commit expects that SCP-firmware reads the SPD and > > > stores it in the non-secure SRAM. > > > > > > > What happens if the existing SCP firmware does not populate this memory > > region? > > If no valid SPD is found, fill the default SMBIOS Type17 information, > it is same as > current implementation. > > > > > > This commit also reduces the edk2 stack size to allocate > > > the space for storing SPD. It requires 2KB, 512bytes * 4 DIMMs. > > > > > > Cc: Ard Biesheuvel > > > Cc: Leif Lindholm > > > Cc: Masami Hiramatsu > > > Signed-off-by: Masahisa Kojima > > > > It seems to me that this patch contains some pieces that are generic > > SPD handling, and could be broken out. I haven't checked, but perhaps > > some of this already exists in the tree? > > Some SPD handling can be generic. > For example, HiSilicon platform has almost same JEP106_MANUFACTURER_TABLE > table. > But most of the processing are platform specific in my check, no platform > except > for Developerbox accesses the raw SPD to construct the SMBIOS type17 table. > OK, fair enough. Pushed as e9149e2c1b54..c718abce99a1 -- Ard. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84243): https://edk2.groups.io/g/devel/message/84243 Mute This Topic: https://groups.io/mt/87398626/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH edk2-test 1/1] uefi-sct/SctPkg: invalid values for SetWakeupTime()
Reviewed-by: G Edhaya Chandran -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84242): https://edk2.groups.io/g/devel/message/84242 Mute This Topic: https://groups.io/mt/86986279/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] Uncrustify Conversion Detailed Plan and Extended Hard Freeze Update #4
> -Original Message- > From: Kinney, Michael D [mailto:michael.d.kin...@intel.com] > Sent: Thursday, December 2, 2021 1:39 AM > To: Michael Kubacki ; > devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist) > ; Wang, Jian J ; Michael > Kubacki ; Andrew Fish (af...@apple.com) > ; Leif Lindholm ; Kinney, Michael D > > Subject: RE: [edk2-devel] Uncrustify Conversion Detailed Plan and Extended > Hard Freeze Update #4 > > Hi Michael, > > This commit provides the background on why this content was copied into > edk2 > instead of used as a submodule. > > https://github.com/tianocore/edk2/commit/4751a48aeb2ab828b0a5cbdc585 > fd3642967cda1#diff- > 9f77cfa3b537eee28489f8713c17d8702330f5cef1795f154201dd463aabed27 > > I imagine the main reason for this request is to minimize the effort required > to sync these copies with new versions. Yes, this is what I worry about applying uncrustify on these files. >The scope right now is only 7 files. > One alternative to help with the sync is for Abner to run uncrustify on the > files from the upstream source on these 7 files and then do the diff to see if > there is anything significant that needs to be merged. > > Abner, are you ok with doing this 2 step process to sync the files that were > copied? I also consider to just uncrustify those files, maybe just compare two open source version and add the diff back to edk2 one. Then we can have this work moves forward. Thanks For the RedfishPkg/, Acked-by: Abner Chang > > Best regards, > > Mike > > > > -Original Message- > > From: Michael Kubacki > > Sent: Wednesday, December 1, 2021 9:05 AM > > To: devel@edk2.groups.io; Kinney, Michael D > ; Chang, Abner ; > Wang, Jian J > > ; Michael Kubacki > ; Andrew Fish (af...@apple.com) > ; > > Leif Lindholm > > Subject: Re: [edk2-devel] Uncrustify Conversion Detailed Plan and > Extended Hard Freeze Update #4 > > > > This can of course be done at a technical level but it smells of a code > > cohesion problem. > > > > The code is in the edk2 project so it would reason that it should be > > uniform in style with other code and at least close to the EDK II C > > Coding Standard Specification. > > > > Currently, git submodules and ignored path are already excluded in > > addition to the ability to mark packages in "audit mode" so they do not > > fail the results. I would personally prefer not to allow arbitrary > > subdirectories to diverge from the rest of the codebase / package but if > > there's consensus this is a good idea, I can look into adding it. > > > > Regards, > > Michael > > > > On 12/1/2021 11:43 AM, Michael D Kinney wrote: > > > Hi Abner, > > > > > > Yes. That is possible. We are already excluding BaseTools. > > > > > > In order to get the file lists that apply to uncrustify, we would have to > change from: > > > > > > git ls-files *.c *.h :!BaseTools/* > > > > > > To: > > > > > > git ls-files *.c > *.h :!BaseTools/* :!RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/* > > > > > > However, I do not see a feature in the UncrustifyCheck to check all c/h > files in RedFishPkg and exclude one of its > > directories. > > > If we can specify an exclusion like this in the RedFishPkg YAML file, > > > then I > think that would work well. > > > > > > Michael Kubacki would have to comment on how we support this in EDK > II CI checks. > > > > > > Best regards, > > > > > > Mike > > > > > > > > >> -Original Message- > > >> From: devel@edk2.groups.io On Behalf Of > Abner Chang > > >> Sent: Tuesday, November 30, 2021 11:34 PM > > >> To: devel@edk2.groups.io; Wang, Jian J ; > Kinney, Michael D ; Michael > > >> Kubacki ; Andrew Fish > (af...@apple.com) ; Leif Lindholm > > >> > > >> Subject: Re: [edk2-devel] Uncrustify Conversion Detailed Plan and > Extended Hard Freeze Update #4 > > >> > > >> Hi Mike, > > >> Is that possible to not applying uncrusitify on the source files that > > >> cloned > from other open source? > > >> e.g. RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/*.* > > >> > > >> Thanks > > >> Abner > > >> > > >>> -Original Message- > > >>> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On > Behalf Of > > >>> Wang, Jian J > > >>> Sent: Wednesday, December 1, 2021 2:39 PM > > >>> To: devel@edk2.groups.io; Kinney, Michael D > ; > > >>> Michael Kubacki ; Andrew Fish > > >>> (af...@apple.com) ; Leif Lindholm > > > >>> Subject: Re: [edk2-devel] Uncrustify Conversion Detailed Plan and > Extended > > >>> Hard Freeze Update #4 > > >>> > > >>> For SignedCapulePkg, > > >>> > > >>> Reviewed-by: Jian J Wang > > >>> > > >>> Regards, > > >>> Jian > > >>> > > -Original Message- > > From: devel@edk2.groups.io On Behalf Of > > >>> Michael D > > Kinney > > Sent: Wednesday, December 01, 2021 6:34 AM > > To: devel@edk2.groups.io; Kinney, Michael D > > >>> ; > > Michael Kubacki ; Andrew Fish > > (af...@apple.com) ; Leif Lindholm > > >>> > > Subject: [edk2-devel] Uncr
[edk2-devel] One question about memorymap
If we build MMIO resurce Hob in PEI phase, should this MMIO resource range with runtime attribute? should we see the range under Shell command "memmap"? and if we have Memorymap, E820 table will not use any more in UEFI mode? -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84240): https://edk2.groups.io/g/devel/message/84240 Mute This Topic: https://groups.io/mt/87446758/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] EmulatorPkg: Update lldbefi.py to work with current lldb which uses python3
I just noticed this was never committed. Could someone commit/push this change please? -- Rebecca Cran On 7/20/21 23:25, Andrew Fish wrote: Reviewed-by: Andrew Fish On May 9, 2021, at 12:26 PM, Rebecca Cran wrote: The version of lldb shipping with macOS Big Sur is lldb-1205.0.27.3, and it uses python3. Update lldbefi.py to work with it, including removing the unused 'commands' import and fixing the print statements. Signed-off-by: Rebecca Cran --- EmulatorPkg/Unix/lldbefi.py | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/EmulatorPkg/Unix/lldbefi.py b/EmulatorPkg/Unix/lldbefi.py index c3fb2675cb..952f8bf982 100755 --- a/EmulatorPkg/Unix/lldbefi.py +++ b/EmulatorPkg/Unix/lldbefi.py @@ -10,7 +10,6 @@ import lldb import os import uuid import string -import commands import optparse import shlex @@ -389,7 +388,7 @@ def LoadEmulatorEfiSymbols(frame, bp_loc , internal_dict): FileName = frame.thread.process.ReadCStringFromMemory (FileNamePtr, FileNameLen, Error) if not Error.Success(): -print "!ReadCStringFromMemory() did not find a %d byte C string at %x" % (FileNameLen, FileNamePtr) +print("!ReadCStringFromMemory() did not find a %d byte C string at %x" % (FileNameLen, FileNamePtr)) # make breakpoint command continue return False @@ -398,7 +397,7 @@ def LoadEmulatorEfiSymbols(frame, bp_loc , internal_dict): LoadAddress = frame.FindVariable ("LoadAddress").GetValueAsUnsigned() - 0x240 debugger.HandleCommand ("target modules add %s" % FileName) -print "target modules load --slid 0x%x %s" % (LoadAddress, FileName) +print("target modules load --slid 0x%x %s" % (LoadAddress, FileName)) debugger.HandleCommand ("target modules load --slide 0x%x --file %s" % (LoadAddress, FileName)) else: target = debugger.GetSelectedTarget() @@ -408,7 +407,7 @@ def LoadEmulatorEfiSymbols(frame, bp_loc , internal_dict): if FileName == ModuleName or FileName == SBModule.GetFileSpec().GetFilename(): target.ClearModuleLoadAddress (SBModule) if not target.RemoveModule (SBModule): -print "!lldb.target.RemoveModule (%s) FAILED" % SBModule +print("!lldb.target.RemoveModule (%s) FAILED" % SBModule) # make breakpoint command continue return False @@ -490,15 +489,15 @@ def efi_guid_command(debugger, command, result, dict): if len(args) >= 1: if GuidStr in guid_dict: -print "%s = %s" % (guid_dict[GuidStr], GuidStr) -print "%s = %s" % (guid_dict[GuidStr], GuidToCStructStr (GuidStr)) +print("%s = %s" % (guid_dict[GuidStr], GuidStr)) +print("%s = %s" % (guid_dict[GuidStr], GuidToCStructStr (GuidStr))) else: -print GuidStr +print(GuidStr) else: # dump entire dictionary width = max(len(v) for k,v in guid_dict.iteritems()) for value in sorted(guid_dict, key=guid_dict.get): -print '%-*s %s %s' % (width, guid_dict[value], value, GuidToCStructStr(value)) +print('%-*s %s %s' % (width, guid_dict[value], value, GuidToCStructStr(value))) return @@ -538,4 +537,4 @@ def __lldb_init_module (debugger, internal_dict): if Breakpoint.GetNumLocations() == 1: # Set the emulator breakpoints, if we are in the emulator debugger.HandleCommand("breakpoint command add -s python -F lldbefi.LoadEmulatorEfiSymbols {id}".format(id=Breakpoint.GetID())) -print 'Type r to run emulator. SecLldbScriptBreak armed. EFI modules should now get source level debugging in the emulator.' +print('Type r to run emulator. SecLldbScriptBreak armed. EFI modules should now get source level debugging in the emulator.') -- 2.30.1 (Apple Git-130) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84239): https://edk2.groups.io/g/devel/message/84239 Mute This Topic: https://groups.io/mt/82705174/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel][edk2-platforms][PATCH V1 1/1] WhitleyOpenBoardPkg/BoardAcpiLib: Simplify implementation
Reviewed-by: Nate DeSimone -Original Message- From: Oram, Isaac W Sent: Wednesday, November 10, 2021 6:05 PM To: devel@edk2.groups.io Cc: Oram, Isaac W ; Desimone, Nathaniel L ; Chiu, Chasel Subject: [edk2-devel][edk2-platforms][PATCH V1 1/1] WhitleyOpenBoardPkg/BoardAcpiLib: Simplify implementation Remove DXE version as the library isn't in use. Simplify the SMM library. Remove functions calling functions. Cc: Nate DeSimone Cc: Chasel Chiu Signed-off-by: Isaac Oram --- Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeBoardAcpiTableLib.c | 37 -- Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf | 44 --- Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeMtOlympusAcpiTableLib.c | 54 Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/SmmBoardAcpiEnableLib.c | 89 +++-- Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/SmmBoardAcpiEnableLib.inf | 1 - Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/SmmSiliconAcpiEnableLib.c | 138 Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc | 7 +- 7 files changed, 77 insertions(+), 293 deletions(-) diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeBoardAcpiTableLib.c b/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeBoardAcpiTableLib.c deleted file mode 100644 index dfa0c994dc..00 --- a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeBoardAcpiTableLib.c +++ /dev/null @@ -1,37 +0,0 @@ -/** @file - Platform Hook Library instances - - @copyright - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved. - - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -#include -#include -#include -#include -#include -#include -#include -#include - -EFI_STATUS -EFIAPI -MtOlympusBoardUpdateAcpiTable ( - IN OUT EFI_ACPI_COMMON_HEADER *Table, - IN OUT EFI_ACPI_TABLE_VERSION *Version - ); - -EFI_STATUS -EFIAPI -BoardUpdateAcpiTable ( - IN OUT EFI_ACPI_COMMON_HEADER *Table, - IN OUT EFI_ACPI_TABLE_VERSION *Version - ) -{ - MtOlympusBoardUpdateAcpiTable (Table, Version); - - return EFI_SUCCESS; -} - diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf b/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf deleted file mode 100644 index 3186c6c91e..00 --- a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf +++ /dev/null @@ -1,44 +0,0 @@ -### @file -# Platform Hook Library instance for SandyBridge Mobile/Desktop CRB. -# -# @copyright -# Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved. -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION= 0x00010017 - BASE_NAME = DxeBoardAcpiTableLib - FILE_GUID = 6562E0AE-90D8-4D41-8C97-81286B4BE7D2 - VERSION_STRING = 1.0 - MODULE_TYPE= BASE - LIBRARY_CLASS = BoardAcpiTableLib - -# -# The following information is for reference only and not required by the build tools. -# -# VALID_ARCHITECTURES = IA32 X64 IPF EBC -# - -[LibraryClasses] - BaseLib - IoLib - PciLib - PcdLib -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - MinPlatformPkg/MinPlatformPkg.dec - WhitleyOpenBoardPkg/PlatformPkg.dec - WhitleySiliconPkg/WhitleySiliconPkg.dec - WhitleySiliconPkg/SiliconPkg.dec - -[Pcd] - gOemSkuTokenSpaceGuid.PcdAcpiGnvsAddress - -[Sources] - DxeMtOlympusAcpiTableLib.c - DxeBoardAcpiTableLib.c - diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeMtOlympusAcpiTableLib.c b/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeMtOlympusAcpiTableLib.c deleted file mode 100644 index 09b917083c..00 --- a/Platform/Intel/WhitleyOpenBoardPkg/Library/BoardAcpiLib/DxeMtOlympusAcpiTableLib.c +++ /dev/null @@ -1,54 +0,0 @@ -/** @file - Platform Hook Library instances - - @copyright - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved. - - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -GLOBAL_REMOVE_IF_UNREFERENCED BIOS_ACPI_PARAM *mGlobalNvsArea; - -VOID -MtOlympusUpdateGlobalNvs ( - VOID - ) -{ - - // - // Allocate and initialize the NVS area for SMM and ASL communication. - // - mGlobalNvsArea = (VOID *)(UINTN)PcdGet64 (PcdAcpiGnvsAddress); - - // - // Update global NVS area for ASL and SMM init code to use - // - - -} - -EFI_STATUS -EFIAPI -MtOlympusBoardUpdateAcpiTable ( - IN OUT EFI_ACPI_COMMON_HEADER *Table, - IN OUT EFI_ACPI_TABLE_VERSION *Version - ) -{ - if (Table->Signature == EFI_ACPI_2_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE) { -
Re: [edk2-devel] [PATCH v2] SpcrFeaturePkg: Modify PCI device interrupt setting.
Pushed: https://github.com/tianocore/edk2-platforms/commit/e9149e2 -Original Message- From: devel@edk2.groups.io On Behalf Of Tan, Ming Sent: Tuesday, October 26, 2021 11:57 PM To: devel@edk2.groups.io Subject: [edk2-devel] [PATCH v2] SpcrFeaturePkg: Modify PCI device interrupt setting. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3708 The original code will cause FWTS V21.08.00 testing failed. spcr: SPCR PC-AT compatible IRQ 0xff is invalid spcr: SPCR PCI flags compatibility bit 0 is 0, expecting 1 for PCI device Now modify the SpcrAcpi for following: 1. Disable the support of PC-AT compatible IRQ support. Now only support IO-APIC interrupt type. 2. Set irq to 0. 3. Set the GSI to the value read from PCI device cfg space 0x3C. 4. Set PCI Flags to 1. Signed-off-by: Ming Tan --- V2: Fix a typo .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c| 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c index 86c40e90b8..7ad0c058c8 100644 --- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c +++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr +++ Acpi.c @@ -324,7 +324,9 @@ GetPciTypeInfo ( }gSpcrInfo.BaseAddress.Address = BaseAddress;- gSpcrInfo.Irq = (UINT8) Irq;+ gSpcrInfo.InterruptType = EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_APIC;+ gSpcrInfo.Irq = 0;+ gSpcrInfo.GlobalSystemInterrupt = (UINT32)Irq; gSpcrInfo.PciDeviceId = DeviceId; gSpcrInfo.PciVendorId = VendorId;@@ -332,6 +334,7 @@ GetPciTypeInfo ( gSpcrInfo.PciDeviceNumber = (UINT8) Device; gSpcrInfo.PciFunctionNumber = (UINT8) Function; gSpcrInfo.PciSegment= (UINT8) SegNum;+ gSpcrInfo.PciFlags = 1; Done: if (Resources != NULL) {-- 2.29.2.windows.3 -=-=-=-=-=-= Groups.io Links: You receive all messages sent to this group. View/Reply Online (#82732): https://edk2.groups.io/g/devel/message/82732 Mute This Topic: https://groups.io/mt/86622293/1767664 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [nathaniel.l.desim...@intel.com] -=-=-=-=-=-= -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84237): https://edk2.groups.io/g/devel/message/84237 Mute This Topic: https://groups.io/mt/86622293/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2] SpcrFeaturePkg: Modify PCI device interrupt setting.
Reviewed-by: Nate DeSimone -Original Message- From: devel@edk2.groups.io On Behalf Of Tan, Ming Sent: Tuesday, October 26, 2021 11:57 PM To: devel@edk2.groups.io Subject: [edk2-devel] [PATCH v2] SpcrFeaturePkg: Modify PCI device interrupt setting. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3708 The original code will cause FWTS V21.08.00 testing failed. spcr: SPCR PC-AT compatible IRQ 0xff is invalid spcr: SPCR PCI flags compatibility bit 0 is 0, expecting 1 for PCI device Now modify the SpcrAcpi for following: 1. Disable the support of PC-AT compatible IRQ support. Now only support IO-APIC interrupt type. 2. Set irq to 0. 3. Set the GSI to the value read from PCI device cfg space 0x3C. 4. Set PCI Flags to 1. Signed-off-by: Ming Tan --- V2: Fix a typo .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c| 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c index 86c40e90b8..7ad0c058c8 100644 --- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c +++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr +++ Acpi.c @@ -324,7 +324,9 @@ GetPciTypeInfo ( }gSpcrInfo.BaseAddress.Address = BaseAddress;- gSpcrInfo.Irq = (UINT8) Irq;+ gSpcrInfo.InterruptType = EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_APIC;+ gSpcrInfo.Irq = 0;+ gSpcrInfo.GlobalSystemInterrupt = (UINT32)Irq; gSpcrInfo.PciDeviceId = DeviceId; gSpcrInfo.PciVendorId = VendorId;@@ -332,6 +334,7 @@ GetPciTypeInfo ( gSpcrInfo.PciDeviceNumber = (UINT8) Device; gSpcrInfo.PciFunctionNumber = (UINT8) Function; gSpcrInfo.PciSegment= (UINT8) SegNum;+ gSpcrInfo.PciFlags = 1; Done: if (Resources != NULL) {-- 2.29.2.windows.3 -=-=-=-=-=-= Groups.io Links: You receive all messages sent to this group. View/Reply Online (#82732): https://edk2.groups.io/g/devel/message/82732 Mute This Topic: https://groups.io/mt/86622293/1767664 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [nathaniel.l.desim...@intel.com] -=-=-=-=-=-= -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84236): https://edk2.groups.io/g/devel/message/84236 Mute This Topic: https://groups.io/mt/86622293/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1 0/3] IntelSiliconPkg: Remove v1 PCH SPI PPI and Protocol
The series has been pushed as 5e6b853~..3fd4e12 -Original Message- From: devel@edk2.groups.io On Behalf Of Michael Kubacki Sent: Wednesday, November 3, 2021 7:45 AM To: devel@edk2.groups.io Cc: Chiu, Chasel ; Desimone, Nathaniel L ; Chaganty, Rangasai V ; Kethi Reddy, Deepika ; Esakkithevar, Kathappan ; Ni, Ray ; Oram, Isaac W Subject: [edk2-devel] [PATCH v1 0/3] IntelSiliconPkg: Remove v1 PCH SPI PPI and Protocol From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3717 V2 of the PCH SPI PPI and PCH SPI Protocol were recently added to IntelSiliconPkg. This change removes the v1 definitions. V2 is intended to better support multiple silicon generations which aligns with the goals of IntelSiliconPkg. Minor changes are also made in board packages that have stale references to the SPI PPI and Protocol. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Rangasai V Chaganty Cc: Deepika Kethi Reddy Cc: Kathappan Esakkithevar Cc: Ray Ni Cc: Isaac Oram Signed-off-by: Michael Kubacki Michael Kubacki (3): CometlakeOpenBoardPkg/PeiPolicyUpdateLib: Remove unneeded SPI header WhiskeylakeOpenBoardPkg/PeiPolicyUpdateLib: Remove unneeded SPI header IntelSiliconPkg: Remove SPI v1 PPI and Protocol definitions Platform/Intel/CometlakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPchPolicyUpdate.c | 1 - Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPchPolicyUpdate.c | 1 - Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPolicyUpdateLib.inf | 1 - Silicon/Intel/IntelSiliconPkg/Include/Ppi/Spi.h | 25 -- Silicon/Intel/IntelSiliconPkg/Include/Protocol/Spi.h | 301 Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec | 7 - 6 files changed, 336 deletions(-) delete mode 100644 Silicon/Intel/IntelSiliconPkg/Include/Ppi/Spi.h delete mode 100644 Silicon/Intel/IntelSiliconPkg/Include/Protocol/Spi.h -- 2.28.0.windows.1 -=-=-=-=-=-= Groups.io Links: You receive all messages sent to this group. View/Reply Online (#83259): https://edk2.groups.io/g/devel/message/83259 Mute This Topic: https://groups.io/mt/86792794/1767664 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [nathaniel.l.desim...@intel.com] -=-=-=-=-=-= -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84235): https://edk2.groups.io/g/devel/message/84235 Mute This Topic: https://groups.io/mt/86792794/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1] Maintainers.txt: Change SimicsOpenBoardPkg Maintainer
Pushed: https://github.com/tianocore/edk2-platforms/commit/9ab8913 -Original Message- From: devel@edk2.groups.io On Behalf Of Nate DeSimone Sent: Tuesday, November 2, 2021 3:07 PM To: devel@edk2.groups.io Cc: Agyeman, Prince ; Leif Lindholm ; Kinney, Michael D Subject: [edk2-devel] [PATCH v1] Maintainers.txt: Change SimicsOpenBoardPkg Maintainer To help keep edk2-platforms healthy, I would like to offer to maintain SimicsOpenBoardPkg, SimicsX58SktPkg, and SimicsIch10Pkg. The current maintainer for those packages has changed jobs and is no longer active in the community. Cc: Agyeman Prince Cc: Leif Lindholm Cc: Michael D Kinney Signed-off-by: Nate DeSimone --- Maintainers.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Maintainers.txt b/Maintainers.txt index c839c71b22..8d9d454347 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -235,7 +235,7 @@ M: Chasel Chiu Platform/Intel/SimicsOpenBoardPkg F: Platform/Intel/SimicsOpenBoardPkg/ -M: Agyeman Prince +M: Nate DeSimone Platform/Intel/Tools F: Platform/Intel/Tools/ @@ -301,11 +301,11 @@ M: Chasel Chiu Silicon/Intel/SimicsX58SktPkg F: Silicon/Intel/SimicsX58SktPkg/ -M: Agyeman Prince +M: Nate DeSimone Silicon/Intel/SimicsIch10Pkg F: Silicon/Intel/SimicsIch10Pkg/ -M: Agyeman Prince +M: Nate DeSimone Silicon/Intel/Tools F: Silicon/Intel/Tools/ -- 2.27.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84234): https://edk2.groups.io/g/devel/message/84234 Mute This Topic: https://groups.io/mt/86778275/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms] [PATCH v1] UserAuthFeaturePkg: VerifyPassword() allows one extra password attempt
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3756 If the password provided by the user is incorrect, then the VerifyPassword() function is supposed to return EFI_SECURITY_VIOLATION if the user has not exceeded the maximum number of password guesses (currently set to 3). If the number of password guesses has been exceeded, then VerifyPassword() shall return EFI_ACCESS_DENIED. UserAuthenticationDxe uses EFI_ACCESS_DENIED as the signal that the number of guesses has been exceeded for the purposes of triggering a forced reboot. VerifyPassword() checks if the number of password guess attempts has exceeded the maximum allowed before checking if the current password guess is correct. If it has, then VerifyPassword() immediately returns EFI_ACCESS_DENIED. This behavior is correct since it is possible for VerifyPassword() to be called again after the maximum number of attempts has been exceeded. However, if the user guesses incorrectly, then VerifyPassword() will always return EFI_SECURITY_VIOLATION. This is where the bug is. It is possible that after the current attempt, the maximum allowed number of attempts is exceeded. Therefore, VerifyPassword() should check the number of attempts again, after checking if the password is correct. Cc: Dandan Bi Cc: Liming Gao Cc: Jadhav Manoj D Cc: Chasel Chiu Signed-off-by: Nate DeSimone --- .../UserAuthenticationSmm.c| 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.c b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.c index c24c3c47a5..16e3405a82 100644 --- a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.c +++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.c @@ -504,7 +504,12 @@ SmmPasswordHandler ( if (!IsPasswordVerified (UserGuid, SmmCommunicateSetPassword.OldPassword, PasswordLen + 1)) { DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: PasswordVerify - FAIL\n")); - Status = EFI_SECURITY_VIOLATION; + if (*PasswordTryCount >= PASSWORD_MAX_TRY_COUNT) { +DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: SET_PASSWORD try count reach!\n")); +Status = EFI_ACCESS_DENIED; + } else { +Status = EFI_SECURITY_VIOLATION; + } goto EXIT; } @@ -554,7 +559,12 @@ SmmPasswordHandler ( } if (!IsPasswordVerified (UserGuid, SmmCommunicateVerifyPassword.Password, PasswordLen + 1)) { DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: PasswordVerify - FAIL\n")); - Status = EFI_SECURITY_VIOLATION; + if (*PasswordTryCount >= PASSWORD_MAX_TRY_COUNT) { +DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: VERIFY_PASSWORD try count reach!\n")); +Status = EFI_ACCESS_DENIED; + } else { +Status = EFI_SECURITY_VIOLATION; + } goto EXIT; } mPasswordVerified = TRUE; -- 2.27.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84233): https://edk2.groups.io/g/devel/message/84233 Mute This Topic: https://groups.io/mt/87441032/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v3 3/8] SecurityPkg: Store physical presence code by submitting to PreOS func
Modify SavePpRequest to look like its TPM 2 equivalent SaveTcg2PpRequest and have it submit the physical presence opcode to the PreOS function so that we can choose our own method for how to store it. Move the existing code into DxeTcgPhysicalPresenceLib.c and adapt the return codes. Cc: Jiewen Yao Cc: Jian J Wang Cc: Marc-André Lureau Signed-off-by: Stefan Berger --- .../DxeTcgPhysicalPresenceLib.c | 55 +++ SecurityPkg/Tcg/TcgConfigDxe/TcgConfigImpl.c | 41 +- 2 files changed, 70 insertions(+), 26 deletions(-) diff --git a/SecurityPkg/Library/DxeTcgPhysicalPresenceLib/DxeTcgPhysicalPresenceLib.c b/SecurityPkg/Library/DxeTcgPhysicalPresenceLib/DxeTcgPhysicalPresenceLib.c index ba1abe9e08..aa0031dd77 100644 --- a/SecurityPkg/Library/DxeTcgPhysicalPresenceLib/DxeTcgPhysicalPresenceLib.c +++ b/SecurityPkg/Library/DxeTcgPhysicalPresenceLib/DxeTcgPhysicalPresenceLib.c @@ -1398,3 +1398,58 @@ TcgPhysicalPresenceLibNeedUserConfirm( return FALSE; } +/** + The handler for TPM physical presence function: + Submit TPM Operation Request to Pre-OS Environment and + Submit TPM Operation Request to Pre-OS Environment 2. + + Caution: This function may receive untrusted input. + + @param[in] OperationRequest TPM physical presence operation request. + + @return Return Code for Submit TPM Operation Request to Pre-OS Environment and + Submit TPM Operation Request to Pre-OS Environment 2. +**/ +UINT32 +EFIAPI +TcgPhysicalPresenceLibSubmitRequestToPreOSFunction ( + IN UINT32 OperationRequest + ) +{ + EFI_STATUSStatus; + UINTN DataSize; + EFI_PHYSICAL_PRESENCE PpData; + + DEBUG ((DEBUG_INFO, "[TPM] SubmitRequestToPreOSFunction, Request = %x\n", OperationRequest)); + + // + // Get the Physical Presence variable + // + DataSize = sizeof (EFI_PHYSICAL_PRESENCE); + Status = gRT->GetVariable ( + PHYSICAL_PRESENCE_VARIABLE, + &gEfiPhysicalPresenceGuid, + NULL, + &DataSize, + &PpData + ); + if (EFI_ERROR (Status)) { +DEBUG ((DEBUG_ERROR, "[TPM] Get PP variable failure! Status = %r\n", Status)); +return TCG_PP_SUBMIT_REQUEST_TO_PREOS_GENERAL_FAILURE; + } + + PpData.PPRequest = (UINT8)OperationRequest; + Status = gRT->SetVariable ( +PHYSICAL_PRESENCE_VARIABLE, +&gEfiPhysicalPresenceGuid, +EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, +DataSize, +&PpData +); + if (EFI_ERROR (Status)) { +DEBUG ((DEBUG_ERROR, "[TPM] Set PP variable failure! Status = %r\n", Status)); +return TCG_PP_SUBMIT_REQUEST_TO_PREOS_GENERAL_FAILURE; + } + + return TCG_PP_SUBMIT_REQUEST_TO_PREOS_SUCCESS; +} diff --git a/SecurityPkg/Tcg/TcgConfigDxe/TcgConfigImpl.c b/SecurityPkg/Tcg/TcgConfigDxe/TcgConfigImpl.c index 68cd62307c..61c072d1a3 100644 --- a/SecurityPkg/Tcg/TcgConfigDxe/TcgConfigImpl.c +++ b/SecurityPkg/Tcg/TcgConfigDxe/TcgConfigImpl.c @@ -8,6 +8,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include "TcgConfigImpl.h" +#include +#include + CHAR16 mTcgStorageName[] = L"TCG_CONFIGURATION"; TCG_CONFIG_PRIVATE_DATA mTcgConfigPrivateDateTemplate = { @@ -299,37 +302,23 @@ SavePpRequest ( ) { EFI_STATUS Status; - UINTNDataSize; - EFI_PHYSICAL_PRESENCEPpData; + UINT32 ReturnCode; // - // Save TPM command to variable. + // Submit TPM command to PreOS fuction // - DataSize = sizeof (EFI_PHYSICAL_PRESENCE); - Status = gRT->GetVariable ( - PHYSICAL_PRESENCE_VARIABLE, - &gEfiPhysicalPresenceGuid, - NULL, - &DataSize, - &PpData - ); - if (EFI_ERROR (Status)) { -return Status; - } - - PpData.PPRequest = PpRequest; - Status = gRT->SetVariable ( - PHYSICAL_PRESENCE_VARIABLE, - &gEfiPhysicalPresenceGuid, - EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, - DataSize, - &PpData - ); - if (EFI_ERROR(Status)) { -return Status; + ReturnCode = TcgPhysicalPresenceLibSubmitRequestToPreOSFunction (PpRequest); + if (ReturnCode == TCG_PP_SUBMIT_REQUEST_TO_PREOS_SUCCESS) { +Status = EFI_SUCCESS; + } else if (ReturnCode == TCG_PP_SUBMIT_REQUEST_TO_PREOS_GENERAL_FAILURE) { +Status = EFI_OUT_OF_RESOURCES; + } else if (ReturnCode == TCG_PP_SUBMIT_REQUEST_TO_PREOS_NOT_IMPLEMENTED) { +Status = EFI_UNSUPPORTED
[edk2-devel] [PATCH v3 2/8] OvmfPkg: Check for TPM 2 early to leave function early
TPM 1.2 and TPM 2 share QEMU's PPI memory/device and for the TPM 2 code not to initilize over the TPM 1.2 initilization, leave the init function early without touching that memory. Cc: Gerd Hoffmann Cc: Marc-André Lureau Signed-off-by: Stefan Berger --- .../DxeTcg2PhysicalPresenceLib.c | 36 ++- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.c b/OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.c index 33a470f6d8..f46a047235 100644 --- a/OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.c +++ b/OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.c @@ -94,7 +94,6 @@ QemuTpmInitPPI ( QEMU_FWCFG_TPM_CONFIG Config; EFI_PHYSICAL_ADDRESSPpiAddress64; EFI_GCD_MEMORY_SPACE_DESCRIPTOR Descriptor; - UINTN Idx; if (mPpi != NULL) { return EFI_SUCCESS; @@ -105,6 +104,11 @@ QemuTpmInitPPI ( return Status; } + if (Config.TpmVersion != QEMU_TPM_VERSION_2) { +DEBUG ((DEBUG_ERROR, "[TPM2PP] Not setting up PPI. This is not a TPM 2.\n")); +return EFI_PROTOCOL_ERROR; + } + mPpi = (QEMU_TPM_PPI *)(UINTN)Config.PpiAddress; if (mPpi == NULL) { return EFI_PROTOCOL_ERROR; @@ -131,21 +135,18 @@ QemuTpmInitPPI ( goto InvalidPpiAddress; } - for (Idx = 0; Idx < ARRAY_SIZE (mPpi->Func); Idx++) { -mPpi->Func[Idx] = 0; - } - if (Config.TpmVersion == QEMU_TPM_VERSION_2) { -mPpi->Func[TCG2_PHYSICAL_PRESENCE_NO_ACTION] = TPM_PPI_FLAGS; -mPpi->Func[TCG2_PHYSICAL_PRESENCE_CLEAR] = TPM_PPI_FLAGS; -mPpi->Func[TCG2_PHYSICAL_PRESENCE_ENABLE_CLEAR] = TPM_PPI_FLAGS; -mPpi->Func[TCG2_PHYSICAL_PRESENCE_ENABLE_CLEAR_2] = TPM_PPI_FLAGS; -mPpi->Func[TCG2_PHYSICAL_PRESENCE_ENABLE_CLEAR_3] = TPM_PPI_FLAGS; -mPpi->Func[TCG2_PHYSICAL_PRESENCE_SET_PCR_BANKS] = TPM_PPI_FLAGS; -mPpi->Func[TCG2_PHYSICAL_PRESENCE_CHANGE_EPS] = TPM_PPI_FLAGS; -mPpi->Func[TCG2_PHYSICAL_PRESENCE_LOG_ALL_DIGESTS] = TPM_PPI_FLAGS; -mPpi->Func[TCG2_PHYSICAL_PRESENCE_ENABLE_BLOCK_SID] = TPM_PPI_FLAGS; -mPpi->Func[TCG2_PHYSICAL_PRESENCE_DISABLE_BLOCK_SID] = TPM_PPI_FLAGS; - } + ZeroMem ((void *)mPpi->Func, sizeof(mPpi->Func)); + + mPpi->Func[TCG2_PHYSICAL_PRESENCE_NO_ACTION] = TPM_PPI_FLAGS; + mPpi->Func[TCG2_PHYSICAL_PRESENCE_CLEAR] = TPM_PPI_FLAGS; + mPpi->Func[TCG2_PHYSICAL_PRESENCE_ENABLE_CLEAR] = TPM_PPI_FLAGS; + mPpi->Func[TCG2_PHYSICAL_PRESENCE_ENABLE_CLEAR_2] = TPM_PPI_FLAGS; + mPpi->Func[TCG2_PHYSICAL_PRESENCE_ENABLE_CLEAR_3] = TPM_PPI_FLAGS; + mPpi->Func[TCG2_PHYSICAL_PRESENCE_SET_PCR_BANKS] = TPM_PPI_FLAGS; + mPpi->Func[TCG2_PHYSICAL_PRESENCE_CHANGE_EPS] = TPM_PPI_FLAGS; + mPpi->Func[TCG2_PHYSICAL_PRESENCE_LOG_ALL_DIGESTS] = TPM_PPI_FLAGS; + mPpi->Func[TCG2_PHYSICAL_PRESENCE_ENABLE_BLOCK_SID] = TPM_PPI_FLAGS; + mPpi->Func[TCG2_PHYSICAL_PRESENCE_DISABLE_BLOCK_SID] = TPM_PPI_FLAGS; if (mPpi->In == 0) { mPpi->In = 1; @@ -833,10 +834,11 @@ Tcg2PhysicalPresenceLibProcessRequest ( Status = QemuTpmInitPPI (); if (EFI_ERROR (Status)) { -DEBUG ((DEBUG_INFO, "[TPM2PP] no PPI\n")); return ; } + DEBUG ((DEBUG_INFO, "[TPM2PP] Detected a TPM 2\n")); + // // Check S4 resume // -- 2.31.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84231): https://edk2.groups.io/g/devel/message/84231 Mute This Topic: https://groups.io/mt/87436459/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v3 4/8] SecurityPkg: Declare PhysicalPresenceFlags variable and its properties
Declare the TPM 1.2 PhysicalPresenceFlags variable and its properties. The effect of its properties is that once PhysicalPresenceFlags is defined it cannot be deleted from Linux: cd /sys/firmware/efi/efivars chattr -i PhysicalPresenceFlags-* rm -f PhysicalPresenceFlags-* It will still be there: ls PhysicalPresenceFlags-* Signed-off-by: Stefan Berger --- .../Library/AuthVariableLib/AuthServiceInternal.h | 1 + SecurityPkg/Library/AuthVariableLib/AuthVariableLib.c | 11 +++ .../Library/AuthVariableLib/AuthVariableLib.inf | 4 3 files changed, 16 insertions(+) diff --git a/SecurityPkg/Library/AuthVariableLib/AuthServiceInternal.h b/SecurityPkg/Library/AuthVariableLib/AuthServiceInternal.h index 2bec637f75..fc2abdb96c 100644 --- a/SecurityPkg/Library/AuthVariableLib/AuthServiceInternal.h +++ b/SecurityPkg/Library/AuthVariableLib/AuthServiceInternal.h @@ -30,6 +30,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include +#include #define TWO_BYTE_ENCODE 0x82 diff --git a/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.c b/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.c index 122b3b0bf4..ae75f32d40 100644 --- a/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.c +++ b/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.c @@ -89,6 +89,17 @@ VARIABLE_ENTRY_PROPERTY mAuthVarEntry[] = { MAX_UINTN } }, + { +&gEfiPhysicalPresenceGuid, +PHYSICAL_PRESENCE_FLAGS_VARIABLE, +{ + VAR_CHECK_VARIABLE_PROPERTY_REVISION, + VAR_CHECK_VARIABLE_PROPERTY_READ_ONLY, + VARIABLE_ATTRIBUTE_NV_BS, + sizeof (EFI_PHYSICAL_PRESENCE_FLAGS), + MAX_UINTN +} + } }; VOID **mAuthVarAddressPointer[9]; diff --git a/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf b/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf index 8eadeebceb..d0ced0792c 100644 --- a/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf +++ b/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf @@ -75,6 +75,10 @@ ## PRODUCES## Variable:L"certdbv" gEfiCertDbGuid + ## CONSUMES## Variable:L"PhysicalPresenceFlags" + ## PRODUCES## Variable:L"PhysicalPresenceFlags" + gEfiPhysicalPresenceGuid + ## CONSUMES## Variable:L"VendorKeysNv" ## PRODUCES## Variable:L"VendorKeysNv" gEfiVendorKeysNvGuid -- 2.31.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84230): https://edk2.groups.io/g/devel/message/84230 Mute This Topic: https://groups.io/mt/87436455/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v3 7/8] OvmfPkg: Enable TPM 1.2 Physical Presence Opcode processing
Enable the processing of the TPM 1.2 physical presence opcodes. This needs to be done before End-of-Dxe since otherwise the creation of the variables doesn't work. Signed-off-by: Stefan Berger --- OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 2 ++ OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c | 2 ++ OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c index 1765026de2..9c96c0cf69 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c @@ -379,7 +379,9 @@ PlatformBootManagerBeforeConsole ( // // Process TPM PPI request; this may require keyboard input + // For variable creation and locking to work, this has to be done before End-of-Dxe. // + TcgPhysicalPresenceLibProcessRequest (); Tcg2PhysicalPresenceLibProcessRequest (NULL); // diff --git a/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c index 950ab12c94..e9b4831bef 100644 --- a/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c @@ -372,7 +372,9 @@ PlatformBootManagerBeforeConsole ( // // Process TPM PPI request + // For variable creation and locking to work, this has to be done before End-of-Dxe. // + TcgPhysicalPresenceLibProcessRequest (); Tcg2PhysicalPresenceLibProcessRequest (NULL); // diff --git a/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c index fbc40dcb68..a6a9374505 100644 --- a/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c @@ -335,7 +335,9 @@ PlatformBootManagerBeforeConsole ( // // Process TPM PPI request + // For variable creation and locking to work, this has to be done before End-of-Dxe. // + TcgPhysicalPresenceLibProcessRequest (); Tcg2PhysicalPresenceLibProcessRequest (NULL); // -- 2.31.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84229): https://edk2.groups.io/g/devel/message/84229 Mute This Topic: https://groups.io/mt/87436454/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v3 8/8] OvmfPkg: add TPM 1.2 config menu
From: Gerd Hoffmann When building OVMF with TPM 1.2 support enabled also include the configuration menu. Suggested-by: Stefan Berger Signed-off-by: Gerd Hoffmann Signed-off-by: Stefan Berger --- OvmfPkg/OvmfTpmComponentsDxe.dsc.inc | 1 + OvmfPkg/OvmfTpmDxe.fdf.inc | 1 + 2 files changed, 2 insertions(+) diff --git a/OvmfPkg/OvmfTpmComponentsDxe.dsc.inc b/OvmfPkg/OvmfTpmComponentsDxe.dsc.inc index 75ae09571e..cdcae42ad1 100644 --- a/OvmfPkg/OvmfTpmComponentsDxe.dsc.inc +++ b/OvmfPkg/OvmfTpmComponentsDxe.dsc.inc @@ -20,6 +20,7 @@ Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLibDTpm.inf } + SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDxe.inf !endif SecurityPkg/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf { diff --git a/OvmfPkg/OvmfTpmDxe.fdf.inc b/OvmfPkg/OvmfTpmDxe.fdf.inc index 7fc2bf8590..5907d8a8f1 100644 --- a/OvmfPkg/OvmfTpmDxe.fdf.inc +++ b/OvmfPkg/OvmfTpmDxe.fdf.inc @@ -5,6 +5,7 @@ !if $(TPM2_ENABLE) == TRUE !if $(TPM1_ENABLE) == TRUE INF SecurityPkg/Tcg/TcgDxe/TcgDxe.inf +INF SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDxe.inf !endif INF SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf INF SecurityPkg/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf -- 2.31.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84228): https://edk2.groups.io/g/devel/message/84228 Mute This Topic: https://groups.io/mt/87436451/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v3 6/8] OvmfPkg: Enable physical presence interface for TPM 1.2
Enable the physical presence interface for TPM 1.2. It is required for the TPM 1.2 menu to work. The changes to DxeTcgPhysicalPresenceLib.c are due to the device we are using in QEMU for presenting the supported PPI commands and results to the OS via ACPI as well as to store the PPI opcode to execute. Cc: Jiewen Yao Cc: Jian J Wang Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Gerd Hoffmann Cc: Marc-André Lureau Signed-off-by: Stefan Berger --- OvmfPkg/Bhyve/BhyveX64.dsc| 1 + .../PlatformBootManagerLib/BdsPlatform.c | 1 + .../PlatformBootManagerLib.inf| 1 + .../DxeTcgPhysicalPresenceLib.c | 22 + .../DxeTcgPhysicalPresenceLib.inf | 27 + .../DxeTcgPhysicalPresenceLib.c | 481 +- .../DxeTcgPhysicalPresenceLib.inf | 14 +- OvmfPkg/Microvm/MicrovmX64.dsc| 1 + OvmfPkg/OvmfTpmLibs.dsc.inc | 4 + OvmfPkg/OvmfXen.dsc | 1 + .../Include/Library/TcgPhysicalPresenceLib.h | 39 ++ SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDxe.inf | 1 + 12 files changed, 342 insertions(+), 251 deletions(-) create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibNull/DxeTcgPhysicalPresenceLib.c create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibNull/DxeTcgPhysicalPresenceLib.inf diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc index d8fe607d1c..c848451a2b 100644 --- a/OvmfPkg/Bhyve/BhyveX64.dsc +++ b/OvmfPkg/Bhyve/BhyveX64.dsc @@ -223,6 +223,7 @@ XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf + TcgPhysicalPresenceLib|OvmfPkg/Library/TcgPhysicalPresenceLibNull/DxeTcgPhysicalPresenceLib.inf TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf [LibraryClasses.common] diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c index 2905356fc4..1765026de2 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c @@ -12,6 +12,7 @@ #include #include #include +#include #include diff --git a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf index c249a3cf1e..f12975d065 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -54,6 +54,7 @@ ReportStatusCodeLib UefiLib PlatformBmPrintScLib + TcgPhysicalPresenceLib Tcg2PhysicalPresenceLib XenPlatformLib diff --git a/OvmfPkg/Library/TcgPhysicalPresenceLibNull/DxeTcgPhysicalPresenceLib.c b/OvmfPkg/Library/TcgPhysicalPresenceLibNull/DxeTcgPhysicalPresenceLib.c new file mode 100644 index 00..d434175717 --- /dev/null +++ b/OvmfPkg/Library/TcgPhysicalPresenceLibNull/DxeTcgPhysicalPresenceLib.c @@ -0,0 +1,22 @@ +/** @file + NULL TcgPhysicalPresenceLib library instance + + Copyright (C) 2021, IBM Corporation + Copyright (c) 2018, Red Hat, Inc. + Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved. + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +VOID +EFIAPI +TcgPhysicalPresenceLibProcessRequest ( + VOID + ) +{ + // + // do nothing + // +} diff --git a/OvmfPkg/Library/TcgPhysicalPresenceLibNull/DxeTcgPhysicalPresenceLib.inf b/OvmfPkg/Library/TcgPhysicalPresenceLibNull/DxeTcgPhysicalPresenceLib.inf new file mode 100644 index 00..4421c6c5b0 --- /dev/null +++ b/OvmfPkg/Library/TcgPhysicalPresenceLibNull/DxeTcgPhysicalPresenceLib.inf @@ -0,0 +1,27 @@ +# NULL TcgPhysicalPresenceLib library instance +# +# Under SecurityPkg, the corresponding library instance will check and +# execute TPM 1.2 request from OS or BIOS; the request may ask for user +# confirmation before execution. This Null instance implements a no-op +# Tcg2PhysicalPresenceLibProcessRequest(), without user interaction. +# +# Copyright (C) 2018, Red Hat, Inc. +# Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved. +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION= 0x00010005 + BASE_NAME = DxeTcgPhysicalPresenceLibNull + FILE_GUID = B648575C-ED00-4C0D-BD7F-B705B9B0CC93 + MODULE_TYPE= DXE_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = TcgPhysicalPresenceLib|DXE_DRIVER DXE_RUNTIME_DRIVER UEFI_APPLICATION UEFI_DRIVER + +[Sources] + DxeTcgPhysicalPresenceLib.c + +[Packages] + MdePkg/MdePkg.dec + SecurityPkg/SecurityPkg.dec diff --git a/OvmfPkg/Library/TcgPhysicalPresenceLibQemu/DxeTcgPhysicalPresenceLib.c b/OvmfPkg/Library/T
[edk2-devel] [PATCH v3 5/8] OvmfPkg: Copy TPM 1.2 DxeTcgPhysicalPresenceLib.c from SecurityPkg
Copy the TPM 1.2 physical presence interface support from SecurityPkg DxeTcgPhysicalPresenceLib.c along with its .inf and .uni files into OvmfPkg. Fix EFI_F_INFO and EFI_D_ERROR to meet code standards. Signed-off-by: Stefan Berger --- .../DxeTcgPhysicalPresenceLib.c | 1455 + .../DxeTcgPhysicalPresenceLib.inf | 64 + .../DxeTcgPhysicalPresenceLib.uni | 22 + .../PhysicalPresenceStrings.uni | 46 + 4 files changed, 1587 insertions(+) create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibQemu/DxeTcgPhysicalPresenceLib.c create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibQemu/DxeTcgPhysicalPresenceLib.inf create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibQemu/DxeTcgPhysicalPresenceLib.uni create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibQemu/PhysicalPresenceStrings.uni diff --git a/OvmfPkg/Library/TcgPhysicalPresenceLibQemu/DxeTcgPhysicalPresenceLib.c b/OvmfPkg/Library/TcgPhysicalPresenceLibQemu/DxeTcgPhysicalPresenceLib.c new file mode 100644 index 00..8a3ae95012 --- /dev/null +++ b/OvmfPkg/Library/TcgPhysicalPresenceLibQemu/DxeTcgPhysicalPresenceLib.c @@ -0,0 +1,1455 @@ +/** @file + + Execute pending TPM requests from OS or BIOS and Lock TPM. + + Caution: This module requires additional review when modified. + This driver will have external input - variable. + This external input must be validated carefully to avoid security issue. + + ExecutePendingTpmRequest() will receive untrusted input and do validation. + +Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. +SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define CONFIRM_BUFFER_SIZE 4096 + +EFI_HII_HANDLE mPpStringPackHandle; + +/** + Get string by string id from HII Interface. + + @param[in] Id String ID. + + @retvalCHAR16 *String from ID. + @retvalNULLIf error occurs. + +**/ +CHAR16 * +PhysicalPresenceGetStringById ( + IN EFI_STRING_ID Id + ) +{ + return HiiGetString (mPpStringPackHandle, Id, NULL); +} + +/** + Get TPM physical presence permanent flags. + + @param[in] TcgProtocol EFI TCG Protocol instance. + @param[out] LifetimeLock physicalPresenceLifetimeLock permanent flag. + @param[out] CmdEnable physicalPresenceCMDEnable permanent flag. + + @retval EFI_SUCCESS Flags were returns successfully. + @retval other Failed to locate EFI TCG Protocol. + +**/ +EFI_STATUS +GetTpmCapability ( + IN EFI_TCG_PROTOCOL *TcgProtocol, + OUT BOOLEAN *LifetimeLock, + OUT BOOLEAN *CmdEnable + ) +{ + EFI_STATUSStatus; + TPM_RQU_COMMAND_HDR *TpmRqu; + TPM_RSP_COMMAND_HDR *TpmRsp; + UINT32*SendBufPtr; + UINT8 SendBuffer[sizeof (*TpmRqu) + sizeof (UINT32) * 3]; + TPM_PERMANENT_FLAGS *TpmPermanentFlags; + UINT8 RecvBuffer[40]; + + // + // Fill request header + // + TpmRsp = (TPM_RSP_COMMAND_HDR*)RecvBuffer; + TpmRqu = (TPM_RQU_COMMAND_HDR*)SendBuffer; + + TpmRqu->tag = SwapBytes16 (TPM_TAG_RQU_COMMAND); + TpmRqu->paramSize = SwapBytes32 (sizeof (SendBuffer)); + TpmRqu->ordinal = SwapBytes32 (TPM_ORD_GetCapability); + + // + // Set request parameter + // + SendBufPtr = (UINT32*)(TpmRqu + 1); + WriteUnaligned32 (SendBufPtr++, SwapBytes32 (TPM_CAP_FLAG)); + WriteUnaligned32 (SendBufPtr++, SwapBytes32 (sizeof (TPM_CAP_FLAG_PERMANENT))); + WriteUnaligned32 (SendBufPtr, SwapBytes32 (TPM_CAP_FLAG_PERMANENT)); + + Status = TcgProtocol->PassThroughToTpm ( + TcgProtocol, + sizeof (SendBuffer), + (UINT8*)TpmRqu, + sizeof (RecvBuffer), + (UINT8*)&RecvBuffer + ); + if (EFI_ERROR (Status)) { +return Status; + } + + if ((TpmRsp->tag != SwapBytes16 (TPM_TAG_RSP_COMMAND)) || (TpmRsp->returnCode != 0)) { +return EFI_DEVICE_ERROR; + } + + TpmPermanentFlags = (TPM_PERMANENT_FLAGS *)&RecvBuffer[sizeof (TPM_RSP_COMMAND_HDR) + sizeof (UINT32)]; + + if (LifetimeLock != NULL) { +*LifetimeLock = TpmPermanentFlags->physicalPresenceLifetimeLock; + } + + if (CmdEnable != NULL) { +*CmdEnable = TpmPermanentFlags->physicalPresenceCMDEnable; + } + + return Status; +} + +/** + Issue TSC_PhysicalPresence command to TPM. + + @param[in] TcgProtocol EFI TCG Protocol instance. + @param[in] PhysicalPresence The state to set the TPM's Physical Presence flags. + + @retval EFI_SUCCESS TPM executed the command successfully. + @retval EFI_SECURITY_VIOLATION TPM returned error
[edk2-devel] [PATCH v3 0/8] Add support for TPM 1.2 Physical Presence Interface and Menu
This series adds support for the full TPM 1.2 Physical Presence Interface (PPI) and activates the TPM 1.2 menu at the end. PPI is a prerequisite for the menu to work. The modifications to the original code are mostly due to the fact that we are using a memory region for PPI in QEMU. I tried to keep them at a minimum. For the PPI Flags I am using a EFI variable just like the original code does. (SecurityPkg/Library/DxeTcgPhysicalPresenceLib/DxeTcgPhysicalPresenceLib.c) The PhysicalPresenceFlags variable is write-protected (since v3) by adding an entry to AuthVariableLib.c. The consequence of locking the variable is that the processing of the physical presence opcodes, and with that write-access to that variable, had to be moved to before the end-of-DXE because afterwards it cannot be changed anymore. Regards, Stefan v3: - Moved processing of physical presence opcodes to before end-of-DXE - Write-protected PhysicalPresenceFlags variable by entry in AuthVariableLib.c v2: - Added patch that copies sources from SecurityPkg to OvmfPkg before changes - Use CONSTRUCTOR from DxeTcgPhysicalPresenceLib.inf - Other nits Gerd Hoffmann (1): OvmfPkg: add TPM 1.2 config menu Stefan Berger (7): OvmfPkg: Move processing of physical presence opcode before End-of-Dxe OvmfPkg: Check for TPM 2 early to leave function early SecurityPkg: Store physical presence code by submitting to PreOS func SecurityPkg: Declare PhysicalPresenceFlags variable and its properties OvmfPkg: Copy TPM 1.2 DxeTcgPhysicalPresenceLib.c from SecurityPkg OvmfPkg: Enable physical presence interface for TPM 1.2 OvmfPkg: Enable TPM 1.2 Physical Presence Opcode processing OvmfPkg/Bhyve/BhyveX64.dsc|1 + .../PlatformBootManagerLib/BdsPlatform.c | 23 +- .../PlatformBootManagerLib.inf|1 + .../PlatformBootManagerLibBhyve/BdsPlatform.c | 20 +- .../PlatformBootManagerLibGrub/BdsPlatform.c | 20 +- .../DxeTcg2PhysicalPresenceLib.c | 36 +- .../DxeTcgPhysicalPresenceLib.c | 22 + .../DxeTcgPhysicalPresenceLib.inf | 27 + .../DxeTcgPhysicalPresenceLib.c | 1448 + .../DxeTcgPhysicalPresenceLib.inf | 64 + .../DxeTcgPhysicalPresenceLib.uni | 22 + .../PhysicalPresenceStrings.uni | 46 + OvmfPkg/Microvm/MicrovmX64.dsc|1 + OvmfPkg/OvmfTpmComponentsDxe.dsc.inc |1 + OvmfPkg/OvmfTpmDxe.fdf.inc|1 + OvmfPkg/OvmfTpmLibs.dsc.inc |4 + OvmfPkg/OvmfXen.dsc |1 + .../Include/Library/TcgPhysicalPresenceLib.h | 39 + .../AuthVariableLib/AuthServiceInternal.h |1 + .../Library/AuthVariableLib/AuthVariableLib.c | 11 + .../AuthVariableLib/AuthVariableLib.inf |4 + .../DxeTcgPhysicalPresenceLib.c | 55 + SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDxe.inf |1 + SecurityPkg/Tcg/TcgConfigDxe/TcgConfigImpl.c | 41 +- 24 files changed, 1819 insertions(+), 71 deletions(-) create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibNull/DxeTcgPhysicalPresenceLib.c create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibNull/DxeTcgPhysicalPresenceLib.inf create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibQemu/DxeTcgPhysicalPresenceLib.c create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibQemu/DxeTcgPhysicalPresenceLib.inf create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibQemu/DxeTcgPhysicalPresenceLib.uni create mode 100644 OvmfPkg/Library/TcgPhysicalPresenceLibQemu/PhysicalPresenceStrings.uni -- 2.31.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84225): https://edk2.groups.io/g/devel/message/84225 Mute This Topic: https://groups.io/mt/87436447/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v3 1/8] OvmfPkg: Move processing of physical presence opcode before End-of-Dxe
For variable creation and locking to work later on we need to move the processing of the TPM physical presence opcode to before End-of-Dxe. Signed-off-by: Stefan Berger --- .../PlatformBootManagerLib/BdsPlatform.c | 20 +-- .../PlatformBootManagerLibBhyve/BdsPlatform.c | 18 - .../PlatformBootManagerLibGrub/BdsPlatform.c | 18 - 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c index 186401296a..2905356fc4 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c @@ -371,6 +371,16 @@ PlatformBootManagerBeforeConsole ( // EfiEventGroupSignal (&gRootBridgesConnectedEventGroupGuid); + // We need to connect all trusted consoles for TCG PP. Here we treat all + // consoles in OVMF to be trusted consoles. + PlatformInitializeConsole ( +XenDetected() ? gXenPlatformConsole : gPlatformConsole); + + // + // Process TPM PPI request; this may require keyboard input + // + Tcg2PhysicalPresenceLibProcessRequest (NULL); + // // We can't signal End-of-Dxe earlier than this. Namely, End-of-Dxe triggers // the preparation of S3 system information. That logic has a hard dependency @@ -388,16 +398,6 @@ PlatformBootManagerBeforeConsole ( SaveS3BootScript (); } - // We need to connect all trusted consoles for TCG PP. Here we treat all - // consoles in OVMF to be trusted consoles. - PlatformInitializeConsole ( -XenDetected() ? gXenPlatformConsole : gPlatformConsole); - - // - // Process TPM PPI request; this may require keyboard input - // - Tcg2PhysicalPresenceLibProcessRequest (NULL); - // // Prevent further changes to LockBoxes or SMRAM. // Any TPM 2 Physical Presence Interface opcode must be handled before. diff --git a/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c index e767c3b172..950ab12c94 100644 --- a/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c @@ -366,15 +366,6 @@ PlatformBootManagerBeforeConsole ( // EfiEventGroupSignal (&gRootBridgesConnectedEventGroupGuid); - // - // We can't signal End-of-Dxe earlier than this. Namely, End-of-Dxe triggers - // the preparation of S3 system information. That logic has a hard dependency - // on the presence of the FACS ACPI table. Since our ACPI tables are only - // installed after PCI enumeration completes, we must not trigger the S3 save - // earlier, hence we can't signal End-of-Dxe earlier. - // - EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid); - // We need to connect all trusted consoles for TCG PP. Here we treat all // consoles in OVMF to be trusted consoles. PlatformInitializeConsole (gPlatformConsole); @@ -384,6 +375,15 @@ PlatformBootManagerBeforeConsole ( // Tcg2PhysicalPresenceLibProcessRequest (NULL); + // + // We can't signal End-of-Dxe earlier than this. Namely, End-of-Dxe triggers + // the preparation of S3 system information. That logic has a hard dependency + // on the presence of the FACS ACPI table. Since our ACPI tables are only + // installed after PCI enumeration completes, we must not trigger the S3 save + // earlier, hence we can't signal End-of-Dxe earlier. + // + EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid); + // // Prevent further changes to LockBoxes or SMRAM. // Any TPM 2 Physical Presence Interface opcode must be handled before. diff --git a/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c index fd80577355..fbc40dcb68 100644 --- a/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c @@ -329,15 +329,6 @@ PlatformBootManagerBeforeConsole ( // EfiEventGroupSignal (&gRootBridgesConnectedEventGroupGuid); - // - // We can't signal End-of-Dxe earlier than this. Namely, End-of-Dxe triggers - // the preparation of S3 system information. That logic has a hard dependency - // on the presence of the FACS ACPI table. Since our ACPI tables are only - // installed after PCI enumeration completes, we must not trigger the S3 save - // earlier, hence we can't signal End-of-Dxe earlier. - // - EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid); - // We need to connect all trusted consoles for TCG PP. Here we treat all // consoles in OVMF to be trusted consoles. PlatformInitializeConsole (gPlatformConsole); @@ -347,6 +338,15 @@ PlatformBootManagerBeforeConsole ( // Tcg2PhysicalPresenceLibProcessRequest (NULL); + // + // We can't signal End-of-Dxe earlier than this. Namely, End-of-Dxe triggers + // the preparation of S3 system information. That logic has a hard dependency + // on the presence of the FACS
Re: [edk2-devel] Uncrustify Conversion Detailed Plan and Extended Hard Freeze Update #4
Hi Michael, This commit provides the background on why this content was copied into edk2 instead of used as a submodule. https://github.com/tianocore/edk2/commit/4751a48aeb2ab828b0a5cbdc585fd3642967cda1#diff-9f77cfa3b537eee28489f8713c17d8702330f5cef1795f154201dd463aabed27 I imagine the main reason for this request is to minimize the effort required to sync these copies with new versions. The scope right now is only 7 files. One alternative to help with the sync is for Abner to run uncrustify on the files from the upstream source on these 7 files and then do the diff to see if there is anything significant that needs to be merged. Abner, are you ok with doing this 2 step process to sync the files that were copied? Best regards, Mike > -Original Message- > From: Michael Kubacki > Sent: Wednesday, December 1, 2021 9:05 AM > To: devel@edk2.groups.io; Kinney, Michael D ; > Chang, Abner ; Wang, Jian J > ; Michael Kubacki ; > Andrew Fish (af...@apple.com) ; > Leif Lindholm > Subject: Re: [edk2-devel] Uncrustify Conversion Detailed Plan and Extended > Hard Freeze Update #4 > > This can of course be done at a technical level but it smells of a code > cohesion problem. > > The code is in the edk2 project so it would reason that it should be > uniform in style with other code and at least close to the EDK II C > Coding Standard Specification. > > Currently, git submodules and ignored path are already excluded in > addition to the ability to mark packages in "audit mode" so they do not > fail the results. I would personally prefer not to allow arbitrary > subdirectories to diverge from the rest of the codebase / package but if > there's consensus this is a good idea, I can look into adding it. > > Regards, > Michael > > On 12/1/2021 11:43 AM, Michael D Kinney wrote: > > Hi Abner, > > > > Yes. That is possible. We are already excluding BaseTools. > > > > In order to get the file lists that apply to uncrustify, we would have to > > change from: > > > > git ls-files *.c *.h :!BaseTools/* > > > > To: > > > > git ls-files *.c *.h :!BaseTools/* > > :!RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/* > > > > However, I do not see a feature in the UncrustifyCheck to check all c/h > > files in RedFishPkg and exclude one of its > directories. > > If we can specify an exclusion like this in the RedFishPkg YAML file, then > > I think that would work well. > > > > Michael Kubacki would have to comment on how we support this in EDK II CI > > checks. > > > > Best regards, > > > > Mike > > > > > >> -Original Message- > >> From: devel@edk2.groups.io On Behalf Of Abner Chang > >> Sent: Tuesday, November 30, 2021 11:34 PM > >> To: devel@edk2.groups.io; Wang, Jian J ; Kinney, > >> Michael D ; Michael > >> Kubacki ; Andrew Fish (af...@apple.com) > >> ; Leif Lindholm > >> > >> Subject: Re: [edk2-devel] Uncrustify Conversion Detailed Plan and Extended > >> Hard Freeze Update #4 > >> > >> Hi Mike, > >> Is that possible to not applying uncrusitify on the source files that > >> cloned from other open source? > >> e.g. RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/*.* > >> > >> Thanks > >> Abner > >> > >>> -Original Message- > >>> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > >>> Wang, Jian J > >>> Sent: Wednesday, December 1, 2021 2:39 PM > >>> To: devel@edk2.groups.io; Kinney, Michael D ; > >>> Michael Kubacki ; Andrew Fish > >>> (af...@apple.com) ; Leif Lindholm > >>> Subject: Re: [edk2-devel] Uncrustify Conversion Detailed Plan and Extended > >>> Hard Freeze Update #4 > >>> > >>> For SignedCapulePkg, > >>> > >>> Reviewed-by: Jian J Wang > >>> > >>> Regards, > >>> Jian > >>> > -Original Message- > From: devel@edk2.groups.io On Behalf Of > >>> Michael D > Kinney > Sent: Wednesday, December 01, 2021 6:34 AM > To: devel@edk2.groups.io; Kinney, Michael D > >>> ; > Michael Kubacki ; Andrew Fish > (af...@apple.com) ; Leif Lindholm > >>> > Subject: [edk2-devel] Uncrustify Conversion Detailed Plan and Extended > >>> Hard > Freeze Update #4 > > Hello, > > Thank you for your patience during this extended hard freeze. > > Just one more step to go. There has been a delay in the review of > the patch series with the uncrustify source changes. PR(6). This > patch series was not sent out as patch review email because of its > very large size. It only contains source style changes and the > CompareBuild tool and GitHub action has shown there are no binary > differences introduced with these source style changes. > > If you are a package maintainer, then please review the following > branch/PR for your package contents and review the EDK II CI results > and BuildCompare results. I do not expect a line by line review > because we already had time to provide feedback on the source style > performed by uncrustify.
Re: [edk2-devel] Uncrustify Conversion Detailed Plan and Extended Hard Freeze Update #4
This can of course be done at a technical level but it smells of a code cohesion problem. The code is in the edk2 project so it would reason that it should be uniform in style with other code and at least close to the EDK II C Coding Standard Specification. Currently, git submodules and ignored path are already excluded in addition to the ability to mark packages in "audit mode" so they do not fail the results. I would personally prefer not to allow arbitrary subdirectories to diverge from the rest of the codebase / package but if there's consensus this is a good idea, I can look into adding it. Regards, Michael On 12/1/2021 11:43 AM, Michael D Kinney wrote: Hi Abner, Yes. That is possible. We are already excluding BaseTools. In order to get the file lists that apply to uncrustify, we would have to change from: git ls-files *.c *.h :!BaseTools/* To: git ls-files *.c *.h :!BaseTools/* :!RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/* However, I do not see a feature in the UncrustifyCheck to check all c/h files in RedFishPkg and exclude one of its directories. If we can specify an exclusion like this in the RedFishPkg YAML file, then I think that would work well. Michael Kubacki would have to comment on how we support this in EDK II CI checks. Best regards, Mike -Original Message- From: devel@edk2.groups.io On Behalf Of Abner Chang Sent: Tuesday, November 30, 2021 11:34 PM To: devel@edk2.groups.io; Wang, Jian J ; Kinney, Michael D ; Michael Kubacki ; Andrew Fish (af...@apple.com) ; Leif Lindholm Subject: Re: [edk2-devel] Uncrustify Conversion Detailed Plan and Extended Hard Freeze Update #4 Hi Mike, Is that possible to not applying uncrusitify on the source files that cloned from other open source? e.g. RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/*.* Thanks Abner -Original Message- From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Wang, Jian J Sent: Wednesday, December 1, 2021 2:39 PM To: devel@edk2.groups.io; Kinney, Michael D ; Michael Kubacki ; Andrew Fish (af...@apple.com) ; Leif Lindholm Subject: Re: [edk2-devel] Uncrustify Conversion Detailed Plan and Extended Hard Freeze Update #4 For SignedCapulePkg, Reviewed-by: Jian J Wang Regards, Jian -Original Message- From: devel@edk2.groups.io On Behalf Of Michael D Kinney Sent: Wednesday, December 01, 2021 6:34 AM To: devel@edk2.groups.io; Kinney, Michael D ; Michael Kubacki ; Andrew Fish (af...@apple.com) ; Leif Lindholm Subject: [edk2-devel] Uncrustify Conversion Detailed Plan and Extended Hard Freeze Update #4 Hello, Thank you for your patience during this extended hard freeze. Just one more step to go. There has been a delay in the review of the patch series with the uncrustify source changes. PR(6). This patch series was not sent out as patch review email because of its very large size. It only contains source style changes and the CompareBuild tool and GitHub action has shown there are no binary differences introduced with these source style changes. If you are a package maintainer, then please review the following branch/PR for your package contents and review the EDK II CI results and BuildCompare results. I do not expect a line by line review because we already had time to provide feedback on the source style performed by uncrustify. Instead, a Reviewed-by for your package indicates that you have reviewed the EDK II CI results and CompareBuild tool functionality and results and you accept the source style changes to your package. * https://github.com/mdkinney/edk2/tree/Bug_3737_3739_ApplyUncrustifyC han ges_V5 * https://github.com/tianocore/edk2/pull/2229 * https://github.com/mdkinney/edk2/actions/runs/1521618836 Additional details on this update below. Thank you, Mike Changes from Update #3 * Pushed PR (5) * Added link to PR(6). EDK II CI Status is PASS. Build Compare PASS. * Waiting for review of PR (6) * Review of PR (7) completed and waiting for review of PR (6) Changes from Update #2 * Changed order of PRs swapping (4) and (5). The PR that activates increases the max CI agent job time is independent of all the other PRs and its review is complete, so it can be committed now. * Pushed PRs (1), (2), (3), (4). * Waiting for review to complete for PRs (5) and (6) * Reviews complete for PR (7) * Identifies steps using git filter-branch to apply uncrustify changes to a code review patch series that was generated before the uncrustify changes avoiding manual merge. * Identified steps using git filter-repo to generate an alternate history of the edk2 repo with uncrustify changes applied on every commit. This may be useful when evaluating changes t
Re: [edk2-devel] EDK2 doxygen documentation - adding docs for stable tags?
Hi Rebecca, It does not push to gitbook server. It is pushed to web pages hosted by GitHub. It uses gitbook tools to process MD files into published PDF, MOBI, HTML. For example, the EDK II Build Specification has repo in GitHub: https://github.com/tianocore-docs/edk2-BuildSpecification And the HTML version of the draft revision of this spec is published here: https://tianocore-docs.github.io/edk2-BuildSpecification/draft/ These are the web pages associated with tianocore-docs org. Thanks, Mike > -Original Message- > From: devel@edk2.groups.io On Behalf Of Rebecca Cran > Sent: Wednesday, December 1, 2021 8:52 AM > To: Kinney, Michael D ; devel@edk2.groups.io > Subject: Re: [edk2-devel] EDK2 doxygen documentation - adding docs for stable > tags? > > From what I can see, the tianocore-docs actions push to gitbooks, not > tianocore.org? > > I don't think gitbooks will work for the doxygen pages. > > > -- > > Rebecca Cran > > > On 11/30/21 20:21, Kinney, Michael D wrote: > > Hi Rebecca, > > > > This is a good idea. We use GitHub Actions to publish the EDK II > > Specifications > > to a web page hosted as part of the documents GitHub repo. > > > > I think we can do something similar for generating and publishing the > > doxygen > > generated web content for the edk2 packages. I think a manually triggered > > GitHub action in a repo in tianocore-docs organization might be a good place > > to do this so all document publication activities are under that same org. > > The GitHub action can take a branch or tag or sha of the edk2 repo as input > > to generate the doxygen documentation. > > > > Best regards, > > > > Mike > > > >> -Original Message- > >> From: devel@edk2.groups.io On Behalf Of Rebecca Cran > >> Sent: Tuesday, November 9, 2021 3:20 PM > >> To: devel@edk2.groups.io; disc...@edk2.groups.io > >> Subject: [edk2-devel] EDK2 doxygen documentation - adding docs for stable > >> tags? > >> > >> I've been hosting the Doxygen documentation for EDK2 at > >> https://bsdio.com/edk2/docs for a few years now. I previously had > >> versions for master, UDK2015, UDK2017, UDK2018 etc. but since migrating > >> my web server dropped everything except master. > >> > >> > >> I was wondering if people are finding it useful, and if so whether > >> they'd like me to generate documentation for each stable tag too? > >> > >> > >> Personally, _I_ find the web-based version (as opposed to a > >> locally-generated version) useful for the search feature -- being able > >> to quickly find the documentation for a certain function. > >> > >> > >> -- > >> > >> Rebecca Cran > >> > >> > >> > >> > >> > >> > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84220): https://edk2.groups.io/g/devel/message/84220 Mute This Topic: https://groups.io/mt/86944958/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] EDK2 doxygen documentation - adding docs for stable tags?
From what I can see, the tianocore-docs actions push to gitbooks, not tianocore.org? I don't think gitbooks will work for the doxygen pages. -- Rebecca Cran On 11/30/21 20:21, Kinney, Michael D wrote: Hi Rebecca, This is a good idea. We use GitHub Actions to publish the EDK II Specifications to a web page hosted as part of the documents GitHub repo. I think we can do something similar for generating and publishing the doxygen generated web content for the edk2 packages. I think a manually triggered GitHub action in a repo in tianocore-docs organization might be a good place to do this so all document publication activities are under that same org. The GitHub action can take a branch or tag or sha of the edk2 repo as input to generate the doxygen documentation. Best regards, Mike -Original Message- From: devel@edk2.groups.io On Behalf Of Rebecca Cran Sent: Tuesday, November 9, 2021 3:20 PM To: devel@edk2.groups.io; disc...@edk2.groups.io Subject: [edk2-devel] EDK2 doxygen documentation - adding docs for stable tags? I've been hosting the Doxygen documentation for EDK2 at https://bsdio.com/edk2/docs for a few years now. I previously had versions for master, UDK2015, UDK2017, UDK2018 etc. but since migrating my web server dropped everything except master. I was wondering if people are finding it useful, and if so whether they'd like me to generate documentation for each stable tag too? Personally, _I_ find the web-based version (as opposed to a locally-generated version) useful for the search feature -- being able to quickly find the documentation for a certain function. -- Rebecca Cran -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84219): https://edk2.groups.io/g/devel/message/84219 Mute This Topic: https://groups.io/mt/86944958/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] Uncrustify Conversion Detailed Plan and Extended Hard Freeze Update #4
Hi Abner, Yes. That is possible. We are already excluding BaseTools. In order to get the file lists that apply to uncrustify, we would have to change from: git ls-files *.c *.h :!BaseTools/* To: git ls-files *.c *.h :!BaseTools/* :!RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/* However, I do not see a feature in the UncrustifyCheck to check all c/h files in RedFishPkg and exclude one of its directories. If we can specify an exclusion like this in the RedFishPkg YAML file, then I think that would work well. Michael Kubacki would have to comment on how we support this in EDK II CI checks. Best regards, Mike > -Original Message- > From: devel@edk2.groups.io On Behalf Of Abner Chang > Sent: Tuesday, November 30, 2021 11:34 PM > To: devel@edk2.groups.io; Wang, Jian J ; Kinney, > Michael D ; Michael > Kubacki ; Andrew Fish (af...@apple.com) > ; Leif Lindholm > > Subject: Re: [edk2-devel] Uncrustify Conversion Detailed Plan and Extended > Hard Freeze Update #4 > > Hi Mike, > Is that possible to not applying uncrusitify on the source files that cloned > from other open source? > e.g. RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/*.* > > Thanks > Abner > > > -Original Message- > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > > Wang, Jian J > > Sent: Wednesday, December 1, 2021 2:39 PM > > To: devel@edk2.groups.io; Kinney, Michael D ; > > Michael Kubacki ; Andrew Fish > > (af...@apple.com) ; Leif Lindholm > > Subject: Re: [edk2-devel] Uncrustify Conversion Detailed Plan and Extended > > Hard Freeze Update #4 > > > > For SignedCapulePkg, > > > > Reviewed-by: Jian J Wang > > > > Regards, > > Jian > > > > > -Original Message- > > > From: devel@edk2.groups.io On Behalf Of > > Michael D > > > Kinney > > > Sent: Wednesday, December 01, 2021 6:34 AM > > > To: devel@edk2.groups.io; Kinney, Michael D > > ; > > > Michael Kubacki ; Andrew Fish > > > (af...@apple.com) ; Leif Lindholm > > > > > Subject: [edk2-devel] Uncrustify Conversion Detailed Plan and Extended > > Hard > > > Freeze Update #4 > > > > > > Hello, > > > > > > Thank you for your patience during this extended hard freeze. > > > > > > Just one more step to go. There has been a delay in the review of > > > the patch series with the uncrustify source changes. PR(6). This > > > patch series was not sent out as patch review email because of its > > > very large size. It only contains source style changes and the > > > CompareBuild tool and GitHub action has shown there are no binary > > > differences introduced with these source style changes. > > > > > > If you are a package maintainer, then please review the following > > > branch/PR for your package contents and review the EDK II CI results > > > and BuildCompare results. I do not expect a line by line review > > > because we already had time to provide feedback on the source style > > > performed by uncrustify. Instead, a Reviewed-by for your package > > > indicates that you have reviewed the EDK II CI results and CompareBuild > > > tool functionality and results and you accept the source style > > > changes to your package. > > > > > >* > > > > > https://github.com/mdkinney/edk2/tree/Bug_3737_3739_ApplyUncrustifyC > > han > > > ges_V5 > > >* https://github.com/tianocore/edk2/pull/2229 > > >* https://github.com/mdkinney/edk2/actions/runs/1521618836 > > > > > > Additional details on this update below. > > > > > > Thank you, > > > > > > Mike > > > > > > > > > Changes from Update #3 > > > > > > * Pushed PR (5) > > > * Added link to PR(6). EDK II CI Status is PASS. Build Compare PASS. > > > * Waiting for review of PR (6) > > > * Review of PR (7) completed and waiting for review of PR (6) > > > > > > > > > Changes from Update #2 > > > > > > * Changed order of PRs swapping (4) and (5). The PR that activates > > > increases the max CI agent job time is independent of all the other > > > PRs and its review is complete, so it can be committed now. > > > * Pushed PRs (1), (2), (3), (4). > > > * Waiting for review to complete for PRs (5) and (6) > > > * Reviews complete for PR (7) > > > * Identifies steps using git filter-branch to apply uncrustify changes to > > > a > > > code review patch series that was generated before the uncrustify > > changes > > > avoiding manual merge. > > > * Identified steps using git filter-repo to generate an alternate history > > > of > > > the edk2 repo with uncrustify changes applied on every commit. This may > > > be useful when evaluating changes to files using tools like git blame > > > without the large uncrustify patch series. > > > --- > > > > > > Chan
[edk2-devel] [PATCH 1/1] OvmfPkg/MemEncryptSevLib: Check the guest type before EsWorkarea access
The commit 80e67af9afca added support for a generic workarea concept. The workarea header contains the information of the guest type. The header is populated by ResetVector code during the guest detection. Currently, the InternalMemEncryptSevStatus() reads the EsWorkArea to determine the C-bit position. The EsWorkArea PCD is valid only for the SEV guest type. Add a check of the guest type before accessing the EsWorkArea PCD. Fixes: 80e67af9afca ("OvmfPkg: introduce a common work area") Cc: James Bottomley Cc: Min Xu Cc: Jiewen Yao Cc: Tom Lendacky Cc: Jordan Justen Cc: Ard Biesheuvel Cc: Erdem Aktas Cc: Gerd Hoffmann Cc: Qi Zhou Signed-off-by: Brijesh Singh --- .../DxeMemEncryptSevLib.inf | 2 + .../PeiMemEncryptSevLib.inf | 2 + .../SecMemEncryptSevLib.inf | 2 + .../PeiMemEncryptSevLibInternal.c | 50 +++- .../SecMemEncryptSevLibInternal.c | 58 ++- 5 files changed, 110 insertions(+), 4 deletions(-) diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf b/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf index f2e162d68076..03b66b986f1f 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf @@ -54,4 +54,6 @@ [FeaturePcd] gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire [Pcd] + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf b/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf index 03a78c32df28..16dd4d9d8b77 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf @@ -54,4 +54,6 @@ [FeaturePcd] gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire [FixedPcd] + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf b/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf index 279c38bfbc2c..a933cb33a9cb 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf @@ -48,4 +48,6 @@ [LibraryClasses] PcdLib [FixedPcd] + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c b/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c index e2fd109d120f..db4249ec0d7d 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c @@ -24,6 +24,52 @@ STATIC BOOLEAN mSevStatusChecked = FALSE; STATIC UINT64 mSevEncryptionMask = 0; STATIC BOOLEAN mSevEncryptionMaskSaved = FALSE; +/** + Determine if the SEV is active. + + During the early booting, GuestType is set in the work area. Verify that it + is an SEV guest. + + @retval TRUE SEV is enabled + @retval FALSE SEV is not enabled + + **/ +STATIC +BOOLEAN +IsSevGuest ( + VOID + ) +{ + OVMF_WORK_AREA *WorkArea; + + // + // Ensure that the size of the Confidential Computing work area header + // is same as what is provided through a fixed PCD. + // + ASSERT ((UINTN) FixedPcdGet32 (PcdOvmfConfidentialComputingWorkAreaHeader) == + sizeof(CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER)); + + WorkArea = (OVMF_WORK_AREA *) FixedPcdGet32 (PcdOvmfWorkAreaBase); + + return ((WorkArea != NULL) && (WorkArea->Header.GuestType == GUEST_TYPE_AMD_SEV)); +} + +STATIC +SEC_SEV_ES_WORK_AREA * +GetSevEsWorkArea ( + VOID + ) +{ + // + // Before accessing the Es workarea lets verify that its SEV guest + // + if (!IsSevGuest()) { +return NULL; + } + + return (SEC_SEV_ES_WORK_AREA *) FixedPcdGet32 (PcdSevEsWorkAreaBase); +} + /** Reads and sets the status of SEV features. @@ -43,7 +89,7 @@ InternalMemEncryptSevStatus ( ReadSevMsr = FALSE; - SevEsWorkArea = (SEC_SEV_ES_WORK_AREA *) FixedPcdGet32 (PcdSevEsWorkAreaBase); + SevEsWorkArea = GetSevEsWorkArea (); if (SevEsWorkArea != NULL && SevEsWorkArea->EncryptionMask != 0) { // // The MSR has been read before, so it is safe to read it again and avoid @@ -139,7 +185,7 @@ MemEncryptSevGetEncryptionMask ( if (!mSevEncryptionMaskSaved) { SEC_SEV_ES_WORK_AREA *SevEsWorkArea; -SevEsWorkArea = (SEC_SEV_ES_WORK_AREA *) FixedPcdGet32 (PcdSevEsWorkAreaBase); +SevEsWorkArea = GetSevEsWorkArea (); if (SevEsWorkArea != NULL) { mSevEncryptionMask = SevEs
Re: [edk2-devel] [Patch 02/12] ArmPlatformPkg: Update YAML to ignore specific ECC files/errors
Hi, If the exceptions to the yaml files are added to allow the unscrustify patches to pass the CI tests, shouldn't the same exceptions be removed once the patches are merged ? Regards, Pierre On 11/23/21 10:21 PM, Michael D Kinney via groups.io wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3749 > > Update package YAML files to ignore ECC errors that are > already present. These issues must be fixed in the future, > but should not block source code changes for these known > issues. > > Cc: Leif Lindholm > Cc: Ard Biesheuvel > Cc: Sean Brogan > Cc: Bret Barkelew > Cc: Liming Gao > Cc: Michael Kubacki > Signed-off-by: Michael D Kinney > --- > ArmPlatformPkg/ArmPlatformPkg.ci.yaml | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/ArmPlatformPkg/ArmPlatformPkg.ci.yaml > b/ArmPlatformPkg/ArmPlatformPkg.ci.yaml > index 3dbbcc673bf0..03632e74df73 100644 > --- a/ArmPlatformPkg/ArmPlatformPkg.ci.yaml > +++ b/ArmPlatformPkg/ArmPlatformPkg.ci.yaml > @@ -19,7 +19,8 @@ > ], > ## Both file path and directory path are accepted. > "IgnoreFiles": [ > -"Scripts/Ds5/" > +"Scripts/Ds5/", > +"Drivers/PL061GpioDxe/PL061Gpio.c" > ] > }, > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84216): https://edk2.groups.io/g/devel/message/84216 Mute This Topic: https://groups.io/mt/87268736/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 2/5] OvmfPkg: Create global entry point for SMBIOS parsing
From: Sebastien Boeuf Move the generic entry point part out of Qemu.c to anticipate the addition of new ways of retrieving the SMBIOS table. Signed-off-by: Sebastien Boeuf --- OvmfPkg/SmbiosPlatformDxe/EntryPoint.c| 47 +++ OvmfPkg/SmbiosPlatformDxe/Qemu.c | 35 -- .../SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 1 + 3 files changed, 48 insertions(+), 35 deletions(-) create mode 100644 OvmfPkg/SmbiosPlatformDxe/EntryPoint.c diff --git a/OvmfPkg/SmbiosPlatformDxe/EntryPoint.c b/OvmfPkg/SmbiosPlatformDxe/EntryPoint.c new file mode 100644 index 00..d3b1836a04 --- /dev/null +++ b/OvmfPkg/SmbiosPlatformDxe/EntryPoint.c @@ -0,0 +1,47 @@ +/** @file + Find and extract SMBIOS data. + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include // FreePool() + +#include "SmbiosPlatformDxe.h" + +UINT8 * +GetQemuSmbiosTables ( + VOID + ); + +/** + Installs SMBIOS information for OVMF + + @param ImageHandle Module's image handle + @param SystemTable Pointer of EFI_SYSTEM_TABLE + + @retval EFI_SUCCESSSmbios data successfully installed + @retval Other Smbios data was not installed + +**/ +EFI_STATUS +EFIAPI +SmbiosTablePublishEntry ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUSStatus; + UINT8 *SmbiosTables; + + Status = EFI_NOT_FOUND; + // + // Add QEMU SMBIOS data if found + // + SmbiosTables = GetQemuSmbiosTables (); + if (SmbiosTables != NULL) { +Status = InstallAllStructures (SmbiosTables); +FreePool (SmbiosTables); + } + + return Status; +} diff --git a/OvmfPkg/SmbiosPlatformDxe/Qemu.c b/OvmfPkg/SmbiosPlatformDxe/Qemu.c index a668c6ac21..56e720aa08 100644 --- a/OvmfPkg/SmbiosPlatformDxe/Qemu.c +++ b/OvmfPkg/SmbiosPlatformDxe/Qemu.c @@ -11,8 +11,6 @@ #include // PcdGetBool() #include // QemuFwCfgFindFile() -#include "SmbiosPlatformDxe.h" - /** Locates and extracts the QEMU SMBIOS data if present in fw_cfg @@ -48,36 +46,3 @@ GetQemuSmbiosTables ( return QemuTables; } - -/** - Installs SMBIOS information for OVMF - - @param ImageHandle Module's image handle - @param SystemTable Pointer of EFI_SYSTEM_TABLE - - @retval EFI_SUCCESSSmbios data successfully installed - @retval Other Smbios data was not installed - -**/ -EFI_STATUS -EFIAPI -SmbiosTablePublishEntry ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUSStatus; - UINT8 *SmbiosTables; - - Status = EFI_NOT_FOUND; - // - // Add QEMU SMBIOS data if found - // - SmbiosTables = GetQemuSmbiosTables (); - if (SmbiosTables != NULL) { -Status = InstallAllStructures (SmbiosTables); -FreePool (SmbiosTables); - } - - return Status; -} diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf index eaee73110d..e239a631f2 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf @@ -24,6 +24,7 @@ # [Sources] + EntryPoint.c Qemu.c SmbiosPlatformDxe.c SmbiosPlatformDxe.h -- 2.30.2 - Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84212): https://edk2.groups.io/g/devel/message/84212 Mute This Topic: https://groups.io/mt/87429205/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 0/5] Add Cloud Hypervisor support for x86
From: Sebastien Boeuf This series aims at adding the support for the Cloud Hypervisor platform to the OVMF firmware for x86 architecture. The goal is to allow the same binary to be used either by QEMU or Cloud Hypervisor, using the Cloud Hypervisor way as a fallback if the fw_cfg mechanism is not present. Sebastien Boeuf (5): OvmfPkg: Handle Cloud Hypervisor host bridge OvmfPkg: Create global entry point for SMBIOS parsing OvmfPkg: Retrieve SMBIOS from Cloud Hypervisor OvmfPkg: Generalize AcpiPlatformDxe OvmfPkg: Install ACPI tables for Cloud Hypervisor ArmVirtPkg/ArmVirtQemu.dsc| 2 +- ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 2 +- ArmVirtPkg/ArmVirtQemuKernel.dsc | 2 +- ...QemuFwCfgAcpiPlatform.c => AcpiPlatform.c} | 8 +- OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h| 6 + ...cpiPlatformDxe.inf => AcpiPlatformDxe.inf} | 5 +- OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 117 ++ OvmfPkg/AmdSev/AmdSevX64.dsc | 2 +- OvmfPkg/AmdSev/AmdSevX64.fdf | 2 +- OvmfPkg/Csm/CsmSupportLib/LegacyInterrupt.c | 1 + OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c | 1 + OvmfPkg/Csm/CsmSupportLib/LegacyRegion.h | 1 + OvmfPkg/Include/IndustryStandard/CloudHv.h| 45 +++ OvmfPkg/Include/OvmfPlatforms.h | 1 + .../Library/AcpiTimerLib/BaseAcpiTimerLib.c | 3 + .../AcpiTimerLib/BaseRomAcpiTimerLib.c| 4 + .../Library/AcpiTimerLib/DxeAcpiTimerLib.c| 3 + .../PlatformBootManagerLib/BdsPlatform.c | 1 + .../ResetSystemLib/BaseResetShutdown.c| 3 + .../Library/ResetSystemLib/DxeResetShutdown.c | 11 +- OvmfPkg/Microvm/MicrovmX64.dsc| 2 +- OvmfPkg/Microvm/MicrovmX64.fdf| 2 +- OvmfPkg/OvmfPkgIa32.dsc | 2 +- OvmfPkg/OvmfPkgIa32.fdf | 2 +- OvmfPkg/OvmfPkgIa32X64.dsc| 2 +- OvmfPkg/OvmfPkgIa32X64.fdf| 2 +- OvmfPkg/OvmfPkgX64.dsc| 2 +- OvmfPkg/OvmfPkgX64.fdf| 2 +- OvmfPkg/PlatformPei/MemDetect.c | 63 +- OvmfPkg/PlatformPei/Platform.c| 11 +- OvmfPkg/SmbiosPlatformDxe/CloudHv.c | 32 + OvmfPkg/SmbiosPlatformDxe/EntryPoint.c| 66 ++ OvmfPkg/SmbiosPlatformDxe/Qemu.c | 35 -- .../SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 2 + 34 files changed, 360 insertions(+), 85 deletions(-) rename OvmfPkg/AcpiPlatformDxe/{QemuFwCfgAcpiPlatform.c => AcpiPlatform.c} (73%) rename OvmfPkg/AcpiPlatformDxe/{QemuFwCfgAcpiPlatformDxe.inf => AcpiPlatformDxe.inf} (90%) create mode 100644 OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c create mode 100644 OvmfPkg/Include/IndustryStandard/CloudHv.h create mode 100644 OvmfPkg/SmbiosPlatformDxe/CloudHv.c create mode 100644 OvmfPkg/SmbiosPlatformDxe/EntryPoint.c -- 2.30.2 - Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84210): https://edk2.groups.io/g/devel/message/84210 Mute This Topic: https://groups.io/mt/87429203/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 4/5] OvmfPkg: Generalize AcpiPlatformDxe
From: Sebastien Boeuf Don't make the package Qemu centric so that we can introduce some alternative support for other VMMs not using the fw_cfg mechanism. Signed-off-by: Sebastien Boeuf --- ArmVirtPkg/ArmVirtQemu.dsc| 2 +- ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 2 +- ArmVirtPkg/ArmVirtQemuKernel.dsc | 2 +- .../{QemuFwCfgAcpiPlatform.c => AcpiPlatform.c} | 4 ++-- .../{QemuFwCfgAcpiPlatformDxe.inf => AcpiPlatformDxe.inf} | 4 ++-- OvmfPkg/AmdSev/AmdSevX64.dsc | 2 +- OvmfPkg/AmdSev/AmdSevX64.fdf | 2 +- OvmfPkg/Microvm/MicrovmX64.dsc| 2 +- OvmfPkg/Microvm/MicrovmX64.fdf| 2 +- OvmfPkg/OvmfPkgIa32.dsc | 2 +- OvmfPkg/OvmfPkgIa32.fdf | 2 +- OvmfPkg/OvmfPkgIa32X64.dsc| 2 +- OvmfPkg/OvmfPkgIa32X64.fdf| 2 +- OvmfPkg/OvmfPkgX64.dsc| 2 +- OvmfPkg/OvmfPkgX64.fdf| 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) rename OvmfPkg/AcpiPlatformDxe/{QemuFwCfgAcpiPlatform.c => AcpiPlatform.c} (78%) rename OvmfPkg/AcpiPlatformDxe/{QemuFwCfgAcpiPlatformDxe.inf => AcpiPlatformDxe.inf} (90%) diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 891e065311..84c28b0c1d 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -543,7 +543,7 @@ ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf [Components.AARCH64] MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf - OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf { + OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf { NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf } diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc index f6a538df72..d4df6dede0 100644 --- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc +++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc @@ -145,7 +145,7 @@ READ_LOCK_STATUS = TRUE !if $(ARCH) == AARCH64 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf - INF OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf + INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf # # EBC support diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc index a8bb83b288..8e82c5050f 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -458,7 +458,7 @@ ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf [Components.AARCH64] MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf - OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf { + OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf { NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf } diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatform.c b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c similarity index 78% rename from OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatform.c rename to OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c index 057a450af9..613a8ac97f 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatform.c +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c @@ -1,5 +1,5 @@ /** @file - OVMF ACPI Platform Driver using QEMU's fw-cfg interface + OVMF ACPI Platform Driver Copyright (C) 2015, Red Hat, Inc. Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved. @@ -10,7 +10,7 @@ #include "AcpiPlatform.h" /** - Effective entrypoint of QEMU fw-cfg Acpi Platform driver. + Effective entrypoint of Acpi Platform driver. @param ImageHandle @param SystemTable diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf similarity index 90% rename from OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf rename to OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf index dac25d1505..eedd3b5af3 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -1,5 +1,5 @@ ## @file -# OVMF ACPI Platform Driver using QEMU's fw-cfg interface +# OVMF ACPI Platform Driver # # Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -21,12 +21,12 @@ # [Sources] + AcpiPlatform.c AcpiPlatform.h BootScript.c EntryPoint.c PciDecoding.c QemuFwCfgAcpi.c - QemuFwCfgAcpiPlatform.c [Packages] MdeModulePkg/MdeModulePkg.dec diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc index 5ee5445116..14ab027f63 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.dsc +++ b/Ovmf
[edk2-devel] [PATCH 3/5] OvmfPkg: Retrieve SMBIOS from Cloud Hypervisor
From: Sebastien Boeuf Add a fallback on the SMBIOS code to find the SMBIOS table for Cloud Hypervisor if it couldn't be found for Qemu through fw_cfg. Signed-off-by: Rob Bradford Signed-off-by: Sebastien Boeuf --- OvmfPkg/Include/IndustryStandard/CloudHv.h| 5 +++ OvmfPkg/SmbiosPlatformDxe/CloudHv.c | 32 +++ OvmfPkg/SmbiosPlatformDxe/EntryPoint.c| 23 +++-- .../SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 1 + 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 OvmfPkg/SmbiosPlatformDxe/CloudHv.c diff --git a/OvmfPkg/Include/IndustryStandard/CloudHv.h b/OvmfPkg/Include/IndustryStandard/CloudHv.h index 6ab18ad50d..ad0e170795 100644 --- a/OvmfPkg/Include/IndustryStandard/CloudHv.h +++ b/OvmfPkg/Include/IndustryStandard/CloudHv.h @@ -32,4 +32,9 @@ // #define CLOUDHV_MMIO_HOLE_SIZE 0x3800 +// +// SMBIOS address +// +#define CLOUDHV_SMBIOS_ADDRESS 0xf + #endif // __CLOUDHV_H__ diff --git a/OvmfPkg/SmbiosPlatformDxe/CloudHv.c b/OvmfPkg/SmbiosPlatformDxe/CloudHv.c new file mode 100644 index 00..f56a810684 --- /dev/null +++ b/OvmfPkg/SmbiosPlatformDxe/CloudHv.c @@ -0,0 +1,32 @@ +/** @file + Find Cloud Hypervisor SMBIOS data. + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include // CLOUDHV_SMBIOS_ADDRESS +#include // SMBIOS_TABLE_3_0_ENTRY_POINT + +/** + Locates and extracts the QEMU SMBIOS data if present in fw_cfg + + @return Address of extracted QEMU SMBIOS data + +**/ +UINT8 * +GetCloudHvSmbiosTables ( + VOID + ) +{ + SMBIOS_TABLE_3_0_ENTRY_POINT *CloudHvTables = (VOID *)CLOUDHV_SMBIOS_ADDRESS; + + if (CloudHvTables->AnchorString[0] == '_' && + CloudHvTables->AnchorString[1] == 'S' && + CloudHvTables->AnchorString[2] == 'M' && + CloudHvTables->AnchorString[3] == '3' && + CloudHvTables->AnchorString[4] == '_') { +return (UINT8*)(UINTN)CloudHvTables->TableAddress; + } + + return NULL; +} diff --git a/OvmfPkg/SmbiosPlatformDxe/EntryPoint.c b/OvmfPkg/SmbiosPlatformDxe/EntryPoint.c index d3b1836a04..28faabb46a 100644 --- a/OvmfPkg/SmbiosPlatformDxe/EntryPoint.c +++ b/OvmfPkg/SmbiosPlatformDxe/EntryPoint.c @@ -8,6 +8,11 @@ #include "SmbiosPlatformDxe.h" +UINT8 * +GetCloudHvSmbiosTables ( + VOID + ); + UINT8 * GetQemuSmbiosTables ( VOID @@ -32,14 +37,28 @@ SmbiosTablePublishEntry ( { EFI_STATUSStatus; UINT8 *SmbiosTables; + BOOLEAN FreeTables = FALSE; Status = EFI_NOT_FOUND; // // Add QEMU SMBIOS data if found // SmbiosTables = GetQemuSmbiosTables (); - if (SmbiosTables != NULL) { -Status = InstallAllStructures (SmbiosTables); + if (SmbiosTables == NULL) { +SmbiosTables = GetCloudHvSmbiosTables (); +if (SmbiosTables == NULL) { + return EFI_NOT_FOUND; +} + } else { +FreeTables = TRUE; + } + + Status = InstallAllStructures (SmbiosTables); + + // + // Free SmbiosTables if allocated by Qemu. + // + if (FreeTables) { FreePool (SmbiosTables); } diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf index e239a631f2..365d96241e 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf @@ -24,6 +24,7 @@ # [Sources] + CloudHv.c EntryPoint.c Qemu.c SmbiosPlatformDxe.c -- 2.30.2 - Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84213): https://edk2.groups.io/g/devel/message/84213 Mute This Topic: https://groups.io/mt/87429206/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 5/5] OvmfPkg: Install ACPI tables for Cloud Hypervisor
From: Sebastien Boeuf Adding support for retrieving the Cloud Hypervisor ACPI tables as a fallback mechanism if tables are not found through fw_cfg. Signed-off-by: Rob Bradford Signed-off-by: Sebastien Boeuf --- OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c | 4 + OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h | 6 + OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 1 + OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 117 OvmfPkg/Include/IndustryStandard/CloudHv.h | 5 + 5 files changed, 133 insertions(+) create mode 100644 OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c index 613a8ac97f..abd1f550d4 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c @@ -29,5 +29,9 @@ InstallAcpiTables ( EFI_STATUS Status; Status = InstallQemuFwCfgTables (AcpiTable); + if (EFI_ERROR (Status)) { +Status = InstallCloudHvTables (AcpiTable); + } + return Status; } diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h index bd4c26f07f..bee48a93da 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h @@ -19,6 +19,12 @@ typedef struct { typedef struct S3_CONTEXT S3_CONTEXT; +EFI_STATUS +EFIAPI +InstallCloudHvTables ( + IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol + ); + EFI_STATUS EFIAPI InstallQemuFwCfgTables ( diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf index eedd3b5af3..3ac9054d75 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -24,6 +24,7 @@ AcpiPlatform.c AcpiPlatform.h BootScript.c + CloudHvAcpi.c EntryPoint.c PciDecoding.c QemuFwCfgAcpi.c diff --git a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c new file mode 100644 index 00..96c532cce6 --- /dev/null +++ b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c @@ -0,0 +1,117 @@ +/** @file + OVMF ACPI Cloud Hypervisor support + + Copyright (c) 2021, Intel Corporation. All rights reserved. + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include // CLOUDHV_RSDP_ADDRESS +#include // CpuDeadLoop() +#include // DEBUG() + +#include "AcpiPlatform.h" + +// Get the ACPI tables from EBDA start +EFI_STATUS +EFIAPI +InstallCloudHvTables ( + IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol + ) +{ + EFI_STATUS Status; + UINTNTableHandle; + + EFI_ACPI_DESCRIPTION_HEADER *Xsdt; + VOID *CurrentTableEntry; + UINTNCurrentTablePointer; + EFI_ACPI_DESCRIPTION_HEADER *CurrentTable; + UINTNIndex; + UINTNNumberOfTableEntries; + EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE*Fadt2Table; + EFI_ACPI_DESCRIPTION_HEADER *DsdtTable; + Fadt2Table = NULL; + DsdtTable = NULL; + TableHandle = 0; + NumberOfTableEntries = 0; + EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *AcpiRsdpStructurePtr = (VOID *)CLOUDHV_RSDP_ADDRESS; + + // If XSDT table is found, just install its tables. + // Otherwise, try to find and install the RSDT tables. + // + if (AcpiRsdpStructurePtr->XsdtAddress) { +// +// Retrieve the addresses of XSDT and +// calculate the number of its table entries. +// +Xsdt = (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) + AcpiRsdpStructurePtr->XsdtAddress; +NumberOfTableEntries = (Xsdt->Length - + sizeof (EFI_ACPI_DESCRIPTION_HEADER)) / + sizeof (UINT64); + +// +// Install ACPI tables found in XSDT. +// +for (Index = 0; Index < NumberOfTableEntries; Index++) { + // + // Get the table entry from XSDT + // + CurrentTableEntry = (VOID *) ((UINT8 *) Xsdt + +sizeof (EFI_ACPI_DESCRIPTION_HEADER) + +Index * sizeof (UINT64)); + CurrentTablePointer = (UINTN) *(UINT64 *)CurrentTableEntry; + CurrentTable = (EFI_ACPI_DESCRIPTION_HEADER *) CurrentTablePointer; + + // + // Install the XSDT tables + // + Status = AcpiProtocol->InstallAcpiTable ( + AcpiProtocol, + CurrentTable, + CurrentTable->Length, + &TableHandle + ); + + if (EFI_ERROR (Status)) { +ASSERT_EFI_ERROR(Status); +return Status; + } + + // + // Get the X-DSDT table address from the table FADT + // + if (!AsciiStrnCmp ((CHAR8 *) &CurrentTable->Signature, "FACP", 4)) { +Fadt2Table = (EFI_ACP
[edk2-devel] [edk2-non-osi] [PATCH] ElkhartlakeSiliconBinPkg: Update EHL microcode
Updated "production" microcode version m0190661_0015 Signed-off-by: kokweich Cc: Nate DeSimone Cc: Sai Chaganty Cc: jinjhuli --- .../Microcode/IntelMicrocodeLicense.txt | 2 +- .../Microcode/MicrocodeUpdates.inf | 2 +- .../Microcode/m0190661_0014.mcb | Bin 20480 -> 0 bytes .../Microcode/m0190661_0015.mcb | Bin 0 -> 20480 bytes 4 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/m0190661_0014.mcb create mode 100644 Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/m0190661_0015.mcb diff --git a/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/IntelMicrocodeLicense.txt b/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/IntelMicrocodeLicense.txt index ea33b61..78536ba 100644 --- a/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/IntelMicrocodeLicense.txt +++ b/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/IntelMicrocodeLicense.txt @@ -1,4 +1,4 @@ -Copyright (c) 2018 - 2020 Intel Corporation. +Copyright (c) 2018 - 2021 Intel Corporation. All rights reserved. Redistribution. diff --git a/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/MicrocodeUpdates.inf b/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/MicrocodeUpdates.inf index fda220a..f99f0a5 100644 --- a/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/MicrocodeUpdates.inf +++ b/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/MicrocodeUpdates.inf @@ -15,4 +15,4 @@ MODULE_TYPE= USER_DEFINED [Sources] - m0190661_0014.mcb + m0190661_0015.mcb diff --git a/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/m0190661_0014.mcb b/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/m0190661_0014.mcb deleted file mode 100644 index 1a7eb9a4ffd7544255b1d20f94c877aed02bfa07.. GIT binary patch literal 0 HcmV?d1 literal 20480 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
[edk2-devel] [PATCH 1/5] OvmfPkg: Handle Cloud Hypervisor host bridge
From: Sebastien Boeuf Handle things differently when the detected host bridge matches the Cloud Hypervisor PCI host bridge identifier. Signed-off-by: Rob Bradford Signed-off-by: Sebastien Boeuf --- OvmfPkg/Csm/CsmSupportLib/LegacyInterrupt.c | 1 + OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c | 1 + OvmfPkg/Csm/CsmSupportLib/LegacyRegion.h | 1 + OvmfPkg/Include/IndustryStandard/CloudHv.h| 35 +++ OvmfPkg/Include/OvmfPlatforms.h | 1 + .../Library/AcpiTimerLib/BaseAcpiTimerLib.c | 3 + .../AcpiTimerLib/BaseRomAcpiTimerLib.c| 4 ++ .../Library/AcpiTimerLib/DxeAcpiTimerLib.c| 3 + .../PlatformBootManagerLib/BdsPlatform.c | 1 + .../ResetSystemLib/BaseResetShutdown.c| 3 + .../Library/ResetSystemLib/DxeResetShutdown.c | 11 +++- OvmfPkg/PlatformPei/MemDetect.c | 63 ++- OvmfPkg/PlatformPei/Platform.c| 11 +++- 13 files changed, 105 insertions(+), 33 deletions(-) create mode 100644 OvmfPkg/Include/IndustryStandard/CloudHv.h diff --git a/OvmfPkg/Csm/CsmSupportLib/LegacyInterrupt.c b/OvmfPkg/Csm/CsmSupportLib/LegacyInterrupt.c index 97ca21945f..50c9322911 100644 --- a/OvmfPkg/Csm/CsmSupportLib/LegacyInterrupt.c +++ b/OvmfPkg/Csm/CsmSupportLib/LegacyInterrupt.c @@ -189,6 +189,7 @@ LegacyInterruptInstall ( mLegacyInterruptDevice = LEGACY_INT_DEV_PIIX4; break; case INTEL_Q35_MCH_DEVICE_ID: +case CLOUDHV_DEVICE_ID: // Cloud Hypervisor host bridge mLegacyInterruptDevice = LEGACY_INT_DEV_Q35; break; default: diff --git a/OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c b/OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c index fe9ae27c9d..9d6d6faf48 100644 --- a/OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c +++ b/OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c @@ -474,6 +474,7 @@ LegacyRegionInit ( mRegisterValues = mRegisterValues440; break; case INTEL_Q35_MCH_DEVICE_ID: + case CLOUDHV_DEVICE_ID: // Cloud Hypervisor host bridge mRegisterValues = mRegisterValuesQ35; break; default: diff --git a/OvmfPkg/Csm/CsmSupportLib/LegacyRegion.h b/OvmfPkg/Csm/CsmSupportLib/LegacyRegion.h index e18cb97949..71df8f5fb2 100644 --- a/OvmfPkg/Csm/CsmSupportLib/LegacyRegion.h +++ b/OvmfPkg/Csm/CsmSupportLib/LegacyRegion.h @@ -17,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/OvmfPkg/Include/IndustryStandard/CloudHv.h b/OvmfPkg/Include/IndustryStandard/CloudHv.h new file mode 100644 index 00..6ab18ad50d --- /dev/null +++ b/OvmfPkg/Include/IndustryStandard/CloudHv.h @@ -0,0 +1,35 @@ +/** @file + Various defines related to Cloud Hypervisor + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ +#ifndef __CLOUDHV_H__ +#define __CLOUDHV_H__ + +// +// Host Bridge Device ID +// +#define CLOUDHV_DEVICE_ID 0x0d57 + +// +// ACPI timer address +// +#define CLOUDHV_ACPI_TIMER_IO_ADDRESS 0xb008 + +// +// ACPI shutdown device address +// +#define CLOUDHV_ACPI_SHUTDOWN_IO_ADDRESS 0x03c0 + +// +// 32-bit MMIO memory hole base address +// +#define CLOUDHV_MMIO_HOLE_ADDRESS 0xc000 + +// +// 32-bit MMIO memory hole size +// +#define CLOUDHV_MMIO_HOLE_SIZE 0x3800 + +#endif // __CLOUDHV_H__ diff --git a/OvmfPkg/Include/OvmfPlatforms.h b/OvmfPkg/Include/OvmfPlatforms.h index 3b85593b70..ad0b0d2803 100644 --- a/OvmfPkg/Include/OvmfPlatforms.h +++ b/OvmfPkg/Include/OvmfPlatforms.h @@ -16,6 +16,7 @@ #include #include #include +#include // // OVMF Host Bridge DID Address diff --git a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c b/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c index 7c593e8be1..e182ac2b7d 100644 --- a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c +++ b/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c @@ -55,6 +55,9 @@ AcpiTimerLibConstructor ( AcpiCtlReg = POWER_MGMT_REGISTER_Q35 (ICH9_ACPI_CNTL); AcpiEnBit = ICH9_ACPI_CNTL_ACPI_EN; break; +case CLOUDHV_DEVICE_ID: + mAcpiTimerIoAddr = CLOUDHV_ACPI_TIMER_IO_ADDRESS; + return RETURN_SUCCESS; default: DEBUG ((DEBUG_ERROR, "%a: Unknown Host Bridge Device ID: 0x%04x\n", __FUNCTION__, HostBridgeDevId)); diff --git a/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c b/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c index 52f3ea2dbf..a223153b2b 100644 --- a/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c +++ b/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c @@ -53,6 +53,8 @@ AcpiTimerLibConstructor ( AcpiCtlReg = POWER_MGMT_REGISTER_Q35 (ICH9_ACPI_CNTL); AcpiEnBit = ICH9_ACPI_CNTL_ACPI_EN; break; +case CLOUDHV_DEVICE_ID: + return RETURN_SUCCESS; default: DEBUG ((DEBUG_ERROR, "%a: Unknown Host Bridge Device ID: 0x%04x\n", __FUNCTION__, HostBridgeDevId)); @@ -107,6 +109,8 @@ InternalAcpiGetTimerTick ( case INTEL_Q35_MCH_DEVICE_ID: Pmba = POWER_MGMT_REGISTER_Q35 (ICH9_PMBASE); break; +case CLOUDHV_DEVICE_ID: + return
Re: [edk2-devel] [PATCH 5/5] OvmfPkg: Install ACPI tables for Cloud Hypervisor
On Wed, Dec 01, 2021 at 12:04:36PM +0100, sebastien.bo...@intel.com wrote: > From: Sebastien Boeuf > > Adding support for retrieving the Cloud Hypervisor ACPI tables as a > fallback mechanism if tables are not found through fw_cfg. > > Signed-off-by: Rob Bradford > Signed-off-by: Sebastien Boeuf > --- > OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c | 4 + > OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h | 6 + > OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 1 + > OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 117 > OvmfPkg/Include/IndustryStandard/CloudHv.h | 5 + > 5 files changed, 133 insertions(+) > create mode 100644 OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c > > diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c > b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c > index 613a8ac97f..abd1f550d4 100644 > --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c > +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c > @@ -29,5 +29,9 @@ InstallAcpiTables ( >EFI_STATUS Status; > >Status = InstallQemuFwCfgTables (AcpiTable); > + if (EFI_ERROR (Status)) { > +Status = InstallCloudHvTables (AcpiTable); > + } Same here, I think you should use the host bridge pcd. take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84208): https://edk2.groups.io/g/devel/message/84208 Mute This Topic: https://groups.io/mt/87429200/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 4/5] OvmfPkg: Generalize AcpiPlatformDxe
On Wed, Dec 01, 2021 at 12:04:35PM +0100, sebastien.bo...@intel.com wrote: > From: Sebastien Boeuf > > Don't make the package Qemu centric so that we can introduce some > alternative support for other VMMs not using the fw_cfg mechanism. So a pure rename without functional change. Please add that to the commit message. With that update: Reviewed-by: Gerd Hoffmann take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84207): https://edk2.groups.io/g/devel/message/84207 Mute This Topic: https://groups.io/mt/87429151/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 3/5] OvmfPkg: Retrieve SMBIOS from Cloud Hypervisor
>Status = EFI_NOT_FOUND; >// >// Add QEMU SMBIOS data if found >// >SmbiosTables = GetQemuSmbiosTables (); > - if (SmbiosTables != NULL) { > -Status = InstallAllStructures (SmbiosTables); > + if (SmbiosTables == NULL) { > +SmbiosTables = GetCloudHvSmbiosTables (); Check PcdOvmfHostBridgePciDevId here to figure whenever GetQemuSmbiosTables or GetCloudHvSmbiosTables should be called? Should be more robust and give us a slightly less messy code flow, specifically when it comes to flip FreeTables to true for the qemu case. take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84206): https://edk2.groups.io/g/devel/message/84206 Mute This Topic: https://groups.io/mt/87429115/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 2/5] OvmfPkg: Create global entry point for SMBIOS parsing
Hi, > +#include "SmbiosPlatformDxe.h" > + > +UINT8 * > +GetQemuSmbiosTables ( > + VOID > + ); That declaration should be in SmbiosPlatformDxe.h take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84205): https://edk2.groups.io/g/devel/message/84205 Mute This Topic: https://groups.io/mt/87428998/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 1/5] OvmfPkg: Handle Cloud Hypervisor host bridge
Hi, > +case CLOUDHV_DEVICE_ID: // Cloud Hypervisor host bridge No need for the comment ... > +++ b/OvmfPkg/Include/IndustryStandard/CloudHv.h > @@ -0,0 +1,35 @@ > +/** @file > + Various defines related to Cloud Hypervisor > + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > +#ifndef __CLOUDHV_H__ > +#define __CLOUDHV_H__ > + > +// > +// Host Bridge Device ID > +// > +#define CLOUDHV_DEVICE_ID 0x0d57 ... this is enough documentation IMHO. > + if (mAcpiPmBaseAddress == 0) { > +IoWrite8 (CLOUDHV_ACPI_SHUTDOWN_IO_ADDRESS, 5 << 2 | 1 << 5); This looks like the sleep control register of the hw-reduced acpi pm profile. I'd suggest to use a new variable then, for example use mAcpiHwReducedSleepCtl = CLOUDHV_ACPI_SHUTDOWN_IO_ADDRESS > +case 0x: /* microvm */ > + return; Huh? > @@ -778,21 +782,22 @@ QemuInitializeRam ( >if (IsMtrrSupported ()) { > MtrrGetAllMtrrs (&MtrrSettings); > > -// > -// MTRRs disabled, fixed MTRRs disabled, default type is uncached > -// > -ASSERT ((MtrrSettings.MtrrDefType & BIT11) == 0); > -ASSERT ((MtrrSettings.MtrrDefType & BIT10) == 0); > -ASSERT ((MtrrSettings.MtrrDefType & 0xFF) == 0); > - > -// > -// flip default type to writeback > -// > -SetMem (&MtrrSettings.Fixed, sizeof MtrrSettings.Fixed, 0x06); > -ZeroMem (&MtrrSettings.Variables, sizeof MtrrSettings.Variables); > -MtrrSettings.MtrrDefType |= BIT11 | BIT10 | 6; > -MtrrSetAllMtrrs (&MtrrSettings); > +if (mHostBridgeDevId != CLOUDHV_DEVICE_ID) { Do you need the MtrrGetAllMtrrs() call? If not you can just use this: if (IsMtrrSupported () && mHostBridgeDevId != CLOUDHV_DEVICE_ID) > @@ -372,14 +375,18 @@ MiscInitialization ( > MICROVM_PSEUDO_DEVICE_ID); >ASSERT_RETURN_ERROR (PcdStatus); >return; > +case CLOUDHV_DEVICE_ID: > + DEBUG ((DEBUG_INFO, "%a: Cloud Hypervisor host bridge\n", > __FUNCTION__)); > + PcdStatus = PcdSet16S (PcdOvmfHostBridgePciDevId, > + CLOUDHV_DEVICE_ID); > + ASSERT_RETURN_ERROR (PcdStatus); > + return; > default: >DEBUG ((DEBUG_ERROR, "%a: Unknown Host Bridge Device ID: 0x%04x\n", > __FUNCTION__, mHostBridgeDevId)); >ASSERT (FALSE); >return; >} > - PcdStatus = PcdSet16S (PcdOvmfHostBridgePciDevId, mHostBridgeDevId); > - ASSERT_RETURN_ERROR (PcdStatus); Removing this check looks suspicious. If it is not needed here for some reason move that change to a separate patch with a commit message explaining things. take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84204): https://edk2.groups.io/g/devel/message/84204 Mute This Topic: https://groups.io/mt/87428911/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH V3 15/29] OvmfPkg: Update SecEntry.nasm to support Tdx
Hi, > Please refer to PI specification 1.7A > (https://uefi.org/sites/default/files/resources/PI_Spec_1_7_A_final_May1.pdf) > Section 2.1 - Introduction. > "Philosophically, the PEI phase is intended to be the thinnest amount > of code to achieve the ends listed above. As such, any more > sophisticated algorithms or processing should be deferred to the DXE > phase of execution." Well, that might have been the original intention. Reality is that a bunch of security-related stuff ended up in PEI too. Support for TPM, SMM, suspend. And I think the motivation for that is exactly what James described: Given that most communication with external entities happens in the DXE phase it is much harder to trick PEI code because there are simply less attack vectors available. > I am not convinced that "exposure (external interface)" is a good > reason to decide where the module should be. Thinking of this, if you > prefer to put a module to the PEI because PEI has *less* exposure, > then PEI will have *more* exposure after that. If you move half of > DXE features to PEI, then PEI has same exposure as DXE. What benefit > we can get? Why is TPM and SMM and suspend support in PEI not DXE today? > > Moving code to SEC has its problems too. SEC is a much more restricted > > environment. A direct consequence is that you have re-invented > > multiprocessor job scheduling (using tdx mailbox) instead of using > > standard mp service for parallel accept. I do not account that as > > "reducing complexity". > > [Jiewen] OK. Let me explain multiprocessor related topic. > > I don't think we intent to "reduce" complexity in this area. I would > say, it is same with or without PEI. > > TDX (also SEV) has special requirement to *accept* memory, before use > it. The accepting is time consuming process. So the motivation is to > use multiprocessor to accelerate the process. > > We have at least three architecture places to accept the memory - SEC, > PEI and DXE. Well, I want focus on how all this will look like long-term, i.e. once we have lazy accept implemented. I don't think it makes sense to put much effort into optimizing a workflow which will only be temporary anyway. The lazy accept concept pretty much implies that the vast majority of memory will either be accepted in the DXE phase, or will not be accepted by the firmware at all and the linux kernel will handle that instead. I expect in the future SEC and/or PEI will accept barely enough memory that the firmware is able to enter the DXE phase and initialize core memory management. Then lazy accept takes over. > A) Accept in SEC > We need write multiprocessor code in SEC. This is already mandatory, > even without accepting memory. The TDX architecture already changes > the reset vector flow - ALL processors jumps to the reset vector at > same time. Having multiprocessor code in SEC is unavoidable. We have > to do it, to rendez-vous APs and initialize mailbox. Sure. > The code is written because of TDX architecture change, not because > memory accepting. So I won't treat it as a burden to add additional > feature to memory accept in SEC. That is the point where you start re-inventing the wheel though. You add logic to distribute memory acceptance jobs to the APs. I'd suggest to add full MP service support to TDX (probably also using the mailbox), then use MP service to distribute memory acceptance jobs to the APs. I think you will need that anyway for lazy accept, to do parallel accept in DXE phase. > B) Accept in PEI > PEI has MP_PPI, that is TRUE. But the problem is: MP_PPI starts *later*. > MP_PPI starts *after* the memory discovery > (https://github.com/tianocore/edk2/blob/master/UefiCpuPkg/CpuMpPei/CpuMpPei.c#L706), > which mean the process will be: > Step 1: TdxPeim accepts PEI required memory without MP_PPI > Step 2: PlatformPei installs PEI required memory. > Step 3: MP_PPI starts. > Step 4: TdxPeim accepts additional memory with MP_PPI Yes. Or just don't initialize MP in PEI and do that in DXE only. Lazy accept will need that anyway. > Now, you can see the benefit to accept PEI memory is not there. > NOTE: PEI memory is ~64M if GPAW is 48, it is ~98M if GPAW is 52, which is a > big number. What is all this memory needed for? Why do you need 32M additional memory for 5-level paging? Is that page table memory? If so, how does lazy accept change the picture? > As such, we conclude that doing memory accept in SEC is the best > choice for TDX architecture. Not convinced this is still the case with lazy accept on the horizon. > For config-B, Min is working on it and doing clean up. > You are welcome to provide feedback after we send out patch for config-B. Will do for sure. take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84203): https://edk2.groups.io/g/devel/message/84203 Mute This Topic: https://groups.io/mt/86739864/21656 Group Owner: devel+ow...@edk2
Re: [edk2-devel] Uncrustify Conversion Detailed Plan and Extended Hard Freeze Update #4
Hi Mike, For DynamicTablesPkg, ArmPkg, ArmPlatformPkg, ArmVirtPkg & StandaloneMmPkg Reviewed-by: Sami Mujawar ( sami.muja...@arm.com ) Regards, Sami Mujawar -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84202): https://edk2.groups.io/g/devel/message/84202 Mute This Topic: https://groups.io/mt/87414953/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH EDK2 v1 1/1] MdeModulePkg/FrameBufferBltLib:Add unit test
Add unit test for FrameBufferBltLib. Cc: Jian J Wang Cc: Liming Gao Cc: Zhichao Gao Cc: Ray Ni Signed-off-by: Wenyi Xie --- MdeModulePkg/Test/MdeModulePkgHostTest.dsc | 5 + MdeModulePkg/Library/FrameBufferBltLib/UnitTest/FrameBufferBltLibUnitTest.inf | 32 MdeModulePkg/Library/FrameBufferBltLib/UnitTest/FrameBufferBltLibUnitTest.c | 174 MdeModulePkg/MdeModulePkg.ci.yaml | 1 + 4 files changed, 212 insertions(+) diff --git a/MdeModulePkg/Test/MdeModulePkgHostTest.dsc b/MdeModulePkg/Test/MdeModulePkgHostTest.dsc index c9ec835df65d..e08bf7d95fe7 100644 --- a/MdeModulePkg/Test/MdeModulePkgHostTest.dsc +++ b/MdeModulePkg/Test/MdeModulePkgHostTest.dsc @@ -47,3 +47,8 @@ [Components] UefiSortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf } + + MdeModulePkg/Library/FrameBufferBltLib/UnitTest/FrameBufferBltLibUnitTest.inf { + + FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf + } diff --git a/MdeModulePkg/Library/FrameBufferBltLib/UnitTest/FrameBufferBltLibUnitTest.inf b/MdeModulePkg/Library/FrameBufferBltLib/UnitTest/FrameBufferBltLibUnitTest.inf new file mode 100644 index ..de32f2d93ba6 --- /dev/null +++ b/MdeModulePkg/Library/FrameBufferBltLib/UnitTest/FrameBufferBltLibUnitTest.inf @@ -0,0 +1,32 @@ +## @file +# This is a unit test for the FrameBufferBltLib. +# +# Copyright (C) Huawei Technologies Co., Ltd. All rights reserved +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION = 0x00010017 + BASE_NAME = FrameBufferBltLibUnitTest + FILE_GUID = E9E25A30-D34A-8E09-F9D1-40249AB39778 + VERSION_STRING = 1.0 + MODULE_TYPE = HOST_APPLICATION + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 +# + +[Sources] + FrameBufferBltLibUnitTest.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec + +[LibraryClasses] + UnitTestLib + DebugLib + FrameBufferBltLib diff --git a/MdeModulePkg/Library/FrameBufferBltLib/UnitTest/FrameBufferBltLibUnitTest.c b/MdeModulePkg/Library/FrameBufferBltLib/UnitTest/FrameBufferBltLibUnitTest.c new file mode 100644 index ..0d157f55cb69 --- /dev/null +++ b/MdeModulePkg/Library/FrameBufferBltLib/UnitTest/FrameBufferBltLibUnitTest.c @@ -0,0 +1,174 @@ +/** @file + Unit tests of the FrameBufferBltLib + + Copyright (C) Huawei Technologies Co., Ltd. All rights reserved + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#define UNIT_TEST_APP_NAME"FrameBufferBltLib Unit Tests" +#define UNIT_TEST_APP_VERSION "1.0" + +struct FRAME_BUFFER_CONFIGURE { + UINT32 PixelsPerScanLine; + UINT32 BytesPerPixel; + UINT32 Width; + UINT32 Height; + UINT8 *FrameBuffer; + EFI_GRAPHICS_PIXEL_FORMAT PixelFormat; + EFI_PIXEL_BITMASK PixelMasks; + INT8PixelShl[4]; // R-G-B-Rsvd + INT8PixelShr[4]; // R-G-B-Rsvd + UINT8 LineBuffer[0]; +}; + +typedef struct { + EFI_GRAPHICS_OUTPUT_MODE_INFORMATION Information; + RETURN_STATUS ExpectedResult; +} BASIC_TEST_CONTEXT; + +static BASIC_TEST_CONTEXT mBasicTestTrue1 = { + {0, 1920, 1080, PixelRedGreenBlueReserved8BitPerColor, {0, 0, 0, 0}, 1920}, + RETURN_SUCCESS +}; + +static BASIC_TEST_CONTEXT mBasicTestFalse1 = { + {0, 1920, 1080, PixelRedGreenBlueReserved8BitPerColor, {0, 0, 0, 0}, 1080}, + RETURN_UNSUPPORTED +}; + +/** + Unit test for FrameBufferBltConfigure () API of the FrameBufferBltLib. + + @param[in] Context[Optional] An optional parameter that enables: + 1) test-case reuse with varied parameters and + 2) test-case re-entry for Target tests that need a + reboot. This parameter is a VOID* and it is the + responsibility of the test author to ensure that the + contents are well understood by all test cases that may + consume it. + + @retval UNIT_TEST_PASSED The Unit test has completed and the test +case was successful. + @retval UNIT_TEST_ERROR_TEST_FAILED A test case assertion has failed. +**/ +UNIT_TEST_STATUS +EFIAPI +FrameBufferBltConfigureTest ( + IN UNIT_TEST_CONTEXT Context + ) +{ + RETURN_STATUS Result; + V
[edk2-devel] [PATCH EDK2 v1 0/1] MdeModulePkg/FrameBufferBltLib:Add unit test
Main Changes : 1.Add unit test for function FrameBufferBltConfigure. Wenyi Xie (1): MdeModulePkg/FrameBufferBltLib:Add unit test MdeModulePkg/Test/MdeModulePkgHostTest.dsc | 5 + MdeModulePkg/Library/FrameBufferBltLib/UnitTest/FrameBufferBltLibUnitTest.inf | 32 MdeModulePkg/Library/FrameBufferBltLib/UnitTest/FrameBufferBltLibUnitTest.c | 174 MdeModulePkg/MdeModulePkg.ci.yaml | 1 + 4 files changed, 212 insertions(+) create mode 100644 MdeModulePkg/Library/FrameBufferBltLib/UnitTest/FrameBufferBltLibUnitTest.inf create mode 100644 MdeModulePkg/Library/FrameBufferBltLib/UnitTest/FrameBufferBltLibUnitTest.c -- 2.20.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84200): https://edk2.groups.io/g/devel/message/84200 Mute This Topic: https://groups.io/mt/87423992/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-non-osi] [PATCH] ElkhartlakeSiliconBinPkg: Update EHL microcode
Reviewed-by: Sai Chaganty -Original Message- From: Chan, Kok Wei Sent: Tuesday, November 30, 2021 11:55 PM To: devel@edk2.groups.io Cc: Desimone, Nathaniel L ; Chaganty, Rangasai V ; Lim, Jin Jhu Subject: [edk2-devel] [edk2-non-osi] [PATCH] ElkhartlakeSiliconBinPkg: Update EHL microcode Updated "production" microcode version m0190661_0015 Signed-off-by: kokweich Cc: Nate DeSimone Cc: Sai Chaganty Cc: jinjhuli --- .../Microcode/IntelMicrocodeLicense.txt | 2 +- .../Microcode/MicrocodeUpdates.inf | 2 +- .../Microcode/m0190661_0014.mcb | Bin 20480 -> 0 bytes .../Microcode/m0190661_0015.mcb | Bin 0 -> 20480 bytes 4 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/m0190661_0014.mcb create mode 100644 Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/m0190661_0015.mcb diff --git a/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/IntelMicrocodeLicense.txt b/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/IntelMicrocodeLicense.txt index ea33b61..78536ba 100644 --- a/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/IntelMicrocodeLicense.txt +++ b/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/IntelMicrocodeLicense.txt @@ -1,4 +1,4 @@ -Copyright (c) 2018 - 2020 Intel Corporation. +Copyright (c) 2018 - 2021 Intel Corporation. All rights reserved. Redistribution. diff --git a/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/MicrocodeUpdates.inf b/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/MicrocodeUpdates.inf index fda220a..f99f0a5 100644 --- a/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/MicrocodeUpdates.inf +++ b/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/MicrocodeUpdates.inf @@ -15,4 +15,4 @@ MODULE_TYPE= USER_DEFINED [Sources] - m0190661_0014.mcb + m0190661_0015.mcb diff --git a/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/m0190661_0014.mcb b/Silicon/Intel/ElkhartlakeSiliconBinPkg/Microcode/m0190661_0014.mcb deleted file mode 100644 index 1a7eb9a4ffd7544255b1d20f94c877aed02bfa07.. GIT binary patch literal 0 HcmV?d1 literal 20480 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