summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* DynamicTablesPkg: SSDT CPU topology and LPI state generatorPierre Gondois2021-10-085-1/+1407
| | | | | | | | | | | | | | | In the GIC interrupt model, logical processors are required to have a Processor Device object in the DSDT and must convey each processor's GIC information to the OS using the GICC structure. Additionally, _LPI objects may be needed as they provide a method to describe Low Power Idle states that defines the local power states for each node in a hierarchical processor topology. Therefore, add support to generate the CPU topology and the LPI state information in an SSDT table. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: Add CM_ARM_LPI_INFO objectPierre Gondois2021-10-082-0/+103
| | | | | | | | | Introduce the CM_ARM_LPI_INFO CmObj in the ArmNameSpaceObjects. This allows to describe LPI state information, as described in ACPI 6.4, s8.4.4.3 "_LPI (Low Power Idle States)". Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: AML code generation to add an _LPI statePierre Gondois2021-10-082-0/+530
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add AmlAddLpiState() to generates AML code to add an _LPI state to an _LPI object created using AmlCreateLpiNode(). AmlAddLpiState increments the count of LPI states in the LPI node by one, and adds the following package: Package() { MinResidency, WorstCaseWakeLatency, Flags, ArchFlags, ResCntFreq, EnableParentState, (GenericRegisterDescriptor != NULL) ? // Entry method. If a ResourceTemplate(GenericRegisterDescriptor) : // Register is given, Integer, // use it. Use the // Integer otherwise ResourceTemplate() { // NULL Residency Register (SystemMemory, 0, 0, 0, 0) // Counter }, ResourceTemplate() { // NULL Usage Counter Register (SystemMemory, 0, 0, 0, 0) }, "" // NULL State Name }, Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: AML code generation for a _LPI objectPierre Gondois2021-10-082-0/+177
| | | | | | | | | | | | | | | | | | | | _LPI object provides a method to describe Low Power Idle states that define the local power states for each node in a hierarchical processor topology. Therefore, add AmlCreateLpiNode() to generate code for a _LPI object. AmlCreateLpiNode ("_LPI", 0, 1, ParentNode, &LpiNode) is equivalent of the following ASL code: Name (_LPI, Package ( 0, // Revision 1, // LevelId 0 // Count )) Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: AML code generation for a Method returning a NSPierre Gondois2021-10-082-0/+159
| | | | | | | | | | | | | | | | Add AmlCodeGenMethodRetNameString() to generate AML code to create a Method returning a NameString (NS). AmlCodeGenMethodRetNameString ( "MET0", "_CRS", 1, TRUE, 3, ParentNode, NewObjectNode ); is equivalent of the following ASL code: Method(MET0, 1, Serialized, 3) { Return (_CRS) } Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: AML code generation to Return a NameStringPierre Gondois2021-10-081-0/+181
| | | | | | | | | | | | Add AmlCodeGenReturnNameString() to generate AML code for a Return object node, returning the object as a NameString. AmlCodeGenReturn ("NAM1", ParentNode, NewObjectNode) is equivalent of the following ASL code: Return(NAM1) Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: AML code generation for a MethodPierre Gondois2021-10-081-0/+184
| | | | | | | | | | | Add AmlCodeGenMethod() to generate code for a control method. AmlCodeGenMethod ("MET0", 1, TRUE, 3, ParentNode, NewObjectNode) is equivalent of the following ASL code: Method(MET0, 1, Serialized, 3) {} Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: AML code generation for a ResourceTemplatePierre Gondois2021-10-081-0/+190
| | | | | | | | | | | | | | | ASL provides a ResourceTemplate macro that creates a Buffer in which resource descriptor macros can be listed. The ResourceTemplate macro automatically generates an End descriptor and calculates the checksum for the resource template. Therefore, add AmlCodeGenResourceTemplate() to generate AML code for the ResourceTemplate() macro. This function generates a Buffer node with an EndTag resource data descriptor, which is similar to the ASL ResourceTemplate() macro. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: Helper function to compute package lengthPierre Gondois2021-10-082-2/+132
| | | | | | | | | | | | | | | Some AML object have a PkgLen which indicates the size of the AML object. The package length can be encoded in 1 to 4 bytes. The bytes used to encode the PkgLen is itself counted in the PkgLen value. So, if an AML object's size increments/decrements, the number of bytes used to encode the PkgLen value can itself increment/decrement. Therefore, a helper function AmlComputePkgLength() is introduced to simply computation of the PkgLen. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: AML code generation for a PackagePierre Gondois2021-10-081-1/+80
| | | | | | | | | | Add AmlCodeGenPackage() to generate AML code for declaring a Package() object. This function generates an empty package node. New elements can then be added to the package's variable argument list. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: AML Code generation for Resource data EndTagPierre Gondois2021-10-082-0/+156
| | | | | | | | | | | | | Add a helper function AmlCodeGenEndTag() to generate AML Resource Data EndTag. The EndTag resource data is automatically generated by the ASL compiler at the end of a list of resource data elements. Therefore, an equivalent function is not present in ASL. However, AmlCodeGenEndTag() is useful when generating AML code for the ResourceTemplate() macro. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: AML Code generation for Register()Pierre Gondois2021-10-082-0/+136
| | | | | | | | | Add AmlCodeGenRegister() to generate AML code for the Generic Register Resource Descriptor. This function is equivalent to the ASL macro Register(). Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: Make AmlNodeGetIntegerValue publicPierre Gondois2021-10-082-3/+18
| | | | | | | | | | Remove the STATIC qualifier for the AmlUtility function AmlNodeGetIntegerValue() and add the definition to the header file so that it can be used by other AmlLib sub-modules. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: Update error handling for node creationPierre Gondois2021-10-082-7/+1
| | | | | | | | | | | | | The node creation functions: - AmlCreateRootNode() - AmlCreateObjectNode() - AmlCreateDataNode() are now resetting the input pointer where the created node is stored. Thus, it is not necessary to set some local variables to NULL or check a node value before trying to delete it. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: Clear pointer in node creation fctsPierre Gondois2021-10-084-10/+40
| | | | | | | | | | | | | | | | | The following functions: - AmlCreateRootNode() - AmlCreateObjectNode() - AmlCreateDataNode() create a node and return it by populating a pointer. This pointer should only be considered/used if the function returns successfully. Otherwise, the value stored in this pointer should be ignored. For their error handling, some other functions assume that this pointer is reset to NULL if an error occurs during a node creation. To make this assumption correct, explicitly clear this input pointer. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: Set EndTag's Checksum if RdList is modifiedPierre Gondois2021-10-082-45/+34
| | | | | | | | | | | | | | | | | | | ACPI 6.4, s6.4.2.9 "End Tag": "This checksum is generated such that adding it to the sum of all the data bytes will produce a zero sum." "If the checksum field is zero, the resource data is treated as if the checksum operation succeeded. Configuration proceeds normally." To avoid re-computing checksums, if a new resource data elements is added/removed/modified in a list of resource data elements, the AmlLib resets the checksum to 0. This patch also refactors the AmlAppendRdNode() function by getting the last Resource Data node directly instead of iterating over all the elements of the list of Resource Data node. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: Add AmlSetRdListCheckSum()Pierre Gondois2021-10-082-0/+108
| | | | | | | | | | | | | | | Lists of Resource Data elements end with an EndTag (most of the time). This function finds the EndTag (if present) in a list of Resource Data elements and sets the checksum. ACPI 6.4, s6.4.2.9 "End Tag": "This checksum is generated such that adding it to the sum of all the data bytes will produce a zero sum." "If the checksum field is zero, the resource data is treated as if the checksum operation succeeded. Configuration proceeds normally." Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: Add AmlRdSetEndTagChecksum()Pierre Gondois2021-10-082-0/+54
| | | | | | | | | | | | | | Add AmlRdSetEndTagChecksum(), setting the CheckSum value contained in a Resource Data element. ACPI 6.4, s6.4.2.9 "End Tag": "This checksum is generated such that adding it to the sum of all the data bytes will produce a zero sum." "If the checksum field is zero, the resource data is treated as if the checksum operation succeeded. Configuration proceeds normally." Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: Add AddSsdtAcpiHeader()Pierre Gondois2021-10-082-0/+122
| | | | | | | | | To fetch the Oem information from the ConfigurationManagerProtocol and the AcpiTableInfo, and populate the SSDT ACPI header when creating a RootNode via the AmlLib, create AddSsdtAcpiHeader(). Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: Add missing parameter checkPierre Gondois2021-10-081-0/+2
| | | | | | | Add missing check of 'AcpiTableInfo' in AddAcpiHeader(). Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* DynamicTablesPkg: Remove unnecessary includesPierre Gondois2021-10-083-6/+0
| | | | | | | Some includes are not necessary. Remove them. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
* ShellPkg: Update Acpiview HMAT parser to ACPI spec version 6.4Chris Jones2021-10-082-10/+11
| | | | | | | | | | | | | Add parser support for the new "MinTransferSize" field of the System Locality, Latency and Bandwidth structure, introduced by the ACPI specification version 6.4. Also update the HMAT parser to use the newer ACPI version 6.4 definitions. Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Zhichao Gao <zhcihao.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* MdeModulePkg/Core/Dxe: Add lock protection in CoreLocateHandleBuffer()Hua Ma2021-10-081-13/+51
| | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3666 Currently, CoreLocateHandleBuffer() follows three steps: 1) get the size of protocol database firstly 2) allocate the buffer based on the size 3) get the protocol database into the buffer There is no lock protection for the whole three steps. If a new protocol added in step 2) by other task, e.g. (event timer handle USB device hotplug). The size of protocol database may be increased and cannot fit into the previous buffer in step 3). The protocol database cannot be returned successfully, EFI_BUFFER_TOO_SMALL error will be returned. This patch adds the lock to protect the whole three steps. It can make sure the correct protocol database be returned. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Hua Ma <hua.ma@intel.com> Reviewed-by: Dandan Bi dandan.bi@intel.com Reviewed-by: Liming Gao gaoliming@byosoft.com.cn
* ShellPkg: Add Type 5 PCC Subspace Structure parserChris Jones2021-10-061-3/+55
| | | | | | | | | | | | Bugzilla: 3563 (https://bugzilla.tianocore.org/show_bug.cgi?id=3563) Update the Acpiview PCCT parser with the HW Registers based Communications Subspace Structure (Type 5) as defined in Section 14.1.7 of the ACPI 6.4 specification. Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar <sami.mujawar@arm.com>
* ShellPkg: Update Acpiview PCCT parser to ACPI 6.4Chris Jones2021-10-062-25/+25
| | | | | | | | | | Bugzilla: 3563 (https://bugzilla.tianocore.org/show_bug.cgi?id=3563) Update the Acpiview PCCT parser to use Acpi64.h. Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar <sami.mujawar@arm.com>
* ShellPkg: Update Acpiview GTDT parser to ACPI 6.4Chris Jones2021-10-052-8/+8
| | | | | | | | | | | Bugzilla: 3565 (https://bugzilla.tianocore.org/show_bug.cgi?id=3565) Update the Acpiview GTDT parser to use Acpi64.h and as such rename all occurences of "SBSA Generic Watchdog" to "Arm Generic Watchdog". Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Rename SBSA generic watchdogChris Jones2021-10-052-34/+34
| | | | | | | | | | | | | Buzilla: 3565 (https://bugzilla.tianocore.org/show_bug.cgi?id=3565) As part of the updates to ACPI 6.4 the "SBSA Generic Watchdog" was renamed to the "Arm Generic Watchdog". This patch implements that change by updating the GTDT generator to use Acpi64.h and renames any occurence of "SBSA Generic Watchdog" to "Arm Generic Watchdog". Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* DynamicTablesPkg: Update FADT generator to ACPI 6.4Chris Jones2021-10-051-52/+52
| | | | | | | | | | | | Bugzilla: 3568 (https://bugzilla.tianocore.org/show_bug.cgi?id=3568) Update the FADT generator to use Acpi64.h. As the FADT revision tracks the ACPI revision this updates the minor revision value generated. Mantis ID for change: https://mantis.uefi.org/mantis/view.php?id=2105 Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* OvmfPkg/Microvm: add Maintainers.txt entryGerd Hoffmann2021-10-051-0/+6
| | | | | | | Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* OvmfPkg/Microvm: wire up serial console, drop super-ioGerd Hoffmann2021-10-053-6/+49
| | | | | | | | | | | | Microvm has no LPC bridge, so drop the PciSioSerialDxe driver. Use SerialDxe instead, with ioport hardcoded to 0x3f8 aka com1 aka ttyS0. With this tianocore boots to uefi shell prompt on the serial console. Direct kernel boot can be used too. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
* OvmfPkg/Microvm: use PciHostBridgeLibNullGerd Hoffmann2021-10-051-1/+1
| | | | | | | | | Shortcut PCI support for now (proper PCIe support will be wired up later). Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
* OvmfPkg/Microvm: BdsPlatform: PciAcpiInitialization tweak.Gerd Hoffmann2021-10-051-0/+2
| | | | | | | | Nothing to do here ;) Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
* OvmfPkg/ResetSystemLib: add driver for microvmGerd Hoffmann2021-10-058-7/+231
| | | | | | | | Uses the generic event device to reset and poweroff. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
* OvmfPkg/Microvm: PlatformPei/Platform: add id.Gerd Hoffmann2021-10-052-0/+19
| | | | | | | | Add + set microvm id for PcdOvmfHostBridgePciDevId. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
* OvmfPkg/Microvm: PlatformPei/Platform memory map tweaksGerd Hoffmann2021-10-051-0/+6
| | | | | | | | Microvm needs ioapic hobs only. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
* OvmfPkg/Microvm: PlatformPei/MemDetect tweaksGerd Hoffmann2021-10-051-0/+4
| | | | | | | | Skip host bridge setup on microvm. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
* OvmfPkg/Microvm: use XenTimerDxe (lapic timer)Gerd Hoffmann2021-10-052-4/+3
| | | | | | | | | | | | Microvm has no acpi timer, so go use XenTimerDxe which uses the local apic instead. Set PcdFSBClock to 1000 MHz, which is the lapic timer frequency used by KVM. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
* OvmfPkg/Microvm: use MdePkg/Library/SecPeiDxeTimerLibCpuGerd Hoffmann2021-10-051-8/+1
| | | | | | | | Microvm has no acpi timer, so use the generic lib instead. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
* OvmfPkg/Microvm: no emulated scsiGerd Hoffmann2021-10-052-18/+0
| | | | | | | | | Microvm focus is virtio, so go drop support for emulated scsi host adapters. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
* OvmfPkg/Microvm: no csmGerd Hoffmann2021-10-052-32/+0
| | | | | | | | | Guests depending on BIOS will probably not work that well with microvm due to legacy hardware being not available. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
* OvmfPkg/Microvm: no sevGerd Hoffmann2021-10-052-3/+0
| | | | | | | | Microvm has no SEV support. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
* OvmfPkg/Microvm: no tpmGerd Hoffmann2021-10-052-93/+1
| | | | | | | | | Microvm has no TPM support. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
* OvmfPkg/Microvm: no secure bootGerd Hoffmann2021-10-052-19/+0
| | | | | | | | Without SMM secure boot isn't actually secure, so drop it too. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
* OvmfPkg/Microvm: no smmGerd Hoffmann2021-10-052-115/+1
| | | | | | | | Microvm has no SMM support. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
* OvmfPkg/Microvm: rename output files, fix includesGerd Hoffmann2021-10-052-11/+11
| | | | | | | | | | Rename the firmware volume files (s/OVMF/MICROVM/). Fix includes so they work with microvm config being in a subdirectory. With this patch applied the build works. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
* OvmfPkg/Microvm: copy OvmfPkgX64 files as-isGerd Hoffmann2021-10-052-0/+1584
| | | | | | | | | | | Create Microvm subdirectory. Copy OvmfPkgX64 .dsc and .fdf files unmodified as starting point for MicrovmX64. Changes come as separate patches, to simplify patch review and rebases. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
* ArmVirtPkg: Disable the TPM2 platform hierarchyStefan Berger2021-10-052-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Disable the TPM2 platform hierarchy by directly calling ConfigureTpmPlatformHierarchy(). Per the TCG firmware specification "TCG PC Client Platform Firmware Profile Specification" the TPM 2 platform hierarchy needs to be disabled or a random password set and discarded before the firmware passes control to the next stage bootloader or kernel. Current specs are here: https://trustedcomputinggroup.org/wp-content/uploads/TCG_PCClient_PFP_r1p05_v23_pub.pdf Section 11 states: "Platform Firmware MUST protect access to the Platform Hierarchy and prevent access to the platform hierarchy by non-manufacturer- controlled components." Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3510 Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ArmVirtPkg: Reference new TPM classes in the build system for compilationStefan Berger2021-10-055-0/+6
| | | | | | | | | | | | | | | | | We just added the same functionality to the OvmfPkg. However, on x86, we could use the notification mechanism around gEfiDxeSmmReadyToLockProtocolGuid to indirectly invoke ConfigureTpmPlatformHierarchy(). Since ARM does not have an SMM mode, we have to use direct invocation of this function at the same place in PlatformBootManagerBeforeConsole() as it is called on x86. Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3510 Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ArmVirtPkg/TPM: Add a NULL implementation of TpmPlatformHierarchyLibStefan Berger2021-10-053-0/+54
| | | | | | | | | | | | Add a NULL implementation of the library class TpmPlatformHierarchyLib. Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3510 Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* ArmPkg: SmbiosMiscDxe: Don't populate ExtendedBiosSize when size < 16MBRebecca Cran2021-10-051-3/+4
| | | | | | | | | | | | | | | | | | | | | According to the SMBIOS specification, the ExtendedBiosSize field should be zero when the BIOS size is less than 16MB: "Size (n) where 64K * (n+1) is the size of the physical device containing the BIOS, in bytes. FFh - size is 16MB or greater, see Extended BIOS ROM Size for actual size." Fix the code in MiscBiosVendorFunction.c to only populate the ExtendedBiosSize field if the BIOS size is greater than 16MB. Fix the code to correctly populate the ExtendedBiosSize field with the unit bits set to MB if the size is between 16MB and 16GB. Signed-off-by: Rebecca Cran <rebecca@nuviainc.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Acked-by: Nhi Pham <nhi@os.amperecomputing.com>