[PATCH v2 1/3] DynamicTablesPkg: Add CM_ARM_CPC_INFO object
Jeff Brasen
Introduce the CM_ARM_CPC_INFO CmObj in the ArmNameSpaceObjects.
This allows to describe CPC information, as described in ACPI 6.4, s8.4.7.1 "_CPC (Continuous Performance Control)". Signed-off-by: Jeff Brasen <jbrasen@...> --- .../Include/ArmNameSpaceObjects.h | 148 ++++++++++++++++-- .../ConfigurationManagerObjectParser.c | 79 ++++++++++ 2 files changed, 210 insertions(+), 17 deletions(-) diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h index 102e0f96be..d76cc08e14 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -63,6 +63,7 @@ typedef enum ArmObjectID { EArmObjPciInterruptMapInfo, ///< 39 - Pci Interrupt Map Info EArmObjRmr, ///< 40 - Reserved Memory Range Node EArmObjMemoryRangeDescriptor, ///< 41 - Memory Range Descriptor + EArmObjCpcInfo, ///< 42 - Continuous Performance Control Info EArmObjMax } EARM_OBJECT_ID; @@ -97,99 +98,105 @@ typedef struct CmArmPowerManagementProfileInfo { */ typedef struct CmArmGicCInfo { /// The GIC CPU Interface number. - UINT32 CPUInterfaceNumber; + UINT32 CPUInterfaceNumber; /** The ACPI Processor UID. This must match the _UID of the CPU Device object information described in the DSDT/SSDT for the CPU. */ - UINT32 AcpiProcessorUid; + UINT32 AcpiProcessorUid; /** The flags field as described by the GICC structure in the ACPI Specification. */ - UINT32 Flags; + UINT32 Flags; /** The parking protocol version field as described by the GICC structure in the ACPI Specification. */ - UINT32 ParkingProtocolVersion; + UINT32 ParkingProtocolVersion; /** The Performance Interrupt field as described by the GICC structure in the ACPI Specification. */ - UINT32 PerformanceInterruptGsiv; + UINT32 PerformanceInterruptGsiv; /** The CPU Parked address field as described by the GICC structure in the ACPI Specification. */ - UINT64 ParkedAddress; + UINT64 ParkedAddress; /** The base address for the GIC CPU Interface as described by the GICC structure in the ACPI Specification. */ - UINT64 PhysicalBaseAddress; + UINT64 PhysicalBaseAddress; /** The base address for GICV interface as described by the GICC structure in the ACPI Specification. */ - UINT64 GICV; + UINT64 GICV; /** The base address for GICH interface as described by the GICC structure in the ACPI Specification. */ - UINT64 GICH; + UINT64 GICH; /** The GICV maintenance interrupt as described by the GICC structure in the ACPI Specification. */ - UINT32 VGICMaintenanceInterrupt; + UINT32 VGICMaintenanceInterrupt; /** The base address for GICR interface as described by the GICC structure in the ACPI Specification. */ - UINT64 GICRBaseAddress; + UINT64 GICRBaseAddress; /** The MPIDR for the CPU as described by the GICC structure in the ACPI Specification. */ - UINT64 MPIDR; + UINT64 MPIDR; /** The Processor Power Efficiency class as described by the GICC structure in the ACPI Specification. */ - UINT8 ProcessorPowerEfficiencyClass; + UINT8 ProcessorPowerEfficiencyClass; /** Statistical Profiling Extension buffer overflow GSIV. Zero if unsupported by this processor. This field was introduced in ACPI 6.3 (MADT revision 5) and is therefore ignored when generating MADT revision 4 or lower. */ - UINT16 SpeOverflowInterrupt; + UINT16 SpeOverflowInterrupt; /** The proximity domain to which the logical processor belongs. This field is used to populate the GICC affinity structure in the SRAT table. */ - UINT32 ProximityDomain; + UINT32 ProximityDomain; /** The clock domain to which the logical processor belongs. This field is used to populate the GICC affinity structure in the SRAT table. */ - UINT32 ClockDomain; + UINT32 ClockDomain; /** The GICC Affinity flags field as described by the GICC Affinity structure in the SRAT table. */ - UINT32 AffinityFlags; + UINT32 AffinityFlags; + + /** Optional field: Reference Token for the Cpc info of this processor. + Token identifying a CM_ARM_OBJ_REF structure, itself referencing + CM_ARM_CPC_INFO objects. + */ + CM_OBJECT_TOKEN CpcToken; } CM_ARM_GICC_INFO; /** A structure that describes the @@ -1070,6 +1077,113 @@ typedef struct CmArmRmrDescriptor { UINT64 Length; } CM_ARM_MEMORY_RANGE_DESCRIPTOR; +/** A structure that describes the Cpc information. + + Continuous Performance Control is described in DSDT/SSDT and associated + to cpus/clusters in the cpu topology. + + Unsupported Optional registers should be encoded with NULL resource + Register {(SystemMemory, 0, 0, 0, 0)} + + For values that support Integer or Buffer, integer will be used + if buffer is NULL resource. + If resource is not NULL then Integer must be 0 + + Cf. ACPI 6.4, s8.4.7.1 _CPC (Continuous Performance Control) + + ID: EArmObjCpcInfo +*/ +typedef struct CmArmCpcInfo { + /// The revision number of the _CPC package format. + UINT32 Revision; + + /// Indicates the highest level of performance the processor + /// is theoretically capable of achieving. + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE HighestPerformanceBuffer; + UINT32 HighestPerformanceInteger; + + /// Indicates the highest sustained performance level of the processor. + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE NominalPerformanceBuffer; + UINT32 NominalPerformanceInteger; + + /// Indicates the lowest performance level of the processor with non-linear power savings. + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE LowestNonlinearPerformanceBuffer; + UINT32 LowestNonlinearPerformanceInteger; + + /// Indicates the lowest performance level of the processor.. + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE LowestPerformanceBuffer; + UINT32 LowestPerformanceInteger; + + /// Guaranteed Performance Register Buffer. + /// Optional + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE GuaranteedPerformanceRegister; + + /// Desired Performance Register Buffer. + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE DesiredPerformanceRegister; + + /// Minimum Performance Register Buffer. + /// Optional + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE MinimumPerformanceRegister; + + /// Maximum Performance Register Buffer. + /// Optional + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE MaximumPerformanceRegister; + + /// Performance Reduction Tolerance Register. + /// Optional + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE PerformanceReductionToleranceRegister; + + /// Time Window Register. + /// Optional + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE TimeWindowRegister; + + /// Counter Wraparound Time + /// Optional + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE CounterWraparoundTimeBuffer; + UINT32 CounterWraparoundTimeInteger; + + /// Reference Performance Counter Register + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE ReferencePerformanceCounterRegister; + + /// Delivered Performance Counter Register + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE DeliveredPerformanceCounterRegister; + + /// Performance Limited Register + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE PerformanceLimitedRegister; + + /// CPPC EnableRegister + /// Optional + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE CPPCEnableRegister; + + /// Autonomous Selection Enable + /// Optional + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE AutonomousSelectionEnableBuffer; + UINT32 AutonomousSelectionEnableInteger; + + /// AutonomousActivity-WindowRegister + /// Optional + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE AutonomousActivityWindowRegister; + + /// EnergyPerformance-PreferenceRegister + /// Optional + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE EnergyPerformancePreferenceRegister; + + /// Reference Performance + /// Optional + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE ReferencePerformanceBuffer; + UINT32 ReferencePerformanceInteger; + + /// Lowest Frequency + /// Optional + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE LowestFrequencyBuffer; + UINT32 LowestFrequencyInteger; + + /// Nominal Frequency + /// Optional + EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE NominalFrequencyBuffer; + UINT32 NominalFrequencyInteger; +} CM_ARM_CPC_INFO; + #pragma pack() #endif // ARM_NAMESPACE_OBJECTS_H_ diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c index c1b21d24a4..e2c608443b 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c @@ -423,6 +423,83 @@ STATIC CONST CM_OBJ_PARSER CmPciInterruptMapInfoParser[] = { ARRAY_SIZE (CmArmGenericInterruptParser) }, }; +/** A parser for EArmObjCpcInfo. +*/ +STATIC CONST CM_OBJ_PARSER CmArmCpcInfoParser[] = { + { "HighestPerformanceBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "HighestPerformanceInteger", 4, "0x%llx", NULL }, + { "NominalPerformanceBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "NominalPerformanceInteger", 4, "0x%llx", NULL }, + { "LowestNonlinearPerformanceBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "LowestNonlinearPerformanceInteger", 4, "0x%llx", NULL }, + { "LowestPerformanceBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "LowestPerformanceInteger", 4, "0x%llx", NULL }, + { "GuaranteedPerformanceRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "DesiredPerformanceRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "MinimumPerformanceRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "MaximumPerformanceRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "PerformanceReductionToleranceRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "TimeWindowRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "CounterWraparoundTimeBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "CounterWraparoundTimeInteger", 4, "0x%llx", NULL }, + { "ReferencePerformanceCounterRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "DeliveredPerformanceCounterRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "PerformanceLimitedRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "CPPCEnableRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "AutonomousSelectionEnableBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "AutonomousSelectionEnableInteger", 4, "0x%llx", NULL }, + { "AutonomousActivityWindowRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "EnergyPerformancePreferenceRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "ReferencePerformanceBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "ReferencePerformanceInteger", 4, "0x%llx", NULL }, + { "LowestFrequencyBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "LowestFrequencyInteger", 4, "0x%llx", NULL }, + { "NominalFrequencyBuffer", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE), + NULL, NULL, AcpiGenericAddressParser, + ARRAY_SIZE (AcpiGenericAddressParser) }, + { "NominalFrequencyInteger", 4, "0x%llx", NULL }, +}; + /** A parser for Arm namespace objects. */ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = { @@ -501,6 +578,8 @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = { ARRAY_SIZE (CmArmPciAddressMapInfoParser) }, { "EArmObjPciInterruptMapInfo", CmPciInterruptMapInfoParser, ARRAY_SIZE (CmPciInterruptMapInfoParser) }, + { "EArmObjCpcInfo", CmArmCpcInfoParser, + ARRAY_SIZE (CmArmCpcInfoParser) }, { "EArmObjMax", NULL, 0 }, }; -- 2.25.1 |
|
[PATCH v2 3/3] DynamicTablesPkg: SSDT CPU _CPC generator
Jeff Brasen
Add code to use a token attached to GICC to generate _CPC object on cpus.
Signed-off-by: Jeff Brasen <jbrasen@...> --- .../SsdtCpuTopologyGenerator.c | 223 +++++++++++++++++- 1 file changed, 217 insertions(+), 6 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c index 8561f48e1f..56741e7b58 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c @@ -76,6 +76,16 @@ GET_OBJECT_LIST ( CM_ARM_LPI_INFO ); +/** + This macro expands to a function that retrieves the CPC + information from the Configuration Manager. +*/ +GET_OBJECT_LIST ( + EObjNameSpaceArm, + EArmObjCpcInfo, + CM_ARM_CPC_INFO + ); + /** Initialize the TokenTable. One entry should be allocated for each CM_ARM_PROC_HIERARCHY_INFO @@ -229,6 +239,183 @@ WriteAslName ( return EFI_SUCCESS; } +/** Utility function to check if generic address points to NULL + + @param [in] Address Pointer to the Generic address + + @retval TRUE Address is system memory with an Address of 0. + @retval FALSE Address does not point to NULL. +**/ +STATIC +BOOLEAN +EFIAPI +IsNullGenericAddress ( + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *Address + ) +{ + if ((Address == NULL) || + ((Address->AddressSpaceId == EFI_ACPI_6_4_SYSTEM_MEMORY) && + (Address->Address == 0x0))) + { + return TRUE; + } + + return FALSE; +} + +/** Create and add an _CPC Node to Cpu Node. + + For instance, transform an AML node from: + Device (C002) + { + Name (_UID, 2) + Name (_HID, "ACPI0007") + } + + To: + Device (C002) + { + Name (_UID, 2) + Name (_HID, "ACPI0007") + Name(_CPC, Package() + { + NumEntries, // Integer + Revision, // Integer + HighestPerformance, // Integer or Buffer (Resource Descriptor) + NominalPerformance, // Integer or Buffer (Resource Descriptor) + LowestNonlinearPerformance, // Integer or Buffer (Resource Descriptor) + LowestPerformance, // Integer or Buffer (Resource Descriptor) + GuaranteedPerformanceRegister, // Buffer (Resource Descriptor) + DesiredPerformanceRegister , // Buffer (Resource Descriptor) + MinimumPerformanceRegister , // Buffer (Resource Descriptor) + MaximumPerformanceRegister , // Buffer (Resource Descriptor) + PerformanceReductionToleranceRegister, // Buffer (Resource Descriptor) + TimeWindowRegister, // Buffer (Resource Descriptor) + CounterWraparoundTime, // Integer or Buffer (Resource Descriptor) + ReferencePerformanceCounterRegister, // Buffer (Resource Descriptor) + DeliveredPerformanceCounterRegister, // Buffer (Resource Descriptor) + PerformanceLimitedRegister, // Buffer (Resource Descriptor) + CPPCEnableRegister // Buffer (Resource Descriptor) + AutonomousSelectionEnable, // Integer or Buffer (Resource Descriptor) + AutonomousActivityWindowRegister, // Buffer (Resource Descriptor) + EnergyPerformancePreferenceRegister, // Buffer (Resource Descriptor) + ReferencePerformance // Integer or Buffer (Resource Descriptor) + LowestFrequency, // Integer or Buffer (Resource Descriptor) + NominalFrequency // Integer or Buffer (Resource Descriptor) + }) + } + + @param [in] Generator The SSDT Cpu Topology generator. + @param [in] CfgMgrProtocol Pointer to the Configuration Manager + Protocol Interface. + @param [in] ProcHierarchyNodeInfo CM_ARM_PROC_HIERARCHY_INFO describing + the Cpu. + @param [in] Node CPU Node to which the _CPC node is + attached. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. +**/ +STATIC +EFI_STATUS +EFIAPI +CreateAmlCpcNode ( + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, + IN CM_ARM_GICC_INFO *GicCInfo, + IN AML_OBJECT_NODE_HANDLE *Node + ) +{ + EFI_STATUS Status; + CM_ARM_CPC_INFO *CpcInfo; + + Status = GetEArmObjCpcInfo ( + CfgMgrProtocol, + GicCInfo->CpcToken, + &CpcInfo, + NULL + ); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + Status = AmlCreateCpcNode ( + CpcInfo->Revision, + IsNullGenericAddress (&CpcInfo->HighestPerformanceBuffer) ? + NULL : + &CpcInfo->HighestPerformanceBuffer, + CpcInfo->HighestPerformanceInteger, + IsNullGenericAddress (&CpcInfo->NominalPerformanceBuffer) ? + NULL : + &CpcInfo->NominalPerformanceBuffer, + CpcInfo->NominalPerformanceInteger, + IsNullGenericAddress (&CpcInfo->LowestNonlinearPerformanceBuffer) ? + NULL : + &CpcInfo->LowestNonlinearPerformanceBuffer, + CpcInfo->LowestNonlinearPerformanceInteger, + IsNullGenericAddress (&CpcInfo->LowestPerformanceBuffer) ? + NULL : + &CpcInfo->LowestPerformanceBuffer, + CpcInfo->LowestPerformanceInteger, + IsNullGenericAddress (&CpcInfo->GuaranteedPerformanceRegister) ? + NULL : + &CpcInfo->GuaranteedPerformanceRegister, + IsNullGenericAddress (&CpcInfo->DesiredPerformanceRegister) ? + NULL : + &CpcInfo->DesiredPerformanceRegister, + IsNullGenericAddress (&CpcInfo->MinimumPerformanceRegister) ? + NULL : + &CpcInfo->MinimumPerformanceRegister, + IsNullGenericAddress (&CpcInfo->MaximumPerformanceRegister) ? + NULL : + &CpcInfo->MaximumPerformanceRegister, + IsNullGenericAddress (&CpcInfo->PerformanceReductionToleranceRegister) ? + NULL : + &CpcInfo->PerformanceReductionToleranceRegister, + IsNullGenericAddress (&CpcInfo->TimeWindowRegister) ? + NULL : + &CpcInfo->TimeWindowRegister, + IsNullGenericAddress (&CpcInfo->CounterWraparoundTimeBuffer) ? + NULL : + &CpcInfo->CounterWraparoundTimeBuffer, + CpcInfo->CounterWraparoundTimeInteger, + &CpcInfo->ReferencePerformanceCounterRegister, + &CpcInfo->DeliveredPerformanceCounterRegister, + &CpcInfo->PerformanceLimitedRegister, + IsNullGenericAddress (&CpcInfo->CPPCEnableRegister) ? + NULL : + &CpcInfo->CPPCEnableRegister, + IsNullGenericAddress (&CpcInfo->AutonomousSelectionEnableBuffer) ? + NULL : + &CpcInfo->AutonomousSelectionEnableBuffer, + CpcInfo->AutonomousSelectionEnableInteger, + IsNullGenericAddress (&CpcInfo->AutonomousActivityWindowRegister) ? + NULL : + &CpcInfo->AutonomousActivityWindowRegister, + IsNullGenericAddress (&CpcInfo->EnergyPerformancePreferenceRegister) ? + NULL : + &CpcInfo->EnergyPerformancePreferenceRegister, + IsNullGenericAddress (&CpcInfo->ReferencePerformanceBuffer) ? + NULL : + &CpcInfo->ReferencePerformanceBuffer, + CpcInfo->ReferencePerformanceInteger, + IsNullGenericAddress (&CpcInfo->LowestFrequencyBuffer) ? + NULL : + &CpcInfo->LowestFrequencyBuffer, + CpcInfo->LowestFrequencyInteger, + IsNullGenericAddress (&CpcInfo->NominalFrequencyBuffer) ? + NULL : + &CpcInfo->NominalFrequencyBuffer, + CpcInfo->NominalFrequencyInteger, + Node, + NULL + ); + ASSERT_EFI_ERROR (Status); + return Status; +} + /** Create and add an _LPI method to Cpu/Cluster Node. For instance, transform an AML node from: @@ -581,7 +768,20 @@ CreateAmlCpuFromProcHierarchy ( // CM_ARM_PROC_HIERARCHY_INFO, create an _LPI method returning them. if (ProcHierarchyNodeInfo->LpiToken != CM_NULL_TOKEN) { Status = CreateAmlLpiMethod (Generator, ProcHierarchyNodeInfo, CpuNode); - ASSERT_EFI_ERROR (Status); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + } + + // If a CPC info is associated with the + // GicCinfo, create an _CPC method returning them. + if (GicCInfo->CpcToken != CM_NULL_TOKEN) { + Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, GicCInfo, CpuNode); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } } return Status; @@ -934,10 +1134,11 @@ CreateTopologyFromGicC ( IN AML_OBJECT_NODE_HANDLE ScopeNode ) { - EFI_STATUS Status; - CM_ARM_GICC_INFO *GicCInfo; - UINT32 GicCInfoCount; - UINT32 Index; + EFI_STATUS Status; + CM_ARM_GICC_INFO *GicCInfo; + UINT32 GicCInfoCount; + UINT32 Index; + AML_OBJECT_NODE_HANDLE CpuNode; ASSERT (Generator != NULL); ASSERT (CfgMgrProtocol != NULL); @@ -961,12 +1162,22 @@ CreateTopologyFromGicC ( ScopeNode, &GicCInfo[Index], Index, - NULL + &CpuNode ); if (EFI_ERROR (Status)) { ASSERT (0); break; } + + // If a CPC info is associated with the + // GicCinfo, create an _CPC method returning them. + if (GicCInfo->CpcToken != CM_NULL_TOKEN) { + Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, &GicCInfo[Index], CpuNode); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + } } // for return Status; -- 2.25.1 |
|
[PATCH v2 0/3] DynamicTablesPkg: _CPC support
Jeff Brasen
Add generator for creating the _CPC object for CPU nodes.
If viewing this review by a pull request is helpful one exists here: https://github.com/NVIDIA/edk2/pull/12 Change Log: v1 - Initial Revision v2 - Added revision to object, improved error handling, changed to ACPI 6.4 structures. Jeff Brasen (3): DynamicTablesPkg: Add CM_ARM_CPC_INFO object DynamicTablesPkg: AML Code generation to add _CPC entries DynamicTablesPkg: SSDT CPU _CPC generator .../Include/ArmNameSpaceObjects.h | 148 ++++- .../Include/Library/AmlLib/AmlLib.h | 156 +++++ .../SsdtCpuTopologyGenerator.c | 223 ++++++- .../Common/AmlLib/CodeGen/AmlCodeGen.c | 543 ++++++++++++++++++ .../ConfigurationManagerObjectParser.c | 79 +++ 5 files changed, 1126 insertions(+), 23 deletions(-) -- 2.25.1 |
|
[PATCH v6 1/1] NetworkPkg/HttpBootDxe: Add Support for HTTPS Proxy Server for HTTP Boot
Saloni Kasbekar
Add CONNECT HTTP command to create a tunnel from Proxy to EndPoint Server.
Add support to connect through proxy server using multi-URI DevicePath sent to the Boot Manager. Cc: Maciej Rabeda <maciej.rabeda@...> Cc: Wu Jiaxin <jiaxin.wu@...> Cc: Siyuan Fu <siyuan.fu@...> Cc: Jian J Wang <jian.j.wang@...> Cc: Liming Gao <gaoliming@...> Signed-off-by: Saloni Kasbekar <saloni.kasbekar@...> --- .../Library/UefiBootManagerLib/BmBoot.c | 28 +++ .../UefiBootManagerLib/BmBootDescription.c | 4 +- MdePkg/Include/Protocol/Http.h | 5 + NetworkPkg/HttpBootDxe/HttpBootClient.c | 222 +++++++++++++++++- NetworkPkg/HttpBootDxe/HttpBootClient.h | 15 ++ NetworkPkg/HttpBootDxe/HttpBootDxe.h | 6 + NetworkPkg/HttpBootDxe/HttpBootImpl.c | 211 ++++++++++++----- NetworkPkg/HttpBootDxe/HttpBootImpl.h | 8 + NetworkPkg/HttpBootDxe/HttpBootSupport.c | 18 +- NetworkPkg/HttpBootDxe/HttpBootSupport.h | 8 +- NetworkPkg/HttpDxe/HttpDriver.h | 2 + NetworkPkg/HttpDxe/HttpDxe.inf | 1 + NetworkPkg/HttpDxe/HttpImpl.c | 139 +++++++++-- NetworkPkg/HttpDxe/HttpProto.c | 41 ++-- NetworkPkg/HttpDxe/HttpProto.h | 14 +- NetworkPkg/HttpDxe/HttpsSupport.c | 14 +- NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c | 5 + 17 files changed, 631 insertions(+), 110 deletions(-) diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c index 962892d38f14..fdef1ba292e2 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c @@ -1513,6 +1513,9 @@ BmExpandLoadFiles ( UINTN HandleCount; UINTN Index; EFI_DEVICE_PATH_PROTOCOL *Node; + URI_DEVICE_PATH *NullUriPath; + + NullUriPath = NULL; // // Get file buffer from load file instance. @@ -1545,11 +1548,36 @@ BmExpandLoadFiles ( for (Index = 0; Index < HandleCount; Index++) { if (BmMatchHttpBootDevicePath (DevicePathFromHandle (Handles[Index]), FilePath)) { + // + // Matches HTTP Boot Device Path described as + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)]/Uri(...) + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)]/Uri(...) + // + Handle = Handles[Index]; + goto Done; + } + } + + NullUriPath = (URI_DEVICE_PATH *)CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_URI_DP, + (UINT16)(sizeof (URI_DEVICE_PATH)) + ); + for (Index = 0; Index < HandleCount; Index++) { + if (BmMatchHttpBootDevicePath (AppendDevicePathNode (DevicePathFromHandle (Handles[Index]), (EFI_DEVICE_PATH_PROTOCOL *)NullUriPath), FilePath)) { + // + // Matches HTTP Boot Device Path described as + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)]/Uri(...)/Uri(...) + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)]/Uri(...)/Uri(...) + // Handle = Handles[Index]; break; } } + FreePool (NullUriPath); + +Done: if (Handles != NULL) { FreePool (Handles); } diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c index fac33b9ee915..19b7cd14575f 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c @@ -412,8 +412,8 @@ BmGetNetworkDescription ( // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...) // // The HTTP device path is like: - // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)]/Uri(...) - // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)]/Uri(...) + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)]/Uri(...)[/Uri(...)] + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)]/Uri(...)[/Uri(...)] // while (!IsDevicePathEnd (DevicePath) && ((DevicePathType (DevicePath) != MESSAGING_DEVICE_PATH) || diff --git a/MdePkg/Include/Protocol/Http.h b/MdePkg/Include/Protocol/Http.h index 28e622159392..d47092c58e5a 100644 --- a/MdePkg/Include/Protocol/Http.h +++ b/MdePkg/Include/Protocol/Http.h @@ -191,6 +191,11 @@ typedef struct { /// is assumed. See RFC 3986 for more details on URI syntax. /// CHAR16 *Url; + /// + /// The URI of an endpoint host if the Url field contains the address of a proxy server. + /// This field will be NULL there is no proxy server in the device path. + /// + CHAR16 *EndPointUrl; } EFI_HTTP_REQUEST_DATA; /// diff --git a/NetworkPkg/HttpBootDxe/HttpBootClient.c b/NetworkPkg/HttpBootDxe/HttpBootClient.c index 40f64fcb6bf8..f8ff5d0e8956 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootClient.c +++ b/NetworkPkg/HttpBootDxe/HttpBootClient.c @@ -678,6 +678,10 @@ HttpBootFreeCache ( FreePool (Cache->RequestData->Url); } + if (Cache->RequestData->EndPointUrl != NULL) { + FreePool (Cache->RequestData->EndPointUrl); + } + FreePool (Cache->RequestData); } @@ -901,6 +905,200 @@ HttpBootGetBootFileCallback ( return EFI_SUCCESS; } +/** + This function establishes a connection through a proxy server + + @param[in] Private The pointer to the driver's private data. + + @retval EFI_SUCCESS Connection successful. + @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources + @retval Others Unexpected error happened. + +**/ +EFI_STATUS +HttpBootConnectProxy ( + IN HTTP_BOOT_PRIVATE_DATA *Private + ) +{ + EFI_STATUS Status; + EFI_HTTP_STATUS_CODE StatusCode; + CHAR8 *HostName; + EFI_HTTP_REQUEST_DATA *RequestData; + HTTP_IO_RESPONSE_DATA *ResponseData; + HTTP_IO *HttpIo; + HTTP_IO_HEADER *HttpIoHeader; + CHAR16 *Url; + CHAR16 *EndPointUrl; + UINTN UrlSize; + VOID *UrlParser; + + UrlSize = AsciiStrSize (Private->BootFileUri); + Url = AllocatePool (UrlSize * sizeof (CHAR16)); + if (Url == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + AsciiStrToUnicodeStrS (Private->BootFileUri, Url, UrlSize); + + UrlSize = AsciiStrSize (Private->EndPointUri); + EndPointUrl = AllocatePool (UrlSize * (sizeof (CHAR16))); + if (EndPointUrl == NULL) { + Status = EFI_OUT_OF_RESOURCES; + goto ERROR_1; + } + + AsciiStrToUnicodeStrS (Private->EndPointUri, EndPointUrl, UrlSize); + + // + // Send HTTP request message. + // + + // + // Build HTTP header for the request, 2 headers are needed to send a CONNECT method: + // Host + // User + // + HttpIoHeader = HttpIoCreateHeader (2); + if (HttpIoHeader == NULL) { + Status = EFI_OUT_OF_RESOURCES; + goto ERROR_2; + } + + // + // Add HTTP header field 1: Host (EndPoint URI) + // + Status = HttpParseUrl (Private->EndPointUri, (UINT32)AsciiStrLen (Private->EndPointUri), FALSE, &UrlParser); + if (EFI_ERROR (Status)) { + goto ERROR_2; + } + + Status = HttpUrlGetHostName ( + Private->EndPointUri, + UrlParser, + &HostName + ); + if (EFI_ERROR (Status)) { + goto ERROR_2; + } + + Status = HttpIoSetHeader ( + HttpIoHeader, + HTTP_HEADER_HOST, + HostName + ); + if (EFI_ERROR (Status)) { + goto ERROR_2; + } + + // + // Add HTTP header field 2: User-Agent + // + Status = HttpIoSetHeader ( + HttpIoHeader, + HTTP_HEADER_USER_AGENT, + HTTP_USER_AGENT_EFI_HTTP_BOOT + ); + if (EFI_ERROR (Status)) { + goto ERROR_2; + } + + // + // Build the rest of HTTP request info. + // + RequestData = AllocatePool (sizeof (EFI_HTTP_REQUEST_DATA)); + if (RequestData == NULL) { + Status = EFI_OUT_OF_RESOURCES; + goto ERROR_2; + } + + RequestData->Method = HttpMethodConnect; + RequestData->Url = Url; + RequestData->EndPointUrl = EndPointUrl; + + // + // Send out the request to HTTP server. + // + HttpIo = &Private->HttpIo; + Status = HttpIoSendRequest ( + HttpIo, + RequestData, + HttpIoHeader->HeaderCount, + HttpIoHeader->Headers, + 0, + NULL + ); + if (EFI_ERROR (Status)) { + goto ERROR_3; + } + + // + // Receive HTTP response message. + // + + // + // Use zero BodyLength to only receive the response headers. + // + ResponseData = AllocateZeroPool (sizeof (HTTP_IO_RESPONSE_DATA)); + if (ResponseData == NULL) { + Status = EFI_OUT_OF_RESOURCES; + goto ERROR_3; + } + + Status = HttpIoRecvResponse ( + &Private->HttpIo, + TRUE, + ResponseData + ); + + if (EFI_ERROR (Status) || EFI_ERROR (ResponseData->Status)) { + if (EFI_ERROR (ResponseData->Status)) { + StatusCode = HttpIo->RspToken.Message->Data.Response->StatusCode; + HttpBootPrintErrorMessage (StatusCode); + Status = ResponseData->Status; + } + + goto ERROR_4; + } + + if (EndPointUrl != NULL) { + FreePool (EndPointUrl); + } + + if (ResponseData != NULL) { + FreePool (ResponseData); + } + + if (RequestData != NULL) { + FreePool (RequestData); + } + + return Status; + +ERROR_4: + if (ResponseData != NULL) { + FreePool (ResponseData); + } + +ERROR_3: + if (RequestData != NULL) { + FreePool (RequestData); + } + +ERROR_2: + HttpIoFreeHeader (HttpIoHeader); + +ERROR_1: + if (EndPointUrl != NULL) { + FreePool (EndPointUrl); + } + + if (Url != NULL) { + FreePool (Url); + } + + return Status; +} + /** This function download the boot file by using UEFI HTTP protocol. @@ -950,6 +1148,7 @@ HttpBootGetBootFile ( UINT8 *Block; UINTN UrlSize; CHAR16 *Url; + CHAR16 *EndPointUrl; BOOLEAN IdentityMode; UINTN ReceivedSize; CHAR8 BaseAuthValue[80]; @@ -977,6 +1176,20 @@ HttpBootGetBootFile ( } AsciiStrToUnicodeStrS (Private->BootFileUri, Url, UrlSize); + + if (Private->EndPointUri != NULL) { + UrlSize = AsciiStrSize (Private->EndPointUri); + EndPointUrl = AllocatePool (UrlSize * (sizeof (CHAR16))); + if (EndPointUrl == NULL) { + Status = EFI_OUT_OF_RESOURCES; + goto ERROR_1; + } + + AsciiStrToUnicodeStrS (Private->EndPointUri, EndPointUrl, UrlSize); + } else { + EndPointUrl = NULL; + } + if (!HeaderOnly && (Buffer != NULL)) { Status = HttpBootGetFileFromCache (Private, Url, BufferSize, Buffer, ImageType); if (Status != EFI_NOT_FOUND) { @@ -1106,8 +1319,9 @@ HttpBootGetBootFile ( goto ERROR_3; } - RequestData->Method = HeaderOnly ? HttpMethodHead : HttpMethodGet; - RequestData->Url = Url; + RequestData->Method = HeaderOnly ? HttpMethodHead : HttpMethodGet; + RequestData->Url = Url; + RequestData->EndPointUrl = EndPointUrl; // // 2.3 Record the request info in a temp cache item. @@ -1441,6 +1655,10 @@ ERROR_2: } ERROR_1: + if (EndPointUrl != NULL) { + FreePool (EndPointUrl); + } + if (Url != NULL) { FreePool (Url); } diff --git a/NetworkPkg/HttpBootDxe/HttpBootClient.h b/NetworkPkg/HttpBootDxe/HttpBootClient.h index 2fba71367950..fcd624f536a3 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootClient.h +++ b/NetworkPkg/HttpBootDxe/HttpBootClient.h @@ -86,6 +86,21 @@ HttpBootCreateHttpIo ( IN HTTP_BOOT_PRIVATE_DATA *Private ); +/** + This function establishes a connection through a proxy server + + @param[in] Private The pointer to the driver's private data. + + @retval EFI_SUCCESS Connection successful. + @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources + @retval Others Unexpected error happened. + +**/ +EFI_STATUS +HttpBootConnectProxy ( + IN HTTP_BOOT_PRIVATE_DATA *Private + ); + /** This function download the boot file by using UEFI HTTP protocol. diff --git a/NetworkPkg/HttpBootDxe/HttpBootDxe.h b/NetworkPkg/HttpBootDxe/HttpBootDxe.h index 5ff8ad4698b2..e2eb1ffc4544 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootDxe.h +++ b/NetworkPkg/HttpBootDxe/HttpBootDxe.h @@ -223,6 +223,12 @@ struct _HTTP_BOOT_PRIVATE_DATA { CHAR8 *FilePathUri; VOID *FilePathUriParser; + // + // URI string for the endpoint host if BootFileUri contains a proxy + // server in the path + // + CHAR8 *EndPointUri; + // // Cached HTTP data // diff --git a/NetworkPkg/HttpBootDxe/HttpBootImpl.c b/NetworkPkg/HttpBootDxe/HttpBootImpl.c index b4c61925b94f..d5332f2bac71 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootImpl.c +++ b/NetworkPkg/HttpBootDxe/HttpBootImpl.c @@ -116,8 +116,10 @@ HttpBootStart ( UINTN Index; EFI_STATUS Status; CHAR8 *Uri; + CHAR8 *EndPointUri; - Uri = NULL; + Uri = NULL; + EndPointUri = NULL; if ((Private == NULL) || (FilePath == NULL)) { return EFI_INVALID_PARAMETER; @@ -127,7 +129,7 @@ HttpBootStart ( // Check the URI in the input FilePath, in order to see whether it is // required to boot from a new specified boot file. // - Status = HttpBootParseFilePath (FilePath, &Uri); + Status = HttpBootParseFilePath (FilePath, &Uri, &EndPointUri); if (EFI_ERROR (Status)) { return EFI_INVALID_PARAMETER; } @@ -154,6 +156,10 @@ HttpBootStart ( FreePool (Uri); } + if (EndPointUri != NULL) { + FreePool (EndPointUri); + } + return Status; } } else { @@ -164,6 +170,10 @@ HttpBootStart ( FreePool (Uri); } + if (EndPointUri != NULL) { + FreePool (EndPointUri); + } + return EFI_ALREADY_STARTED; } } @@ -180,6 +190,10 @@ HttpBootStart ( FreePool (Uri); } + if (EndPointUri != NULL) { + FreePool (EndPointUri); + } + return EFI_UNSUPPORTED; } @@ -187,6 +201,7 @@ HttpBootStart ( // Record the specified URI and prepare the URI parser if needed. // Private->FilePathUri = Uri; + Private->EndPointUri = EndPointUri; if (Private->FilePathUri != NULL) { Status = HttpParseUrl ( Private->FilePathUri, @@ -274,6 +289,136 @@ HttpBootDhcp ( return Status; } +/** + Issue calls to HttpBootGetBootFile() based on current Boot File State + + @param[in] Private The pointer to the driver's private data. + @param[in, out] BufferSize On input the size of Buffer in bytes. On output with a return + code of EFI_SUCCESS, the amount of data transferred to + Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL, + the size of Buffer required to retrieve the requested file. + @param[in] Buffer The memory buffer to transfer the file to. If Buffer is NULL, + then the size of the requested file is returned in + BufferSize. + @param[out] ImageType The image type of the downloaded file. + + @retval EFI_SUCCESS The file was loaded. + @retval EFI_INVALID_PARAMETER BufferSize is NULL or Buffer Size is not NULL but Buffer is NULL. + @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources + @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current directory entry. + BufferSize has been updated with the size needed to complete + the request. + @retval EFI_ACCESS_DENIED Server authentication failed. + @retval Others Unexpected error happened. + +**/ +EFI_STATUS +HttpBootGetBootFileCaller ( + IN HTTP_BOOT_PRIVATE_DATA *Private, + IN OUT UINTN *BufferSize, + IN VOID *Buffer OPTIONAL, + OUT HTTP_BOOT_IMAGE_TYPE *ImageType + ) +{ + HTTP_GET_BOOT_FILE_STATE State; + EFI_STATUS Status; + + if (Private->BootFileSize == 0) { + if (Private->EndPointUri != NULL) { + State = ConnectToProxy; + } else { + State = GetBootFileHead; + } + } else { + State = LoadBootFile; + } + + for ( ; ;) { + switch (State) { + case GetBootFileHead: + // + // Try to use HTTP HEAD method. + // + Status = HttpBootGetBootFile ( + Private, + TRUE, + &Private->BootFileSize, + NULL, + &Private->ImageType + ); + if ((EFI_ERROR (Status)) && (Status != EFI_BUFFER_TOO_SMALL)) { + if ((Private->AuthData != NULL) && (Status == EFI_ACCESS_DENIED)) { + // + // Try to use HTTP HEAD method again since the Authentication information is provided. + // + State = GetBootFileHead; + } else { + State = GetBootFileGet; + } + } else { + State = LoadBootFile; + } + + break; + + case GetBootFileGet: + // + // Failed to get file size by HEAD method, may be trunked encoding, try HTTP GET method. + // + ASSERT (Private->BootFileSize == 0); + Status = HttpBootGetBootFile ( + Private, + FALSE, + &Private->BootFileSize, + NULL, + &Private->ImageType + ); + if (EFI_ERROR (Status) && (Status != EFI_BUFFER_TOO_SMALL)) { + State = GetBootFileError; + } else { + State = LoadBootFile; + } + + break; + + case ConnectToProxy: + Status = HttpBootConnectProxy (Private); + if (Status == EFI_SUCCESS) { + State = GetBootFileHead; + } else { + State = GetBootFileError; + } + + break; + + case LoadBootFile: + if (*BufferSize < Private->BootFileSize) { + *BufferSize = Private->BootFileSize; + *ImageType = Private->ImageType; + Status = EFI_BUFFER_TOO_SMALL; + return Status; + } + + // + // Load the boot file into Buffer + // + Status = HttpBootGetBootFile ( + Private, + FALSE, + BufferSize, + Buffer, + ImageType + ); + return Status; + + case GetBootFileError: + default: + AsciiPrint ("\n Error: Could not retrieve NBP file size from HTTP server.\n"); + return Status; + } + } +} + /** Attempt to download the boot file through HTTP message exchange. @@ -345,68 +490,10 @@ HttpBootLoadFile ( } } - if (Private->BootFileSize == 0) { - // - // Discover the information about the bootfile if we haven't. - // - - // - // Try to use HTTP HEAD method. - // - Status = HttpBootGetBootFile ( - Private, - TRUE, - &Private->BootFileSize, - NULL, - &Private->ImageType - ); - if ((Private->AuthData != NULL) && (Status == EFI_ACCESS_DENIED)) { - // - // Try to use HTTP HEAD method again since the Authentication information is provided. - // - Status = HttpBootGetBootFile ( - Private, - TRUE, - &Private->BootFileSize, - NULL, - &Private->ImageType - ); - } else if ((EFI_ERROR (Status)) && (Status != EFI_BUFFER_TOO_SMALL)) { - // - // Failed to get file size by HEAD method, may be trunked encoding, try HTTP GET method. - // - ASSERT (Private->BootFileSize == 0); - Status = HttpBootGetBootFile ( - Private, - FALSE, - &Private->BootFileSize, - NULL, - &Private->ImageType - ); - if (EFI_ERROR (Status) && (Status != EFI_BUFFER_TOO_SMALL)) { - AsciiPrint ("\n Error: Could not retrieve NBP file size from HTTP server.\n"); - goto ON_EXIT; - } - } - } - - if (*BufferSize < Private->BootFileSize) { - *BufferSize = Private->BootFileSize; - *ImageType = Private->ImageType; - Status = EFI_BUFFER_TOO_SMALL; - goto ON_EXIT; - } - // - // Load the boot file into Buffer + // Load the Boot File // - Status = HttpBootGetBootFile ( - Private, - FALSE, - BufferSize, - Buffer, - ImageType - ); + Status = HttpBootGetBootFileCaller (Private, BufferSize, Buffer, ImageType); ON_EXIT: HttpBootUninstallCallback (Private); diff --git a/NetworkPkg/HttpBootDxe/HttpBootImpl.h b/NetworkPkg/HttpBootDxe/HttpBootImpl.h index 55adc9cb500f..e4ffc3ed48e5 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootImpl.h +++ b/NetworkPkg/HttpBootDxe/HttpBootImpl.h @@ -11,6 +11,14 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #define HTTP_BOOT_CHECK_MEDIA_WAITING_TIME EFI_TIMER_PERIOD_SECONDS(20) +typedef enum { + GetBootFileHead, + GetBootFileGet, + ConnectToProxy, + LoadBootFile, + GetBootFileError +} HTTP_GET_BOOT_FILE_STATE; + /** Attempt to complete a DHCPv4 D.O.R.A or DHCPv6 S.R.A.A sequence to retrieve the boot resource information. diff --git a/NetworkPkg/HttpBootDxe/HttpBootSupport.c b/NetworkPkg/HttpBootDxe/HttpBootSupport.c index 236ef259318b..fddcf8b16746 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootSupport.c +++ b/NetworkPkg/HttpBootDxe/HttpBootSupport.c @@ -558,6 +558,7 @@ HttpBootCheckUriScheme ( @param[in] FilePath Pointer to the device path which contains a URI device path node. @param[out] UriAddress The URI address string extract from the device path. + @param[out] EndPointUriAddress The URI address string for the endpoint host if UriAddress contains the address of a proxy server @retval EFI_SUCCESS The URI string is returned. @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. @@ -566,7 +567,8 @@ HttpBootCheckUriScheme ( EFI_STATUS HttpBootParseFilePath ( IN EFI_DEVICE_PATH_PROTOCOL *FilePath, - OUT CHAR8 **UriAddress + OUT CHAR8 **UriAddress, + OUT CHAR8 **EndPointUriAddress ) { EFI_DEVICE_PATH_PROTOCOL *TempDevicePath; @@ -578,8 +580,9 @@ HttpBootParseFilePath ( return EFI_INVALID_PARAMETER; } - *UriAddress = NULL; - + Uri = NULL; + *UriAddress = NULL; + *EndPointUriAddress = NULL; // // Extract the URI address from the FilePath // @@ -601,6 +604,15 @@ HttpBootParseFilePath ( break; } + if (Uri != NULL) { + // + // Device Path with Proxy Server will be described as + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)]/Uri(EndPointServer)/Uri(ProxyServer/FilePath) + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)]/Uri(EndPointServer)/Uri(ProxyServer/FilePath) + // + *EndPointUriAddress = Uri; + } + Uri = AllocatePool (UriStrLength + 1); if (Uri == NULL) { return EFI_OUT_OF_RESOURCES; diff --git a/NetworkPkg/HttpBootDxe/HttpBootSupport.h b/NetworkPkg/HttpBootDxe/HttpBootSupport.h index 3698e5593642..6228f37e3676 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootSupport.h +++ b/NetworkPkg/HttpBootDxe/HttpBootSupport.h @@ -138,8 +138,9 @@ HttpBootCheckUriScheme ( Caller need to free the buffer in the UriAddress pointer. - @param[in] FilePath Pointer to the device path which contains a URI device path node. - @param[out] UriAddress The URI address string extract from the device path. + @param[in] FilePath Pointer to the device path which contains a URI device path node. + @param[out] UriAddress The URI address string extract from the device path. + @param[out] EndPointUriAddress The URI address string for the endpoint host if UriAddress contains the address of a proxy server @retval EFI_SUCCESS The URI string is returned. @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. @@ -148,7 +149,8 @@ HttpBootCheckUriScheme ( EFI_STATUS HttpBootParseFilePath ( IN EFI_DEVICE_PATH_PROTOCOL *FilePath, - OUT CHAR8 **UriAddress + OUT CHAR8 **UriAddress, + OUT CHAR8 **EndPointUriAddress ); /** diff --git a/NetworkPkg/HttpDxe/HttpDriver.h b/NetworkPkg/HttpDxe/HttpDriver.h index 01a6bb7f4b7a..e0917f431e53 100644 --- a/NetworkPkg/HttpDxe/HttpDriver.h +++ b/NetworkPkg/HttpDxe/HttpDriver.h @@ -26,6 +26,7 @@ #include <Library/NetLib.h> #include <Library/HttpLib.h> #include <Library/DpcLib.h> +#include <Library/PrintLib.h> // // UEFI Driver Model Protocols @@ -64,6 +65,7 @@ // Driver Version // #define HTTP_DRIVER_VERSION 0xa +#define URI_STR_MAX_SIZE 255 // // Protocol instances diff --git a/NetworkPkg/HttpDxe/HttpDxe.inf b/NetworkPkg/HttpDxe/HttpDxe.inf index c9502d0bb6d0..30b7de1951d1 100644 --- a/NetworkPkg/HttpDxe/HttpDxe.inf +++ b/NetworkPkg/HttpDxe/HttpDxe.inf @@ -47,6 +47,7 @@ NetLib HttpLib DpcLib + PrintLib [Protocols] gEfiHttpServiceBindingProtocolGuid ## BY_START diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index 7c5c925cf78b..24ce87fd7d14 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.c +++ b/NetworkPkg/HttpDxe/HttpImpl.c @@ -233,35 +233,45 @@ EfiHttpRequest ( EFI_HTTP_MESSAGE *HttpMsg; EFI_HTTP_REQUEST_DATA *Request; VOID *UrlParser; + VOID *EndPointUrlParser; EFI_STATUS Status; CHAR8 *HostName; + CHAR8 *EndPointHostName; UINTN HostNameSize; UINT16 RemotePort; + UINT16 EndPointRemotePort; HTTP_PROTOCOL *HttpInstance; BOOLEAN Configure; BOOLEAN ReConfigure; BOOLEAN TlsConfigure; CHAR8 *RequestMsg; CHAR8 *Url; + CHAR8 *EndPointUrl; UINTN UrlLen; CHAR16 *HostNameStr; HTTP_TOKEN_WRAP *Wrap; CHAR8 *FileUrl; UINTN RequestMsgSize; EFI_HANDLE ImageHandle; + CHAR8 *EndPointUrlMsg; // // Initializations // - Url = NULL; - UrlParser = NULL; - RemotePort = 0; - HostName = NULL; - RequestMsg = NULL; - HostNameStr = NULL; - Wrap = NULL; - FileUrl = NULL; - TlsConfigure = FALSE; + Url = NULL; + UrlParser = NULL; + EndPointUrlParser = NULL; + RemotePort = 0; + EndPointRemotePort = 0; + HostName = NULL; + EndPointHostName = NULL; + RequestMsg = NULL; + HostNameStr = NULL; + Wrap = NULL; + FileUrl = NULL; + TlsConfigure = FALSE; + EndPointUrl = NULL; + EndPointUrlMsg = NULL; if ((This == NULL) || (Token == NULL)) { return EFI_INVALID_PARAMETER; @@ -275,16 +285,20 @@ EfiHttpRequest ( Request = HttpMsg->Data.Request; // - // Only support GET, HEAD, DELETE, PATCH, PUT and POST method in current implementation. + // Only support GET, HEAD, DELETE, PATCH, PUT, CONNECT and POST method in current implementation. // if ((Request != NULL) && (Request->Method != HttpMethodGet) && (Request->Method != HttpMethodHead) && (Request->Method != HttpMethodDelete) && (Request->Method != HttpMethodPut) && (Request->Method != HttpMethodPost) && - (Request->Method != HttpMethodPatch)) + (Request->Method != HttpMethodPatch) && (Request->Method != HttpMethodConnect)) { return EFI_UNSUPPORTED; } + if ((Request->Method == HttpMethodConnect) && (Request->EndPointUrl == NULL)) { + return EFI_INVALID_PARAMETER; + } + HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This); // @@ -353,11 +367,25 @@ EfiHttpRequest ( UnicodeStrToAsciiStrS (Request->Url, Url, UrlLen); + if (Request->EndPointUrl != NULL) { + UrlLen = StrLen (Request->EndPointUrl) + 1; + EndPointUrl = AllocateZeroPool (UrlLen); + if (EndPointUrl == NULL) { + goto Error1; + } + + UnicodeStrToAsciiStrS (Request->EndPointUrl, EndPointUrl, UrlLen); + } + // // From the information in Url, the HTTP instance will // be able to determine whether to use http or https. // - HttpInstance->UseHttps = IsHttpsUrl (Url); + if (HttpInstance->ProxyConnected) { + HttpInstance->UseHttps = IsHttpsUrl (EndPointUrl); + } else { + HttpInstance->UseHttps = IsHttpsUrl (Url); + } // // HTTP is disabled, return directly if the URI is not HTTPS. @@ -444,9 +472,10 @@ EfiHttpRequest ( if ((HttpInstance->ConnectionClose == FALSE) && (HttpInstance->RemotePort == RemotePort) && (AsciiStrCmp (HttpInstance->RemoteHost, HostName) == 0) && - (!HttpInstance->UseHttps || (HttpInstance->UseHttps && - !TlsConfigure && - (HttpInstance->TlsSessionState == EfiTlsSessionDataTransferring)))) + (!HttpInstance->UseHttps || + HttpInstance->ProxyConnected || (HttpInstance->UseHttps && + !TlsConfigure && + (HttpInstance->TlsSessionState == EfiTlsSessionDataTransferring)))) { // // Host Name and port number of the request URL are the same with previous call to Request(). @@ -599,7 +628,7 @@ EfiHttpRequest ( goto Error2; } - if (!Configure && !ReConfigure && !TlsConfigure) { + if ((!Configure && !ReConfigure) && ((HttpInstance->ProxyConnected && TlsConfigure) || (!TlsConfigure))) { // // For the new HTTP token, create TX TCP token events. // @@ -632,7 +661,48 @@ EfiHttpRequest ( } } - Status = HttpGenRequestMessage (HttpMsg, FileUrl, &RequestMsg, &RequestMsgSize); + if (HttpInstance->Method == HttpMethodConnect) { + Status = HttpParseUrl (EndPointUrl, (UINT32)AsciiStrLen (EndPointUrl), FALSE, &EndPointUrlParser); + if (EFI_ERROR (Status)) { + goto Error3; + } + + Status = HttpUrlGetHostName ( + EndPointUrl, + EndPointUrlParser, + &EndPointHostName + ); + if (EFI_ERROR (Status)) { + goto Error3; + } + + Status = HttpUrlGetPort (EndPointUrl, EndPointUrlParser, &EndPointRemotePort); + if (EFI_ERROR (Status)) { + if (IsHttpsUrl (EndPointUrl)) { + EndPointRemotePort = HTTPS_DEFAULT_PORT; + } else { + EndPointRemotePort = HTTP_DEFAULT_PORT; + } + } + + EndPointUrlMsg = AllocateZeroPool (URI_STR_MAX_SIZE); + if (EndPointUrlMsg == NULL) { + Status = EFI_OUT_OF_RESOURCES; + goto Error3; + } + + AsciiSPrint ( + EndPointUrlMsg, + URI_STR_MAX_SIZE, + "%a:%d", + EndPointHostName, + EndPointRemotePort + ); + + Status = HttpGenRequestMessage (HttpMsg, EndPointUrlMsg, &RequestMsg, &RequestMsgSize); + } else { + Status = HttpGenRequestMessage (HttpMsg, FileUrl, &RequestMsg, &RequestMsgSize); + } if (EFI_ERROR (Status) || (NULL == RequestMsg)) { goto Error3; @@ -668,6 +738,23 @@ EfiHttpRequest ( DispatchDpc (); + if (HttpInstance->Method == HttpMethodConnect) { + HttpInstance->ProxyConnected = TRUE; + HttpInstance->EndPointRemoteHost = EndPointHostName; + + if (EndPointUrlParser != NULL) { + HttpUrlFreeParser (EndPointUrlParser); + } + } + + if (EndPointUrlMsg != NULL) { + FreePool (EndPointUrlMsg); + } + + if (EndPointUrl != NULL) { + FreePool (EndPointUrl); + } + if (HostName != NULL) { FreePool (HostName); } @@ -698,6 +785,20 @@ Error3: TlsCloseTxRxEvent (HttpInstance); } + if (HttpInstance->Method == HttpMethodConnect) { + if (EndPointHostName != NULL) { + FreePool (EndPointHostName); + } + + if (EndPointUrlParser != NULL) { + HttpUrlFreeParser (EndPointUrlParser); + } + } + + if (EndPointUrlMsg != NULL) { + FreePool (EndPointUrlMsg); + } + Error2: HttpCloseConnection (HttpInstance); @@ -725,6 +826,10 @@ Error1: HttpUrlFreeParser (UrlParser); } + if (EndPointUrl != NULL) { + FreePool (EndPointUrl); + } + return Status; } diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c index 33ae622c3f0b..b87fbeeb543f 100644 --- a/NetworkPkg/HttpDxe/HttpProto.c +++ b/NetworkPkg/HttpDxe/HttpProto.c @@ -849,6 +849,11 @@ HttpCleanProtocol ( HttpInstance->Url = NULL; } + if (HttpInstance->EndPointRemoteHost != NULL) { + FreePool (HttpInstance->EndPointRemoteHost); + HttpInstance->EndPointRemoteHost = NULL; + } + NetMapClean (&HttpInstance->TxTokens); NetMapClean (&HttpInstance->RxTokens); @@ -1206,6 +1211,7 @@ HttpConfigureTcp6 ( connect one TLS session if required. @param[in] HttpInstance The HTTP instance private data. + @param[in] TlsConfigure The Flag indicates whether it's the new Tls session. @retval EFI_SUCCESS The TCP connection is established. @retval EFI_NOT_READY TCP4 protocol child is not created or configured. @@ -1214,7 +1220,8 @@ HttpConfigureTcp6 ( **/ EFI_STATUS HttpConnectTcp4 ( - IN HTTP_PROTOCOL *HttpInstance + IN HTTP_PROTOCOL *HttpInstance, + IN BOOLEAN TlsConfigure ) { EFI_STATUS Status; @@ -1237,16 +1244,18 @@ HttpConnectTcp4 ( return Status; } - if (Tcp4State == Tcp4StateEstablished) { + if ((Tcp4State == Tcp4StateEstablished) && (!HttpInstance->ProxyConnected || !TlsConfigure)) { return EFI_SUCCESS; } else if (Tcp4State > Tcp4StateEstablished ) { HttpCloseConnection (HttpInstance); } - Status = HttpCreateConnection (HttpInstance); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "Tcp4 Connection fail - %x\n", Status)); - return Status; + if (!HttpInstance->ProxyConnected) { + Status = HttpCreateConnection (HttpInstance); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Tcp4 Connection fail - %x\n", Status)); + return Status; + } } // @@ -1298,6 +1307,7 @@ HttpConnectTcp4 ( connect one TLS session if required. @param[in] HttpInstance The HTTP instance private data. + @param[in] TlsConfigure The Flag indicates whether it's the new Tls session. @retval EFI_SUCCESS The TCP connection is established. @retval EFI_NOT_READY TCP6 protocol child is not created or configured. @@ -1306,7 +1316,8 @@ HttpConnectTcp4 ( **/ EFI_STATUS HttpConnectTcp6 ( - IN HTTP_PROTOCOL *HttpInstance + IN HTTP_PROTOCOL *HttpInstance, + IN BOOLEAN TlsConfigure ) { EFI_STATUS Status; @@ -1330,16 +1341,18 @@ HttpConnectTcp6 ( return Status; } - if (Tcp6State == Tcp6StateEstablished) { + if ((Tcp6State == Tcp6StateEstablished) && (!HttpInstance->ProxyConnected || !TlsConfigure)) { return EFI_SUCCESS; } else if (Tcp6State > Tcp6StateEstablished ) { HttpCloseConnection (HttpInstance); } - Status = HttpCreateConnection (HttpInstance); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "Tcp6 Connection fail - %x\n", Status)); - return Status; + if (!HttpInstance->ProxyConnected) { + Status = HttpCreateConnection (HttpInstance); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Tcp6 Connection fail - %x\n", Status)); + return Status; + } } // @@ -1434,7 +1447,7 @@ HttpInitSession ( // // Connect TCP. // - Status = HttpConnectTcp4 (HttpInstance); + Status = HttpConnectTcp4 (HttpInstance, TlsConfigure); if (EFI_ERROR (Status)) { return Status; } @@ -1452,7 +1465,7 @@ HttpInitSession ( // // Connect TCP. // - Status = HttpConnectTcp6 (HttpInstance); + Status = HttpConnectTcp6 (HttpInstance, TlsConfigure); if (EFI_ERROR (Status)) { return Status; } diff --git a/NetworkPkg/HttpDxe/HttpProto.h b/NetworkPkg/HttpDxe/HttpProto.h index 620eb3915843..2e8d51635993 100644 --- a/NetworkPkg/HttpDxe/HttpProto.h +++ b/NetworkPkg/HttpDxe/HttpProto.h @@ -165,6 +165,12 @@ typedef struct _HTTP_PROTOCOL { CHAR8 *Url; + // + // Proxy Server Support + // + CHAR8 *EndPointRemoteHost; + BOOLEAN ProxyConnected; + // // Https Support // @@ -398,6 +404,7 @@ HttpConfigureTcp6 ( connect one TLS session if required. @param[in] HttpInstance The HTTP instance private data. + @param[in] TlsConfigure The Flag indicates whether it's the new Tls session. @retval EFI_SUCCESS The TCP connection is established. @retval EFI_NOT_READY TCP4 protocol child is not created or configured. @@ -406,7 +413,8 @@ HttpConfigureTcp6 ( **/ EFI_STATUS HttpConnectTcp4 ( - IN HTTP_PROTOCOL *HttpInstance + IN HTTP_PROTOCOL *HttpInstance, + IN BOOLEAN TlsConfigure ); /** @@ -414,6 +422,7 @@ HttpConnectTcp4 ( connect one TLS session if required. @param[in] HttpInstance The HTTP instance private data. + @param[in] TlsConfigure The Flag indicates whether it's the new Tls session. @retval EFI_SUCCESS The TCP connection is established. @retval EFI_NOT_READY TCP6 protocol child is not created or configured. @@ -422,7 +431,8 @@ HttpConnectTcp4 ( **/ EFI_STATUS HttpConnectTcp6 ( - IN HTTP_PROTOCOL *HttpInstance + IN HTTP_PROTOCOL *HttpInstance, + IN BOOLEAN TlsConfigure ); /** diff --git a/NetworkPkg/HttpDxe/HttpsSupport.c b/NetworkPkg/HttpDxe/HttpsSupport.c index ad611e7c3836..7dc2b752ec47 100644 --- a/NetworkPkg/HttpDxe/HttpsSupport.c +++ b/NetworkPkg/HttpDxe/HttpsSupport.c @@ -644,11 +644,15 @@ TlsConfigureSession ( // // TlsConfigData initialization // - HttpInstance->TlsConfigData.ConnectionEnd = EfiTlsClient; - HttpInstance->TlsConfigData.VerifyMethod = EFI_TLS_VERIFY_PEER; - HttpInstance->TlsConfigData.VerifyHost.Flags = EFI_TLS_VERIFY_FLAG_NONE; - HttpInstance->TlsConfigData.VerifyHost.HostName = HttpInstance->RemoteHost; - HttpInstance->TlsConfigData.SessionState = EfiTlsSessionNotStarted; + HttpInstance->TlsConfigData.ConnectionEnd = EfiTlsClient; + HttpInstance->TlsConfigData.SessionState = EfiTlsSessionNotStarted; + HttpInstance->TlsConfigData.VerifyMethod = EFI_TLS_VERIFY_PEER; + HttpInstance->TlsConfigData.VerifyHost.Flags = EFI_TLS_VERIFY_FLAG_NONE; + if (HttpInstance->ProxyConnected) { + HttpInstance->TlsConfigData.VerifyHost.HostName = HttpInstance->EndPointRemoteHost; + } else { + HttpInstance->TlsConfigData.VerifyHost.HostName = HttpInstance->RemoteHost; + } // // EfiTlsConnectionEnd, diff --git a/NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c b/NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c index 6a5d78629bb3..45087a19350a 100644 --- a/NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c +++ b/NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c @@ -1927,6 +1927,11 @@ HttpGenRequestMessage ( CopyMem (RequestPtr, HTTP_METHOD_DELETE, StrLength); RequestPtr += StrLength; break; + case HttpMethodConnect: + StrLength = sizeof (HTTP_METHOD_CONNECT) - 1; + CopyMem (RequestPtr, HTTP_METHOD_CONNECT, StrLength); + RequestPtr += StrLength; + break; default: ASSERT (FALSE); Status = EFI_INVALID_PARAMETER; -- 2.36.1.windows.1 |
|
Re: [edk2-platforms][PATCH V3 0/4] QemuOpenBoardPkg: Add QemuOpenBoardPkg
Isaac Oram
Series pushed as 9a7234827f..f4679715a4
toggle quoted message
Show quoted text
-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@...> Sent: Tuesday, September 13, 2022 2:51 PM To: Oram, Isaac W <isaac.w.oram@...>; Theo Jehl <theojehl76@...>; devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@...> Cc: Leif Lindholm <quic_llindhol@...>; Pedro Falcato <pedro.falcato@...>; Gerd Hoffmann <kraxel@...>; Stefan Hajnoczi <stefanha@...> Subject: RE: [edk2-devel][edk2-platforms][PATCH V3 0/4] QemuOpenBoardPkg: Add QemuOpenBoardPkg Series Acked-by: Michael D Kinney <michael.d.kinney@...> -----Original Message----- |
|
[PATCH] NetworkPkg: Add WiFi profile sync protocol support
Clark-williams, Zachary
From: Zachary Clark-Williams <zclarkw112@...>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3845 Enables KVM and One Click Recovery WLAN capability with WiFi Profile Sync feature and protocol. Adding WiFiProfileSyncProtocol, which supports the profilesync driver operations for transferring WiFi profiles from AMT to the Supplicant. WiFiConnectionManager will check for the WifiProfileSyncProtocol and if found will operate on the premise of a One Click Recovery, or KVM flow with a Wifi profile provided by AMT. Signed-off-by: Zachary Clark-Williams <zachary.clark-williams@...> --- .../Protocol/WiFiProfileSyncProtocol.h | 83 ++++++++ NetworkPkg/NetworkPkg.dec | 3 + .../WifiConnectionManagerDxe.inf | 3 +- .../WifiConnectionMgrDriver.c | 126 +++++++---- .../WifiConnectionMgrDxe.h | 4 +- .../WifiConnectionMgrImpl.c | 197 ++++++++++++++++-- .../WifiConnectionMgrMisc.c | 13 ++ 7 files changed, 370 insertions(+), 59 deletions(-) create mode 100644 NetworkPkg/Include/Protocol/WiFiProfileSyncProtocol.h diff --git a/NetworkPkg/Include/Protocol/WiFiProfileSyncProtocol.h b/NetworkPkg/Include/Protocol/WiFiProfileSyncProtocol.h new file mode 100644 index 0000000000..e36daceabf --- /dev/null +++ b/NetworkPkg/Include/Protocol/WiFiProfileSyncProtocol.h @@ -0,0 +1,83 @@ +/** @file + WiFi profile sync protocol. Supports One Click Recovery or KVM OS recovery + boot flow over WiFi. + + Copyright (c) 2022, Intel Corporation. All rights reserved.<BR> + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef WIFI_PROFILE_SYNC_PROTOCOL_H_ +#define WIFI_PROFILE_SYNC_PROTOCOL_H_ + +#include <WifiConnectionManagerDxe/WifiConnectionMgrConfig.h> + +// +// WiFi Profile Sync Protocol GUID variable. +// +extern EFI_GUID gEfiWiFiProfileSyncProtocolGuid; + +/** + Used by the WiFi connection manager to get the WiFi profile that AMT shared + and was stored in WiFi profile protocol. Aligns the AMT WiFi profile data to + the WiFi connection manager profile structure fo connection use. + + @param[in, out] WcmProfile WiFi Connection Manager profile structure + @param[in, out] MacAddress MAC address from AMT saved to NiC MAC address + + @retval EFI_SUCCESS Stored WiFi profile converted and returned succefully + @retval EFI_UNSUPPORTED Profile protocol sharing not supported or enabled + @retval EFI_NOT_FOUND No profiles to returned + @retval Others Error Occurred +**/ +typedef +EFI_STATUS +(EFIAPI *WIFI_PROFILE_GET)( + IN OUT WIFI_MGR_NETWORK_PROFILE *Profile, + IN OUT EFI_80211_MAC_ADDRESS MacAddress + ); + +/** + Saves the WiFi connection status recieved by the WiFiConnectionManager when + in a KVM OR One Click Recovery WLAN recovery flow. Input as + EFI_80211_CONNECT_NETWORK_RESULT_CODE then converted and stored as EFI_STATUS type. + + @param[in] ConnectionStatus WiFi connection attempt results +**/ +typedef +VOID +(EFIAPI *WIFI_SET_CONNECT_STATE)( + IN EFI_80211_CONNECT_NETWORK_RESULT_CODE ConnectionStatus + ); + +/** + Retrieves the stored WiFi connection status when in either KVM OR One Click + Recovery WLAN recovery flow. + + @retval EFI_SUCCESS WiFi connection completed succesfully + @retval Others Connection failure occurred +**/ +typedef +EFI_STATUS +(EFIAPI *WIFI_GET_CONNECT_STATE)( + VOID + ); + +// +// WiFi Profile Sync Protocol structure. +// +typedef struct { + UINT32 Revision; + WIFI_SET_CONNECT_STATE WifiProfileSyncSetConnectState; + WIFI_GET_CONNECT_STATE WifiProfileSyncGetConnectState; + WIFI_PROFILE_GET WifiProfileSyncGetProfile; +} EFI_WIFI_PROFILE_SYNC_PROTOCOL; + +/** + WiFi Profile Protocol revision number. + + Revision 1: Initial version +**/ +#define EFI_WIFI_PROFILE_SYNC_PROTOCOL_REVISION 1 + +#endif // WIFI_PROFILE_SYNC_PROTOCOL_H_ diff --git a/NetworkPkg/NetworkPkg.dec b/NetworkPkg/NetworkPkg.dec index 5e43ebf8c5..53fb34c4a0 100644 --- a/NetworkPkg/NetworkPkg.dec +++ b/NetworkPkg/NetworkPkg.dec @@ -91,6 +91,9 @@ ## Include/Protocol/HttpCallback.h gEdkiiHttpCallbackProtocolGuid = {0x611114f1, 0xa37b, 0x4468, {0xa4, 0x36, 0x5b, 0xdd, 0xa1, 0x6a, 0xa2, 0x40}} + ## Include/Protocol/WiFiProfileSyncProtocol.h + gEfiWiFiProfileSyncProtocolGuid = {0x399a2b8a, 0xc267, 0x44aa, {0x9a, 0xb4, 0x30, 0x58, 0x8c, 0xd2, 0x2d, 0xcc}} + [PcdsFixedAtBuild] ## The max attempt number will be created by iSCSI driver. # @Prompt Max attempt number. diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionManagerDxe.inf b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionManagerDxe.inf index 4394b6f4bb..7e36016cf8 100644 --- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionManagerDxe.inf +++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionManagerDxe.inf @@ -9,7 +9,7 @@ # 2). WPA2 Personal Network # 3). EAP Networks (EAP-TLS, EAP-TTLS/MSCHAPv2 and PEAPv0/MSCHAPv2) # -# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR> +# Copyright (c) 2019 - 2022, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -71,6 +71,7 @@ gEfiAdapterInformationProtocolGuid ## SOMETIMES_CONSUMES gEfiSupplicantProtocolGuid ## SOMETIMES_CONSUMES gEfiEapConfigurationProtocolGuid ## SOMETIMES_CONSUMES + gEfiWiFiProfileSyncProtocolGuid ## SOMETIMES_CONSUMES [Guids] gWifiConfigGuid ## PRODUCES ## GUID diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDriver.c b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDriver.c index 67a01ca058..65df5b2c8a 100644 --- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDriver.c +++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDriver.c @@ -1,7 +1,7 @@ /** @file The driver binding protocol for the WiFi Connection Manager. - Copyright (c) 2019, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2019 - 2022, Intel Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent @@ -39,6 +39,11 @@ EFI_GUID mWifiConfigNetworkListRefreshGuid = WIFI_CONFIG_NETWORK_LIST_REFRESH_G EFI_GUID mWifiConfigConnectFormRefreshGuid = WIFI_CONFIG_CONNECT_FORM_REFRESH_GUID; EFI_GUID mWifiConfigMainFormRefreshGuid = WIFI_CONFIG_MAIN_FORM_REFRESH_GUID; +// +// Wifi connection attempt counter for retries +// +extern UINT8 WifiConnectionCount; + /** Tests to see if this driver supports a given controller. If a child device is provided, it further tests to see if this driver supports creating a handle for the specified child device. @@ -167,8 +172,10 @@ WifiMgrDxeDriverBindingStart ( EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL *Wmp; EFI_SUPPLICANT_PROTOCOL *Supplicant; EFI_EAP_CONFIGURATION_PROTOCOL *EapConfig; + EFI_WIFI_PROFILE_SYNC_PROTOCOL *WiFiProfileSyncProtocol; - Nic = NULL; + WifiConnectionCount = 0; + Nic = NULL; // // Open Protocols @@ -236,47 +243,73 @@ WifiMgrDxeDriverBindingStart ( InitializeListHead (&Nic->ProfileList); // - // Record the MAC address of the incoming NIC. + // WiFi profile sync protocol installation check for OS recovery flow. // - Status = NetLibGetMacAddress ( - ControllerHandle, - (EFI_MAC_ADDRESS *)&Nic->MacAddress, - &AddressSize - ); - if (EFI_ERROR (Status)) { - goto ERROR2; - } - - // - // Create and start the timer for the status check - // - Status = gBS->CreateEvent ( - EVT_NOTIFY_SIGNAL | EVT_TIMER, - TPL_CALLBACK, - WifiMgrOnTimerTick, - Nic, - &Nic->TickTimer + Status = gBS->LocateProtocol ( + &gEfiWiFiProfileSyncProtocolGuid, + NULL, + (VOID **)&WiFiProfileSyncProtocol ); - if (EFI_ERROR (Status)) { - goto ERROR2; - } + if (!EFI_ERROR (Status)) { + Nic->ConnectPendingNetwork = (WIFI_MGR_NETWORK_PROFILE *)AllocateZeroPool (sizeof (WIFI_MGR_NETWORK_PROFILE)); + if (Nic->ConnectPendingNetwork == NULL) { + Status = EFI_OUT_OF_RESOURCES; + goto ERROR1; + } - Status = gBS->SetTimer (Nic->TickTimer, TimerPeriodic, EFI_TIMER_PERIOD_MILLISECONDS (500)); - if (EFI_ERROR (Status)) { - goto ERROR3; - } + WiFiProfileSyncProtocol->WifiProfileSyncGetProfile (Nic->ConnectPendingNetwork, Nic->MacAddress); + if (Nic->ConnectPendingNetwork != NULL) { + Status = WifiMgrConnectToNetwork (Nic, Nic->ConnectPendingNetwork); + if (EFI_ERROR (Status)) { + WiFiProfileSyncProtocol->WifiProfileSyncSetConnectState (Status); + } + } else { + goto ERROR1; + } + } else { + // + // Record the MAC address of the incoming NIC. + // + Status = NetLibGetMacAddress ( + ControllerHandle, + (EFI_MAC_ADDRESS *)&Nic->MacAddress, + &AddressSize + ); + if (EFI_ERROR (Status)) { + goto ERROR2; + } - Nic->ConnectState = WifiMgrDisconnected; - Nic->ScanState = WifiMgrScanFinished; + // + // Create and start the timer for the status check + // + Status = gBS->CreateEvent ( + EVT_NOTIFY_SIGNAL | EVT_TIMER, + TPL_CALLBACK, + WifiMgrOnTimerTick, + Nic, + &Nic->TickTimer + ); + if (EFI_ERROR (Status)) { + goto ERROR2; + } - OldTpl = gBS->RaiseTPL (TPL_CALLBACK); - InsertTailList (&mPrivate->NicList, &Nic->Link); - Nic->NicIndex = mPrivate->NicCount++; - if (mPrivate->CurrentNic == NULL) { - mPrivate->CurrentNic = Nic; - } + Status = gBS->SetTimer (Nic->TickTimer, TimerPeriodic, EFI_TIMER_PERIOD_MILLISECONDS (500)); + if (EFI_ERROR (Status)) { + goto ERROR3; + } - gBS->RestoreTPL (OldTpl); + Nic->ConnectState = WifiMgrDisconnected; + Nic->ScanState = WifiMgrScanFinished; + + OldTpl = gBS->RaiseTPL (TPL_CALLBACK); + InsertTailList (&mPrivate->NicList, &Nic->Link); + Nic->NicIndex = mPrivate->NicCount++; + if (mPrivate->CurrentNic == NULL) { + mPrivate->CurrentNic = Nic; + } + + gBS->RestoreTPL (OldTpl); + } Status = gBS->InstallProtocolInterface ( &ControllerHandle, @@ -385,10 +418,11 @@ WifiMgrDxeDriverBindingStop ( IN EFI_HANDLE *ChildHandleBuffer OPTIONAL ) { - EFI_STATUS Status; - EFI_TPL OldTpl; - WIFI_MGR_PRIVATE_PROTOCOL *WifiMgrIdentifier; - WIFI_MGR_DEVICE_DATA *Nic; + EFI_STATUS Status; + EFI_TPL OldTpl; + WIFI_MGR_PRIVATE_PROTOCOL *WifiMgrIdentifier; + WIFI_MGR_DEVICE_DATA *Nic; + EFI_WIFI_PROFILE_SYNC_PROTOCOL *WiFiProfileSyncProtocol; Status = gBS->OpenProtocol ( ControllerHandle, @@ -481,7 +515,15 @@ WifiMgrDxeDriverBindingStop ( // OldTpl = gBS->RaiseTPL (TPL_CALLBACK); - RemoveEntryList (&Nic->Link); + Status = gBS->LocateProtocol ( + &gEfiWiFiProfileSyncProtocolGuid, + NULL, + (VOID **)&WiFiProfileSyncProtocol + ); + if (EFI_ERROR (Status)) { + RemoveEntryList (&Nic->Link); + } + mPrivate->NicCount--; if (mPrivate->CurrentNic == Nic) { mPrivate->CurrentNic = NULL; diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDxe.h b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDxe.h index 7b2e41e155..047f85dbc2 100644 --- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDxe.h +++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDxe.h @@ -47,6 +47,7 @@ #include <Protocol/SimpleNetwork.h> #include <Protocol/SimpleFileSystem.h> #include <Protocol/EapConfiguration.h> +#include <Protocol/WiFiProfileSyncProtocol.h> // // Produced Protocols @@ -73,7 +74,8 @@ // #define WIFI_MGR_DXE_VERSION 0xb -#define OUI_IEEE_80211I 0xAC0F00 +#define OUI_IEEE_80211I 0xAC0F00 +#define MAX_WIFI_CONNETION_ATTEMPTS 3 typedef enum { Ieee80211PairwiseCipherSuiteUseGroupCipherSuite = 0, diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.c b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.c index 59bac48c42..3a04b4ddb1 100644 --- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.c +++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.c @@ -19,6 +19,8 @@ EFI_EAP_TYPE mEapSecondAuthMethod[] = { EFI_EAP_TYPE_MSCHAPV2 }; +UINT8 WifiConnectionCount = 0; + /** The callback function for scan operation. This function updates networks according to the latest scan result, and trigger UI refresh. @@ -420,22 +422,34 @@ WifiMgrConfigPassword ( // // Set password to supplicant // + if (Profile->Password[StrLen (Profile->Password)] != '\0') { + Profile->Password[StrLen (Profile->Password)] = L'\0'; + } + if (StrLen (Profile->Password) < PASSWORD_MIN_LEN) { return EFI_NOT_FOUND; } - AsciiPassword = AllocateZeroPool ((StrLen (Profile->Password) + 1) * sizeof (UINT8)); + if (StrLen (Profile->Password) > PASSWORD_STORAGE_SIZE) { + ASSERT (EFI_INVALID_PARAMETER); + return EFI_INVALID_PARAMETER; + } + + AsciiPassword = AllocateZeroPool ((StrLen (Profile->Password) + 1) * sizeof (CHAR8)); if (AsciiPassword == NULL) { return EFI_OUT_OF_RESOURCES; } - UnicodeStrToAsciiStrS (Profile->Password, (CHAR8 *)AsciiPassword, PASSWORD_STORAGE_SIZE); - Status = Supplicant->SetData ( - Supplicant, - EfiSupplicant80211PskPassword, - AsciiPassword, - (StrLen (Profile->Password) + 1) * sizeof (UINT8) - ); + Status = UnicodeStrToAsciiStrS (Profile->Password, (CHAR8 *)AsciiPassword, ((StrLen (Profile->Password) + 1) * sizeof (CHAR8))); + if (!EFI_ERROR (Status)) { + Status = Supplicant->SetData ( + Supplicant, + EfiSupplicant80211PskPassword, + AsciiPassword, + (StrLen (Profile->Password) + 1) * sizeof (CHAR8) + ); + } + ZeroMem (AsciiPassword, AsciiStrLen ((CHAR8 *)AsciiPassword) + 1); FreePool (AsciiPassword); @@ -466,6 +480,7 @@ WifiMgrConfigEap ( ) { EFI_STATUS Status; + EFI_WIFI_PROFILE_SYNC_PROTOCOL *WiFiProfileSyncProtocol; EFI_EAP_CONFIGURATION_PROTOCOL *EapConfig; EFI_EAP_TYPE EapAuthMethod; EFI_EAP_TYPE EapSecondAuthMethod; @@ -567,7 +582,13 @@ WifiMgrConfigEap ( return EFI_OUT_OF_RESOURCES; } - UnicodeStrToAsciiStrS (Profile->EapIdentity, Identity, IdentitySize); + Status = gBS->LocateProtocol (&gEfiWiFiProfileSyncProtocolGuid, NULL, (VOID **)&WiFiProfileSyncProtocol); + if (!EFI_ERROR (Status)) { + CopyMem (Identity, &Profile->EapIdentity, IdentitySize); + } else { + UnicodeStrToAsciiStrS (Profile->EapIdentity, Identity, IdentitySize); + } + Status = EapConfig->SetData ( EapConfig, EFI_EAP_TYPE_IDENTITY, @@ -892,6 +913,133 @@ WifiMgrPrepareConnection ( return EFI_SUCCESS; } +/** + Will reset NiC data, get profile from profile sync driver, and send for + another connection attempt.This function should not be called more than + 3 times. + + @param[in] WiFiProfileSyncProtocol The target network profile to connect. + + @retval EFI_SUCCESS The operation is completed. + @retval other Operation failure. + +**/ +EFI_STATUS +ConnectionRetry ( + IN EFI_WIFI_PROFILE_SYNC_PROTOCOL *WiFiProfileSyncProtocol + ) +{ + EFI_STATUS Status; + WIFI_MGR_DEVICE_DATA *Nic; + EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL *Wmp; + EFI_SUPPLICANT_PROTOCOL *Supplicant; + EFI_EAP_CONFIGURATION_PROTOCOL *EapConfig; + + Nic = NULL; + + Status = gBS->LocateProtocol ( + &gEfiWiFi2ProtocolGuid, + NULL, + (VOID **)&Wmp + ); + if (EFI_ERROR (Status)) { + return Status; + } + + Status = gBS->LocateProtocol ( + &gEfiSupplicantProtocolGuid, + NULL, + (VOID **)&Supplicant + ); + if (EFI_ERROR (Status)) { + Supplicant = NULL; + } + + Status = gBS->LocateProtocol ( + &gEfiEapConfigurationProtocolGuid, + NULL, + (VOID **)&EapConfig + ); + if (EFI_ERROR (Status)) { + EapConfig = NULL; + } + + // + // Initialize Nic device data + // + Nic = AllocateZeroPool (sizeof (WIFI_MGR_DEVICE_DATA)); + if (Nic == NULL) { + Status = EFI_OUT_OF_RESOURCES; + return Status; + } + + Nic->Signature = WIFI_MGR_DEVICE_DATA_SIGNATURE; + Nic->Private = mPrivate; + Nic->Wmp = Wmp; + Nic->Supplicant = Supplicant; + Nic->EapConfig = EapConfig; + Nic->UserSelectedProfile = NULL; + Nic->OneTimeScanRequest = FALSE; + + if (Nic->Supplicant != NULL) { + Status = WifiMgrGetSupportedSuites (Nic); + } + + if (!EFI_ERROR (Status)) { + InitializeListHead (&Nic->ProfileList); + + Nic->ConnectPendingNetwork = (WIFI_MGR_NETWORK_PROFILE *)AllocateZeroPool (sizeof (WIFI_MGR_NETWORK_PROFILE)); + if (Nic->ConnectPendingNetwork == NULL) { + Status = EFI_OUT_OF_RESOURCES; + DEBUG ((DEBUG_ERROR, "[WiFi Connection Manager] Failed to allocate memory for ConnectPendingNetwork\n")); + goto ERROR; + } + + Status = WiFiProfileSyncProtocol->WifiProfileSyncGetProfile (Nic->ConnectPendingNetwork, Nic->MacAddress); + if (!EFI_ERROR (Status) && (Nic->ConnectPendingNetwork != NULL)) { + Status = WifiMgrConnectToNetwork (Nic, Nic->ConnectPendingNetwork); + if (!EFI_ERROR (Status)) { + return Status; + } + } else { + DEBUG ((DEBUG_ERROR, "[WiFi Connection Manager] Failed to get WiFi profile with status %r\n", Status)); + } + } else { + DEBUG ((DEBUG_ERROR, "[WiFi Connection Manager] Failed to get Supported suites with status %r\n", Status)); + } + + if (Nic->ConnectPendingNetwork != NULL) { + if (Nic->ConnectPendingNetwork->Network.AKMSuite != NULL) { + FreePool (Nic->ConnectPendingNetwork->Network.AKMSuite); + } + + if (Nic->ConnectPendingNetwork->Network.CipherSuite != NULL) { + FreePool (Nic->ConnectPendingNetwork->Network.CipherSuite); + } + + FreePool (Nic->ConnectPendingNetwork); + } + +ERROR: + if (Nic->Supplicant != NULL) { + if (Nic->SupportedSuites.SupportedAKMSuites != NULL) { + FreePool (Nic->SupportedSuites.SupportedAKMSuites); + } + + if (Nic->SupportedSuites.SupportedSwCipherSuites != NULL) { + FreePool (Nic->SupportedSuites.SupportedSwCipherSuites); + } + + if (Nic->SupportedSuites.SupportedHwCipherSuites != NULL) { + FreePool (Nic->SupportedSuites.SupportedHwCipherSuites); + } + } + + FreePool (Nic); + + return Status; +} + /** The callback function for connect operation. @@ -908,12 +1056,13 @@ WifiMgrOnConnectFinished ( IN VOID *Context ) { - EFI_STATUS Status; - WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken; - WIFI_MGR_NETWORK_PROFILE *ConnectedProfile; - UINT8 SecurityType; - UINT8 SSIdLen; - CHAR8 *AsciiSSId; + EFI_STATUS Status; + WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken; + WIFI_MGR_NETWORK_PROFILE *ConnectedProfile; + UINT8 SecurityType; + UINT8 SSIdLen; + CHAR8 *AsciiSSId; + EFI_WIFI_PROFILE_SYNC_PROTOCOL *WiFiProfileSyncProtocol; ASSERT (Context != NULL); @@ -925,6 +1074,24 @@ WifiMgrOnConnectFinished ( ASSERT (ConfigToken->Type == TokenTypeConnectNetworkToken); ASSERT (ConfigToken->Token.ConnectNetworkToken != NULL); + + Status = gBS->LocateProtocol (&gEfiWiFiProfileSyncProtocolGuid, NULL, (VOID **)&WiFiProfileSyncProtocol); + if (!EFI_ERROR (Status)) { + WiFiProfileSyncProtocol->WifiProfileSyncSetConnectState (ConfigToken->Token.ConnectNetworkToken->ResultCode); + if ((WifiConnectionCount < MAX_WIFI_CONNETION_ATTEMPTS) && + (ConfigToken->Token.ConnectNetworkToken->ResultCode != ConnectSuccess)) + { + WifiConnectionCount++; + gBS->CloseEvent (Event); + Status = ConnectionRetry (WiFiProfileSyncProtocol); + if (!EFI_ERROR (Status)) { + return; + } + + WiFiProfileSyncProtocol->WifiProfileSyncSetConnectState (Status); + } + } + if (ConfigToken->Token.ConnectNetworkToken->Status != EFI_SUCCESS) { if (ConfigToken->Nic->OneTimeConnectRequest) { // diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrMisc.c b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrMisc.c index 4ad5643c24..87adfc5033 100644 --- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrMisc.c +++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrMisc.c @@ -672,10 +672,23 @@ WifiMgrCleanProfileSecrets ( IN WIFI_MGR_NETWORK_PROFILE *Profile ) { + EFI_STATUS Status; + EFI_WIFI_PROFILE_SYNC_PROTOCOL *WiFiProfileSyncProtocol; + ZeroMem (Profile->Password, sizeof (CHAR16) * PASSWORD_STORAGE_SIZE); ZeroMem (Profile->EapPassword, sizeof (CHAR16) * PASSWORD_STORAGE_SIZE); ZeroMem (Profile->PrivateKeyPassword, sizeof (CHAR16) * PASSWORD_STORAGE_SIZE); + // + // When EFI WiFi profile sync protocol is found the system is performing a recovery boot in secure + // boot mode. The profile sync driver will manage the CA certificate, client certificate, and key + // data, cleaning them at exit boot services. + // + Status = gBS->LocateProtocol (&gEfiWiFiProfileSyncProtocolGuid, NULL, (VOID **)&WiFiProfileSyncProtocol); + if (!EFI_ERROR (Status)) { + return; + } + if (Profile->CACertData != NULL) { ZeroMem (Profile->CACertData, Profile->CACertSize); FreePool (Profile->CACertData); -- 2.26.2.windows.1 |
|
[edk2-platforms][PATCH V1 2/2] MinPlatformPkg/S3: Use EFI_PHYSICAL_ADDRESS for address
Isaac Oram
This change fixes build warnings with type casts from some compilers.
Also changes type for ACPI_S3_MEMORY S3PeiMemBase to EFI_PHYSICAL_ADDRESS. This generally makes code eaiser to understand as opposed to UINT64. Cc: Sai Chaganty <rangasai.v.chaganty@...> Cc: Nate DeSimone <nathaniel.l.desimone@...> Cc: Liming Gao <gaoliming@...> Cc: Chasel Chiu <chasel.chiu@...> Cc: Eric Dong <eric.dong@...> Cc: Benjamin Doron <benjamin.doron00@...> Signed-off-by: Isaac Oram <isaac.w.oram@...> --- .../Intel/PowerManagement/S3FeaturePkg/S3Dxe/S3Dxe.c | 10 +++++----- .../Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.c | 2 +- .../Intel/MinPlatformPkg/Include/AcpiS3MemoryNvData.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/S3Dxe/S3Dxe.c b/Features/Intel/PowerManagement/S3FeaturePkg/S3Dxe/S3Dxe.c index 1a7ccb8eed..47b2cc27a5 100644 --- a/Features/Intel/PowerManagement/S3FeaturePkg/S3Dxe/S3Dxe.c +++ b/Features/Intel/PowerManagement/S3FeaturePkg/S3Dxe/S3Dxe.c @@ -124,19 +124,19 @@ S3DxeEntryPoint ( IN EFI_SYSTEM_TABLE *SystemTable ) { - UINT64 S3PeiMemSize; - UINT64 S3PeiMemBase; + UINTN S3PeiMemSize; + UINTN S3PeiMemBase; ACPI_S3_MEMORY S3MemoryInfo; EFI_STATUS Status; DEBUG ((DEBUG_INFO, "%a() Start\n", __FUNCTION__)); - S3PeiMemSize = GetPeiMemSize (); + S3PeiMemSize = (UINTN) GetPeiMemSize (); S3PeiMemBase = (UINTN) AllocateAcpiNvsMemoryBelow4G (S3PeiMemSize); ASSERT (S3PeiMemBase != 0); - S3MemoryInfo.S3PeiMemBase = S3PeiMemBase; - S3MemoryInfo.S3PeiMemSize = S3PeiMemSize; + S3MemoryInfo.S3PeiMemBase = (EFI_PHYSICAL_ADDRESS) S3PeiMemBase; + S3MemoryInfo.S3PeiMemSize = (UINT64) S3PeiMemSize; DEBUG ((DEBUG_INFO, "S3PeiMemBase: 0x%x\n", S3PeiMemBase)); DEBUG ((DEBUG_INFO, "S3PeiMemSize: 0x%x\n", S3PeiMemSize)); diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.c b/Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.c index 6acb894b6f..388e0954bd 100644 --- a/Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.c +++ b/Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.c @@ -40,7 +40,7 @@ FspSiliconInitDoneNotify ( { EFI_STATUS Status; EFI_BOOT_MODE BootMode; - UINT64 MchBaseAddress; + UINTN MchBaseAddress; Status = PeiServicesGetBootMode (&BootMode); ASSERT_EFI_ERROR (Status); diff --git a/Platform/Intel/MinPlatformPkg/Include/AcpiS3MemoryNvData.h b/Platform/Intel/MinPlatformPkg/Include/AcpiS3MemoryNvData.h index 04eb1435ee..35943e2aa3 100644 --- a/Platform/Intel/MinPlatformPkg/Include/AcpiS3MemoryNvData.h +++ b/Platform/Intel/MinPlatformPkg/Include/AcpiS3MemoryNvData.h @@ -13,8 +13,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent // NV data structure // typedef struct { - UINT64 S3PeiMemBase; - UINT64 S3PeiMemSize; + EFI_PHYSICAL_ADDRESS S3PeiMemBase; + UINT64 S3PeiMemSize; } ACPI_S3_MEMORY; #define ACPI_S3_MEMORY_NV_NAME L"S3MemoryInfo" -- 2.36.1.windows.1 |
|
[edk2-platforms][PATCH V1 1/2] S3FeaturePkg/Build: Add libraries needed by S3FeaturePkg
Isaac Oram
This change is needed for proposed S3FeaturePkg additions.
Changes ensure standalone build for S3FeaturePkg and AdvancedFeaturePkg Cc: Sai Chaganty <rangasai.v.chaganty@...> Cc: Nate DeSimone <nathaniel.l.desimone@...> Cc: Liming Gao <gaoliming@...> Cc: Benjamin Doron <benjamin.doron00@...> Signed-off-by: Isaac Oram <isaac.w.oram@...> --- Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc | 3 +++ Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc index ce0eac7a56..18929589c5 100644 --- a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc +++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc @@ -115,6 +115,9 @@ [LibraryClasses.Common] PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf # Required by BeepDebugFeature +[LibraryClasses.Common.PEIM] + SmmAccessLib|IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.inf # Required by S3Feature + # # This package builds all advanced features. # diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc b/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc index cd4b1c4f19..d5efcf6b6d 100644 --- a/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc +++ b/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc @@ -41,6 +41,9 @@ !include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc +[LibraryClasses] + PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf + [LibraryClasses.common.PEIM] SmmAccessLib|IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.inf -- 2.36.1.windows.1 |
|
[edk2-platforms][PATCH V1 0/2] Platforms/Intel: Build fixes
Isaac Oram
The S3FeaturePkg changes in
[edk2-platforms][PATCH v3 2/4] S3FeaturePkg: Implement working S3 resume Introduces some build issues with standalone package build for S3FeaturePkg and AdvancedFeaturePkg. There are also some type cast related compiler warnings. We do not currently have continuous integration testing. We do not currently have documented build testing configuration requirements. Therefore I am just fixing the minor issues and intend to merge both patch series together to maintain git bisect to the best of my ability. I do plan to document required and recommended board port and feature pkg builds. Note that the use of UINTN for intermediate data instead of EFI_PHYSICAL_ADDRESS is only to be consistent with other ACPI implementations of similar functionality. Cc: Sai Chaganty <rangasai.v.chaganty@...> Cc: Nate DeSimone <nathaniel.l.desimone@...> Cc: Liming Gao <gaoliming@...> Cc: Chasel Chiu <chasel.chiu@...> Cc: Eric Dong <eric.dong@...> Cc: Benjamin Doron <benjamin.doron00@...> Signed-off-by: Isaac Oram <isaac.w.oram@...> Isaac Oram (2): S3FeaturePkg/Build: Add libraries needed by S3FeaturePkg MinPlatformPkg/S3: Use EFI_PHYSICAL_ADDRESS for address .../Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc | 3 +++ .../Intel/PowerManagement/S3FeaturePkg/S3Dxe/S3Dxe.c | 10 +++++----- .../PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc | 3 +++ .../Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.c | 2 +- .../Intel/MinPlatformPkg/Include/AcpiS3MemoryNvData.h | 4 ++-- 5 files changed, 14 insertions(+), 8 deletions(-) -- 2.36.1.windows.1 |
|
Re: [PATCH v2] UnitTestFrameworkPkg: Add code coverage support for GCC
Michael D Kinney
So if you run the stuart command with that plugin available on Linux/GCC, then both the .gcda and HTML content is always generated and local user can either view HTML content with browser or view the results in VS Code with the .gcda files. Correct?
I think there ways to run the stuart command for just that single pluigin specified on the command line, so the builds are as fast as possible during unit test development. Would be good to capture that in the ReadMe.md as well.
Thanks,
Mike
From: Guo, Gua <gua.guo@...>
Sent: Tuesday, September 13, 2022 7:11 PM To: Kinney, Michael D <michael.d.kinney@...>; Sean Brogan <spbrogan@...>; devel@edk2.groups.io Cc: Sean Brogan <sean.brogan@...>; Michael Kubacki <mikuback@...> Subject: RE: [edk2-devel] [PATCH v2] UnitTestFrameworkPkg: Add code coverage support for GCC
I go through the code Merged PR 5008: Initial implementation or code coverage on basecore u… · microsoft/mu_basecore@f6af51f (github.com) It looks good from my view point.
@Kinney, Michael D
Flow for stuart_ci_build: (a) -> (b) -> (c) -> (d) -> (e) -> (f) Flow for vscode extension Gcov Viewer - Visual Studio Marketplace: (a) -> (b) -> (c) -> (d) -> (g)
(b) Call Edk2/.pytool/Plugin/HostUnitTestCompilerPlugin/HostUnitTestCompilerPlugin.py (c) Call Edk2/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py (d) execute Build/XXXPkg/**/*Test* -> generate *.gcda files (e) use “lcov” tool to parse *.gcda (f) use “pycobertura” tool to generate index.html (g) vscode extension to parse *.gcda and show it on source code directly.
Thanks, Gua From: Kinney, Michael D <michael.d.kinney@...>
Does that pytool plugin support viewing the code coverage visually in C source files?
Either HTML or preferably an Visual Studio Code plugin?
Can it be updated to support VS compilers tool?
Mie
From: Sean Brogan <spbrogan@...>
Hi Gua Guo, I would propose that we make this easier for both the local user and the CI system to get coverage metrics. Can you review this commit as it uses the same Edk2 plugins but adds code coverage support with GCC5:
Thanks Sean
On 9/13/2022 6:01 PM, Guo, Gua wrote: From: Gua Guo <gua.guo@...>In order to collect code coverage after running executablefile, generate *.gcda and *.gcno file that require by lcov toolto generate code coverage report.Cc: Michael D Kinney <michael.d.kinney@...>Cc: Sean Brogan <sean.brogan@...>Cc: Bret Barkelew <Bret.Barkelew@...>Cc: Michael Kubacki <mikuback@...>Signed-off-by: Gua Guo <gua.guo@...>---UnitTestFrameworkPkg/ReadMe.md | 116 +++++++++++++++++++-UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc | 2 +-2 files changed, 116 insertions(+), 2 deletions(-)diff --git a/UnitTestFrameworkPkg/ReadMe.md b/UnitTestFrameworkPkg/ReadMe.mdindex e696412cb3..93fdacfc4a 100644--- a/UnitTestFrameworkPkg/ReadMe.md+++ b/UnitTestFrameworkPkg/ReadMe.md@@ -361,7 +361,7 @@ RUNNING TEST SUITE: Int Safe Conversions Test Suite```You can also, if you are so inclined, read the output from the exact instance of the test that was run during-`stuart_ci_build`. The ouput file can be found on a path that looks like:+`stuart_ci_build`. The output file can be found on a path that looks like:`Build/<Package>/HostTest/<Arch>/<TestName>.<TestSuiteName>.<Arch>.result.xml`@@ -399,6 +399,120 @@ CMOCKA_XML_FILE=<absolute or relative path to output file>This mode is used by the test running plugin to aggregate the results for CI test status reporting in the web view.+### Enable Code Coverage for GCC host-based tests++LCOV is an extension of GCOV, a GNU tool which provides information about what parts of a program are actually executed (i.e. "covered") while running a particular test case. The extension consists of a set of scripts which build on the textual GCOV output to implement it.++Documentation for LCOV can be found here:+https://lcov.readthedocs.io/++You can follow below steps to generate your code coverage report.++++```bash+user@linux_machine:~/_uefi$stuart_ci_build -c .pytool/CISettings.py TOOL_CHAIN_TAG=GCC5 -p MdePkg -t NOOPT+...+user@linux_machine:~/_uefi$lcov -c --rc lcov_branch_coverage=1 -o UnitTest.info -d Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/+Capturing coverage data from Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/+Found gcov version: 9.4.0+Using intermediate gcov format+Scanning Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/ for .gcda files ...+Found 38 data files in Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/RShiftU64.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/Math64.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/SafeString.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/SwapBytes32.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/CpuDeadLoop.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/MultU64x64.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/LongJump.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/SetJump.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/BitField.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/String.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/DivU64x32Remainder.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/X64/GccInline.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/MultU64x32.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/MultS64x64.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/LinkedList.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/LShiftU64.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/DivU64x32.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/SwapBytes16.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/Unaligned.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/CheckSum.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/CopyMem.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/MemLibGuid.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/CompareMemWrapper.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/SetMemWrapper.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/SetMem64Wrapper.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/MemLibGeneric.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/CopyMemWrapper.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/SetMem.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/ZeroMemWrapper.gcda+Processing Library/BasePrintLib/BasePrintLib/OUTPUT/PrintLibInternal.gcda+Processing Library/BasePrintLib/BasePrintLib/OUTPUT/PrintLib.gcda+Processing Library/BaseSafeIntLib/BaseSafeIntLib/OUTPUT/SafeIntLib64.gcda+Processing Library/BaseSafeIntLib/BaseSafeIntLib/OUTPUT/SafeIntLib.gcda+Processing Test/UnitTest/Library/BaseLib/BaseLibUnitTestsHost/OUTPUT/Base64UnitTest.gcda+Processing Test/UnitTest/Library/BaseLib/BaseLibUnitTestsHost/OUTPUT/AutoGen.gcda+Processing Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLibHost/OUTPUT/SafeIntLibUintnIntnUnitTests64.gcda+Processing Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLibHost/OUTPUT/TestBaseSafeIntLib.gcda+Processing Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLibHost/OUTPUT/AutoGen.gcda++user@linux_machine:~/_uefi$genhtml UnitTest.info --branch-coverage -o Build/UnitTestReport++Reading data file UnitTest.info+Found 38 entries.+Found common filename prefix "~/_uefi/MdePkg/Library"+Writing .css and .png files.+Generating output.+Processing file ~/_uefi/Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/Test/UnitTest/Library/BaseLib/BaseLibUnitTestsHost/DEBUG/AutoGen.c+Processing file ~/_uefi/Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLibHost/DEBUG/AutoGen.c+Processing file BaseLib/Unaligned.c+Processing file BaseLib/CheckSum.c+Processing file BaseLib/BitField.c+Processing file BaseLib/DivU64x32.c+Processing file BaseLib/CpuDeadLoop.c+Processing file BaseLib/LongJump.c+Processing file BaseLib/MultU64x64.c+Processing file BaseLib/RShiftU64.c+Processing file BaseLib/SwapBytes32.c+Processing file BaseLib/SwapBytes16.c+Processing file BaseLib/SetJump.c+Processing file BaseLib/LinkedList.c+Processing file BaseLib/LShiftU64.c+Processing file BaseLib/SafeString.c+Processing file BaseLib/String.c+Processing file BaseLib/DivU64x32Remainder.c+Processing file BaseLib/MultS64x64.c+Processing file BaseLib/MultU64x32.c+Processing file BaseLib/Math64.c+Processing file BaseLib/X64/GccInline.c+Processing file BaseMemoryLib/SetMemWrapper.c+Processing file BaseMemoryLib/CompareMemWrapper.c+Processing file BaseMemoryLib/SetMem64Wrapper.c+Processing file BaseMemoryLib/ZeroMemWrapper.c+Processing file BaseMemoryLib/CopyMemWrapper.c+Processing file BaseMemoryLib/CopyMem.c+Processing file BaseMemoryLib/SetMem.c+Processing file BaseMemoryLib/MemLibGuid.c+Processing file BaseMemoryLib/MemLibGeneric.c+Processing file BasePrintLib/PrintLib.c+Processing file BasePrintLib/PrintLibInternal.c+Processing file BaseSafeIntLib/SafeIntLib64.c+Processing file BaseSafeIntLib/SafeIntLib.c+Processing file ~/_uefi/MdePkg/Test/UnitTest/Library/BaseLib/Base64UnitTest.c+Processing file ~/_uefi/MdePkg/Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLib.c+Processing file ~/_uefi/MdePkg/Test/UnitTest/Library/BaseSafeIntLib/SafeIntLibUintnIntnUnitTests64.c+Writing directory view page.+Overall coverage rate:+ lines......: 58.6% (2688 of 4589 lines)+ functions..: 57.1% (249 of 436 functions)+ branches...: 25.3% (1062 of 4195 branches)++...++```+### Important NoteThis works on both Windows and Linux, but is currently limited to x64 architectures. Working on getting others, but wediff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.incindex 4dd8d4ac67..8623aecb33 100644--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc@@ -19,7 +19,7 @@MemoryAllocationLib|UnitTestFrameworkPkg/Library/Posix/MemoryAllocationLibPosix/MemoryAllocationLibPosix.inf[BuildOptions]- GCC:*_*_*_CC_FLAGS = -fno-pie+ GCC:*_*_*_CC_FLAGS = -fno-pie -ftest-coverage -fprofile-arcs!ifdef $(UNIT_TESTING_DEBUG)MSFT:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1GCC:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1 |
|
Re: [PATCH v2] UnitTestFrameworkPkg: Add code coverage support for GCC
Michael D Kinney
For VS builds, I have heard that OpenCppCoverage is a good option:
https://github.com/OpenCppCoverage/OpenCppCoverage
I think Sean has done some initial evaluation. Would be great to see this enabled for local users for VS20xx tool chains.
Mike
From: Guo, Gua <gua.guo@...>
Sent: Tuesday, September 13, 2022 7:11 PM To: Kinney, Michael D <michael.d.kinney@...>; Sean Brogan <spbrogan@...>; devel@edk2.groups.io Cc: Sean Brogan <sean.brogan@...>; Michael Kubacki <mikuback@...> Subject: RE: [edk2-devel] [PATCH v2] UnitTestFrameworkPkg: Add code coverage support for GCC
I go through the code Merged PR 5008: Initial implementation or code coverage on basecore u… · microsoft/mu_basecore@f6af51f (github.com) It looks good from my view point.
@Kinney, Michael D
Flow for stuart_ci_build: (a) -> (b) -> (c) -> (d) -> (e) -> (f) Flow for vscode extension Gcov Viewer - Visual Studio Marketplace: (a) -> (b) -> (c) -> (d) -> (g)
(b) Call Edk2/.pytool/Plugin/HostUnitTestCompilerPlugin/HostUnitTestCompilerPlugin.py (c) Call Edk2/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py (d) execute Build/XXXPkg/**/*Test* -> generate *.gcda files (e) use “lcov” tool to parse *.gcda (f) use “pycobertura” tool to generate index.html (g) vscode extension to parse *.gcda and show it on source code directly.
Thanks, Gua From: Kinney, Michael D <michael.d.kinney@...>
Does that pytool plugin support viewing the code coverage visually in C source files?
Either HTML or preferably an Visual Studio Code plugin?
Can it be updated to support VS compilers tool?
Mie
From: Sean Brogan <spbrogan@...>
Hi Gua Guo, I would propose that we make this easier for both the local user and the CI system to get coverage metrics. Can you review this commit as it uses the same Edk2 plugins but adds code coverage support with GCC5:
Thanks Sean
On 9/13/2022 6:01 PM, Guo, Gua wrote: From: Gua Guo <gua.guo@...>In order to collect code coverage after running executablefile, generate *.gcda and *.gcno file that require by lcov toolto generate code coverage report.Cc: Michael D Kinney <michael.d.kinney@...>Cc: Sean Brogan <sean.brogan@...>Cc: Bret Barkelew <Bret.Barkelew@...>Cc: Michael Kubacki <mikuback@...>Signed-off-by: Gua Guo <gua.guo@...>---UnitTestFrameworkPkg/ReadMe.md | 116 +++++++++++++++++++-UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc | 2 +-2 files changed, 116 insertions(+), 2 deletions(-)diff --git a/UnitTestFrameworkPkg/ReadMe.md b/UnitTestFrameworkPkg/ReadMe.mdindex e696412cb3..93fdacfc4a 100644--- a/UnitTestFrameworkPkg/ReadMe.md+++ b/UnitTestFrameworkPkg/ReadMe.md@@ -361,7 +361,7 @@ RUNNING TEST SUITE: Int Safe Conversions Test Suite```You can also, if you are so inclined, read the output from the exact instance of the test that was run during-`stuart_ci_build`. The ouput file can be found on a path that looks like:+`stuart_ci_build`. The output file can be found on a path that looks like:`Build/<Package>/HostTest/<Arch>/<TestName>.<TestSuiteName>.<Arch>.result.xml`@@ -399,6 +399,120 @@ CMOCKA_XML_FILE=<absolute or relative path to output file>This mode is used by the test running plugin to aggregate the results for CI test status reporting in the web view.+### Enable Code Coverage for GCC host-based tests++LCOV is an extension of GCOV, a GNU tool which provides information about what parts of a program are actually executed (i.e. "covered") while running a particular test case. The extension consists of a set of scripts which build on the textual GCOV output to implement it.++Documentation for LCOV can be found here:+https://lcov.readthedocs.io/++You can follow below steps to generate your code coverage report.++++```bash+user@linux_machine:~/_uefi$stuart_ci_build -c .pytool/CISettings.py TOOL_CHAIN_TAG=GCC5 -p MdePkg -t NOOPT+...+user@linux_machine:~/_uefi$lcov -c --rc lcov_branch_coverage=1 -o UnitTest.info -d Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/+Capturing coverage data from Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/+Found gcov version: 9.4.0+Using intermediate gcov format+Scanning Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/ for .gcda files ...+Found 38 data files in Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/RShiftU64.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/Math64.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/SafeString.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/SwapBytes32.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/CpuDeadLoop.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/MultU64x64.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/LongJump.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/SetJump.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/BitField.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/String.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/DivU64x32Remainder.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/X64/GccInline.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/MultU64x32.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/MultS64x64.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/LinkedList.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/LShiftU64.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/DivU64x32.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/SwapBytes16.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/Unaligned.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/CheckSum.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/CopyMem.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/MemLibGuid.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/CompareMemWrapper.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/SetMemWrapper.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/SetMem64Wrapper.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/MemLibGeneric.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/CopyMemWrapper.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/SetMem.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/ZeroMemWrapper.gcda+Processing Library/BasePrintLib/BasePrintLib/OUTPUT/PrintLibInternal.gcda+Processing Library/BasePrintLib/BasePrintLib/OUTPUT/PrintLib.gcda+Processing Library/BaseSafeIntLib/BaseSafeIntLib/OUTPUT/SafeIntLib64.gcda+Processing Library/BaseSafeIntLib/BaseSafeIntLib/OUTPUT/SafeIntLib.gcda+Processing Test/UnitTest/Library/BaseLib/BaseLibUnitTestsHost/OUTPUT/Base64UnitTest.gcda+Processing Test/UnitTest/Library/BaseLib/BaseLibUnitTestsHost/OUTPUT/AutoGen.gcda+Processing Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLibHost/OUTPUT/SafeIntLibUintnIntnUnitTests64.gcda+Processing Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLibHost/OUTPUT/TestBaseSafeIntLib.gcda+Processing Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLibHost/OUTPUT/AutoGen.gcda++user@linux_machine:~/_uefi$genhtml UnitTest.info --branch-coverage -o Build/UnitTestReport++Reading data file UnitTest.info+Found 38 entries.+Found common filename prefix "~/_uefi/MdePkg/Library"+Writing .css and .png files.+Generating output.+Processing file ~/_uefi/Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/Test/UnitTest/Library/BaseLib/BaseLibUnitTestsHost/DEBUG/AutoGen.c+Processing file ~/_uefi/Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLibHost/DEBUG/AutoGen.c+Processing file BaseLib/Unaligned.c+Processing file BaseLib/CheckSum.c+Processing file BaseLib/BitField.c+Processing file BaseLib/DivU64x32.c+Processing file BaseLib/CpuDeadLoop.c+Processing file BaseLib/LongJump.c+Processing file BaseLib/MultU64x64.c+Processing file BaseLib/RShiftU64.c+Processing file BaseLib/SwapBytes32.c+Processing file BaseLib/SwapBytes16.c+Processing file BaseLib/SetJump.c+Processing file BaseLib/LinkedList.c+Processing file BaseLib/LShiftU64.c+Processing file BaseLib/SafeString.c+Processing file BaseLib/String.c+Processing file BaseLib/DivU64x32Remainder.c+Processing file BaseLib/MultS64x64.c+Processing file BaseLib/MultU64x32.c+Processing file BaseLib/Math64.c+Processing file BaseLib/X64/GccInline.c+Processing file BaseMemoryLib/SetMemWrapper.c+Processing file BaseMemoryLib/CompareMemWrapper.c+Processing file BaseMemoryLib/SetMem64Wrapper.c+Processing file BaseMemoryLib/ZeroMemWrapper.c+Processing file BaseMemoryLib/CopyMemWrapper.c+Processing file BaseMemoryLib/CopyMem.c+Processing file BaseMemoryLib/SetMem.c+Processing file BaseMemoryLib/MemLibGuid.c+Processing file BaseMemoryLib/MemLibGeneric.c+Processing file BasePrintLib/PrintLib.c+Processing file BasePrintLib/PrintLibInternal.c+Processing file BaseSafeIntLib/SafeIntLib64.c+Processing file BaseSafeIntLib/SafeIntLib.c+Processing file ~/_uefi/MdePkg/Test/UnitTest/Library/BaseLib/Base64UnitTest.c+Processing file ~/_uefi/MdePkg/Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLib.c+Processing file ~/_uefi/MdePkg/Test/UnitTest/Library/BaseSafeIntLib/SafeIntLibUintnIntnUnitTests64.c+Writing directory view page.+Overall coverage rate:+ lines......: 58.6% (2688 of 4589 lines)+ functions..: 57.1% (249 of 436 functions)+ branches...: 25.3% (1062 of 4195 branches)++...++```+### Important NoteThis works on both Windows and Linux, but is currently limited to x64 architectures. Working on getting others, but wediff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.incindex 4dd8d4ac67..8623aecb33 100644--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc@@ -19,7 +19,7 @@MemoryAllocationLib|UnitTestFrameworkPkg/Library/Posix/MemoryAllocationLibPosix/MemoryAllocationLibPosix.inf[BuildOptions]- GCC:*_*_*_CC_FLAGS = -fno-pie+ GCC:*_*_*_CC_FLAGS = -fno-pie -ftest-coverage -fprofile-arcs!ifdef $(UNIT_TESTING_DEBUG)MSFT:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1GCC:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1 |
|
Re: [PATCH v2] UnitTestFrameworkPkg: Add code coverage support for GCC
Michael D Kinney
Does that mean that the patch under discussion here is still valuable for local users?
I want to make sure it is easy for local users to see the coverage as unit tests are implemented locally for Windows and Linux OSes.
The ci plugin you have looks valuable for CI testing to provide feedback to the entire community on coverage changes after an initial set of unit tests are in place.
Mike
From: Sean Brogan <spbrogan@...>
Sent: Tuesday, September 13, 2022 7:10 PM To: Kinney, Michael D <michael.d.kinney@...>; devel@edk2.groups.io; Guo, Gua <gua.guo@...> Cc: Sean Brogan <sean.brogan@...>; Michael Kubacki <mikuback@...> Subject: Re: [edk2-devel] [PATCH v2] UnitTestFrameworkPkg: Add code coverage support for GCC
For local scenarios the plug-in generates the html report for viewing the c code with coverage annotations. The intermediate files are available so I would think they could be loaded in all sorts of viewers but I haven’t tried. I have just used the html and it seemed acceptable.
For ci the pipeline files have been updated to publish the data to the build. This allows using the online viewer to navigate c code and coverage. The html report is also uploaded and can be downloaded for local viewing.
Regarding using visual studio tool chain/compilers we had discussed that for ci this is unnecessary ( since we already have coverage from gcc tool chain). For local users this is important. There is an easy tool you shared with me that gives similar results. I didn’t see a great way to integrate into the plug-in for auto invocation but I plan to write up usage details for local users.
Thanks Sean From: Kinney, Michael D <michael.d.kinney@...>
Does that pytool plugin support viewing the code coverage visually in C source files?
Either HTML or preferably an Visual Studio Code plugin?
Can it be updated to support VS compilers tool?
Mie
From: Sean Brogan <spbrogan@...>
Hi Gua Guo, I would propose that we make this easier for both the local user and the CI system to get coverage metrics. Can you review this commit as it uses the same Edk2 plugins but adds code coverage support with GCC5:
Thanks Sean
On 9/13/2022 6:01 PM, Guo, Gua wrote: From: Gua Guo <gua.guo@...>In order to collect code coverage after running executablefile, generate *.gcda and *.gcno file that require by lcov toolto generate code coverage report.Cc: Michael D Kinney <michael.d.kinney@...>Cc: Sean Brogan <sean.brogan@...>Cc: Bret Barkelew <Bret.Barkelew@...>Cc: Michael Kubacki <mikuback@...>Signed-off-by: Gua Guo <gua.guo@...>---UnitTestFrameworkPkg/ReadMe.md | 116 +++++++++++++++++++-UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc | 2 +-2 files changed, 116 insertions(+), 2 deletions(-)diff --git a/UnitTestFrameworkPkg/ReadMe.md b/UnitTestFrameworkPkg/ReadMe.mdindex e696412cb3..93fdacfc4a 100644--- a/UnitTestFrameworkPkg/ReadMe.md+++ b/UnitTestFrameworkPkg/ReadMe.md@@ -361,7 +361,7 @@ RUNNING TEST SUITE: Int Safe Conversions Test Suite```You can also, if you are so inclined, read the output from the exact instance of the test that was run during-`stuart_ci_build`. The ouput file can be found on a path that looks like:+`stuart_ci_build`. The output file can be found on a path that looks like:`Build/<Package>/HostTest/<Arch>/<TestName>.<TestSuiteName>.<Arch>.result.xml`@@ -399,6 +399,120 @@ CMOCKA_XML_FILE=<absolute or relative path to output file>This mode is used by the test running plugin to aggregate the results for CI test status reporting in the web view.+### Enable Code Coverage for GCC host-based tests++LCOV is an extension of GCOV, a GNU tool which provides information about what parts of a program are actually executed (i.e. "covered") while running a particular test case. The extension consists of a set of scripts which build on the textual GCOV output to implement it.++Documentation for LCOV can be found here:+https://lcov.readthedocs.io/++You can follow below steps to generate your code coverage report.++++```bash+user@linux_machine:~/_uefi$stuart_ci_build -c .pytool/CISettings.py TOOL_CHAIN_TAG=GCC5 -p MdePkg -t NOOPT+...+user@linux_machine:~/_uefi$lcov -c --rc lcov_branch_coverage=1 -o UnitTest.info -d Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/+Capturing coverage data from Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/+Found gcov version: 9.4.0+Using intermediate gcov format+Scanning Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/ for .gcda files ...+Found 38 data files in Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/RShiftU64.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/Math64.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/SafeString.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/SwapBytes32.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/CpuDeadLoop.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/MultU64x64.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/LongJump.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/SetJump.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/BitField.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/String.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/DivU64x32Remainder.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/X64/GccInline.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/MultU64x32.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/MultS64x64.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/LinkedList.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/LShiftU64.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/DivU64x32.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/SwapBytes16.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/Unaligned.gcda+Processing Library/BaseLib/UnitTestHostBaseLib/OUTPUT/CheckSum.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/CopyMem.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/MemLibGuid.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/CompareMemWrapper.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/SetMemWrapper.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/SetMem64Wrapper.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/MemLibGeneric.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/CopyMemWrapper.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/SetMem.gcda+Processing Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/ZeroMemWrapper.gcda+Processing Library/BasePrintLib/BasePrintLib/OUTPUT/PrintLibInternal.gcda+Processing Library/BasePrintLib/BasePrintLib/OUTPUT/PrintLib.gcda+Processing Library/BaseSafeIntLib/BaseSafeIntLib/OUTPUT/SafeIntLib64.gcda+Processing Library/BaseSafeIntLib/BaseSafeIntLib/OUTPUT/SafeIntLib.gcda+Processing Test/UnitTest/Library/BaseLib/BaseLibUnitTestsHost/OUTPUT/Base64UnitTest.gcda+Processing Test/UnitTest/Library/BaseLib/BaseLibUnitTestsHost/OUTPUT/AutoGen.gcda+Processing Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLibHost/OUTPUT/SafeIntLibUintnIntnUnitTests64.gcda+Processing Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLibHost/OUTPUT/TestBaseSafeIntLib.gcda+Processing Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLibHost/OUTPUT/AutoGen.gcda++user@linux_machine:~/_uefi$genhtml UnitTest.info --branch-coverage -o Build/UnitTestReport++Reading data file UnitTest.info+Found 38 entries.+Found common filename prefix "~/_uefi/MdePkg/Library"+Writing .css and .png files.+Generating output.+Processing file ~/_uefi/Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/Test/UnitTest/Library/BaseLib/BaseLibUnitTestsHost/DEBUG/AutoGen.c+Processing file ~/_uefi/Build/MdePkg/HostTest/NOOPT_GCC5/X64/MdePkg/Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLibHost/DEBUG/AutoGen.c+Processing file BaseLib/Unaligned.c+Processing file BaseLib/CheckSum.c+Processing file BaseLib/BitField.c+Processing file BaseLib/DivU64x32.c+Processing file BaseLib/CpuDeadLoop.c+Processing file BaseLib/LongJump.c+Processing file BaseLib/MultU64x64.c+Processing file BaseLib/RShiftU64.c+Processing file BaseLib/SwapBytes32.c+Processing file BaseLib/SwapBytes16.c+Processing file BaseLib/SetJump.c+Processing file BaseLib/LinkedList.c+Processing file BaseLib/LShiftU64.c+Processing file BaseLib/SafeString.c+Processing file BaseLib/String.c+Processing file BaseLib/DivU64x32Remainder.c+Processing file BaseLib/MultS64x64.c+Processing file BaseLib/MultU64x32.c+Processing file BaseLib/Math64.c+Processing file BaseLib/X64/GccInline.c+Processing file BaseMemoryLib/SetMemWrapper.c+Processing file BaseMemoryLib/CompareMemWrapper.c+Processing file BaseMemoryLib/SetMem64Wrapper.c+Processing file BaseMemoryLib/ZeroMemWrapper.c+Processing file BaseMemoryLib/CopyMemWrapper.c+Processing file BaseMemoryLib/CopyMem.c+Processing file BaseMemoryLib/SetMem.c+Processing file BaseMemoryLib/MemLibGuid.c+Processing file BaseMemoryLib/MemLibGeneric.c+Processing file BasePrintLib/PrintLib.c+Processing file BasePrintLib/PrintLibInternal.c+Processing file BaseSafeIntLib/SafeIntLib64.c+Processing file BaseSafeIntLib/SafeIntLib.c+Processing file ~/_uefi/MdePkg/Test/UnitTest/Library/BaseLib/Base64UnitTest.c+Processing file ~/_uefi/MdePkg/Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLib.c+Processing file ~/_uefi/MdePkg/Test/UnitTest/Library/BaseSafeIntLib/SafeIntLibUintnIntnUnitTests64.c+Writing directory view page.+Overall coverage rate:+ lines......: 58.6% (2688 of 4589 lines)+ functions..: 57.1% (249 of 436 functions)+ branches...: 25.3% (1062 of 4195 branches)++...++```+### Important NoteThis works on both Windows and Linux, but is currently limited to x64 architectures. Working on getting others, but wediff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.incindex 4dd8d4ac67..8623aecb33 100644--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc@@ -19,7 +19,7 @@MemoryAllocationLib|UnitTestFrameworkPkg/Library/Posix/MemoryAllocationLibPosix/MemoryAllocationLibPosix.inf[BuildOptions]- GCC:*_*_*_CC_FLAGS = -fno-pie+ GCC:*_*_*_CC_FLAGS = -fno-pie -ftest-coverage -fprofile-arcs!ifdef $(UNIT_TESTING_DEBUG)MSFT:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1GCC:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1 |
|
Re: [PATCH 2/2] DynamicTablesPkg: Add Smbios Type17 Table generator
Sami Mujawar
Hi Abner,
toggle quoted message
Show quoted text
Please see my response inline marked [SAMI]. Regards, Sami Mujawar On 13/09/2022, 04:00, "Chang, Abner" <Abner.Chang@...> wrote: [AMD Official Use Only - General] One question in below with tag [Abner], -----Original Message-----> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Sami > Mujawar via groups.io > Sent: Monday, September 12, 2022 10:57 PM > To: Girish Mahadevan <gmahadevan@...>; devel@edk2.groups.io; > Alexei Fedorov <Alexei.Fedorov@...> > Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@...>; Jeff > Brasen <jbrasen@...>; Ashish Singhal <ashishsingha@...>; > Akanksha Jain <Akanksha.Jain2@...>; Matteo Carlini > <Matteo.Carlini@...>; Hemendra Dassanayake > <Hemendra.Dassanayake@...>; Nick Ramirez <nramirez@...>; > William Watson <wwatson@...>; Akanksha Jain > <Akanksha.Jain2@...>; nd@... > Subject: Re: [edk2-devel] [PATCH 2/2] DynamicTablesPkg: Add Smbios > Type17 Table generator ... > > +STATIC > > +EFI_STATUS > > +EFIAPI > > +FreeSmbiosType17TableEx ( > > + IN CONST SMBIOS_TABLE_GENERATOR *CONST This, > > + IN CONST CM_STD_OBJ_SMBIOS_TABLE_INFO *CONST > SmbiosTableInfo, > > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST > CfgMgrProtocol, > > + IN OUT SMBIOS_STRUCTURE ***CONST Table, > > + IN CONST UINTN TableCount > > + ) > > +{ > > + return EFI_SUCCESS; > > +} > > + > > +/** Construct SMBIOS Type17 Table describing memory devices. > > + > > + If this function allocates any resources then they must be freed > > + in the FreeXXXXTableResources function. > > + > > + @param [in] This Pointer to the SMBIOS table generator. > > + @param [in] SmbiosTableInfo Pointer to the SMBIOS table information. > > + @param [in] CfgMgrProtocol Pointer to the Configuration Manager > > + Protocol interface. > > + @param [out] Table Pointer to the SMBIOS table. > > + > > + @retval EFI_SUCCESS Table generated successfully. > > + @retval EFI_BAD_BUFFER_SIZE The size returned by the Configuration > > + Manager is less than the Object size for > > + the requested object. > > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > > + @retval EFI_NOT_FOUND Could not find information. > > + @retval EFI_OUT_OF_RESOURCES Could not allocate memory. > > + @retval EFI_UNSUPPORTED Unsupported configuration. > > +**/ > > +STATIC > > +EFI_STATUS > > +EFIAPI > > +BuildSmbiosType17TableEx ( > > + IN CONST SMBIOS_TABLE_GENERATOR *This, > > + IN CM_STD_OBJ_SMBIOS_TABLE_INFO *CONST > SmbiosTableInfo, > > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST > CfgMgrProtocol, > > + OUT SMBIOS_STRUCTURE ***Table, > > + OUT UINTN *CONST TableCount > > + ) > > +{ > > + EFI_STATUS Status; > > + UINT32 NumMemDevices; > > + SMBIOS_STRUCTURE **TableList; > > + CM_ARM_MEMORY_DEVICE_INFO *MemoryDevicesInfo; > > + UINTN Index; > > + UINTN SerialNumLen; > > + CHAR8 *SerialNum; > > + UINTN AssetTagLen; > > + CHAR8 *AssetTag; > > + UINTN DeviceLocatorLen; > > + CHAR8 *DeviceLocator; > > + UINTN BankLocatorLen; > > + CHAR8 *BankLocator; > > + UINTN FirmwareVersionLen; > > + CHAR8 *FirmwareVersion; > > + CHAR8 *OptionalStrings; > > + SMBIOS_TABLE_TYPE17 *SmbiosRecord; > > + > > + ASSERT (This != NULL); > > + ASSERT (SmbiosTableInfo != NULL); > > + ASSERT (CfgMgrProtocol != NULL); > > + ASSERT (Table != NULL); > > + ASSERT (TableCount != NULL); > > + ASSERT (SmbiosTableInfo->TableGeneratorId == This->GeneratorID); > > + > > + DEBUG ((DEBUG_ERROR, "%a : Start \n", __FUNCTION__)); *Table = > > + NULL; Status = GetEArmObjMemoryDeviceInfo ( > > + CfgMgrProtocol, > > + CM_NULL_TOKEN, > > + &MemoryDevicesInfo, > > + &NumMemDevices > > + ); [Abner] SMBIOS type 17 record is generic to all platform architectures, however here we have the dependency with ARM namespace object. [SAMI] It would certainly be very good to have a common codebase across architectures. We welcome contribution from community members towards this effort. So my question is what should we do if non-ARM platforms would like to leverage this library? [SAMI] I think we could define the SMBIOS specific objects in a separate namespace ID e.g. 1010b - SMBIOS Objects , see https://github.com/tianocore/edk2/blob/master/DynamicTablesPkg/Include/ConfigurationManagerObject.h#L30-L34 We can then define the SMBIOS objects as SMBIOS namespace objects. However, I would like to avoid duplicating any information between the ARM namespace objects and SMBIOS namespace objects (e.g. information about CPU, Cache, etc.). I have some initial thoughts on how this could be done by introducing an object mapper. However, I would first like to understand if you intend to use the Dynamic SMBIOS support only or you will use the Dynamic ACPI support as well? [/SAMI] Thanks Abner > > + if (EFI_ERROR (Status)) { > > + DEBUG (( > > + DEBUG_ERROR, > > + "Failed to get Memory Devices CM Object %r\n", > > + Status > > + )); > > + return Status; > > + } ... |
|
Re: [PATCH edk2-platforms 1/1] Platform/ARM: Update Morello and SgiPkg for ARM_CORE_INFO Mpidr change
Sami Mujawar
Hi Rebecca,
Your changes for Morello appear to be fine. However, I am not so sure about SgiPkg and why only one core is described. Maybe Thomas can provide more insight. Regards, Sami Mujawar |
|
Event: TianoCore Community Meeting - EMEA / NAMO - 09/15/2022
#cal-reminder
Group Notification <noreply@...>
Reminder: TianoCore Community Meeting - EMEA / NAMO When: Where: Organizer: Miki Demeter Description: Microsoft Teams meeting Join on your computer or mobile app Click here to join the meeting Join with a video conferencing device Video Conference ID: 111 422 379 4 Alternate VTC dialing instructions Or call in (audio only) +1 916-245-6934,,482062805# United States, Sacramento Phone Conference ID: 482 062 805# Find a local number | Reset PIN Learn More | Meeting options |
|
Re: [PATCH] DynamicTablesPkg: AcpiSsdtPcieLibArm: Allow use of segment
number as UID
PierreGondois
Hello Jeff,
toggle quoted message
Show quoted text
The patch looks good to me: Reviewed-by: Pierre Gondois <pierre.gondois@...> On 9/6/22 22:33, Jeff Brasen wrote:
Add support for selecting to use index or segment number as UID and name. |
|
[PATCH v2 34/34] BaseTools: Add LoongArch64 binding.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4053
Add LoongArch64 ProcessorBin.h and add LoongArch to Makefiles. Cc: Bob Feng <bob.c.feng@...> Cc: Liming Gao <gaoliming@...> Cc: Yuwei Chen <yuwei.chen@...> Signed-off-by: Chao Li <lichao@...> Co-authored-by: Baoqi Zhang <zhangbaoqi@...> --- BaseTools/Source/C/GNUmakefile | 3 + .../C/Include/LoongArch64/ProcessorBind.h | 80 +++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 BaseTools/Source/C/Include/LoongArch64/ProcessorBind.h diff --git a/BaseTools/Source/C/GNUmakefile b/BaseTools/Source/C/GNUmakefile index 8c191e0c38..5275f657ef 100644 --- a/BaseTools/Source/C/GNUmakefile +++ b/BaseTools/Source/C/GNUmakefile @@ -29,6 +29,9 @@ ifndef HOST_ARCH ifneq (,$(findstring riscv64,$(uname_m)))=0D HOST_ARCH=3DRISCV64=0D endif=0D + ifneq (,$(findstring loongarch64,$(uname_m)))=0D + HOST_ARCH=3DLOONGARCH64=0D + endif=0D ifndef HOST_ARCH=0D $(info Could not detected HOST_ARCH from uname results)=0D $(error HOST_ARCH is not defined!)=0D diff --git a/BaseTools/Source/C/Include/LoongArch64/ProcessorBind.h b/BaseT= ools/Source/C/Include/LoongArch64/ProcessorBind.h new file mode 100644 index 0000000000..0267859dee --- /dev/null +++ b/BaseTools/Source/C/Include/LoongArch64/ProcessorBind.h @@ -0,0 +1,80 @@ +/** @file=0D + Processor or Compiler specific defines and types for LoongArch=0D +=0D + Copyright (c) 2022, Loongson Technology Corporation Limited. All rights = reserved.<BR>=0D +=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +#ifndef PROCESSOR_BIND_H_=0D +#define PROCESSOR_BIND_H_=0D +=0D +//=0D +// Define the processor type so other code can make processor based choice= s=0D +//=0D +#define MDE_CPU_LOONGARCH64=0D +=0D +#define EFIAPI=0D +=0D +//=0D +// Make sure we are using the correct packing rules per EFI specification= =0D +//=0D +#ifndef __GNUC__=0D +#pragma pack()=0D +#endif=0D +=0D +//=0D +// Use ANSI C 2000 stdint.h integer width declarations=0D +//=0D +#include <stdint.h>=0D +typedef uint8_t BOOLEAN;=0D +typedef int8_t INT8;=0D +typedef uint8_t UINT8;=0D +typedef int16_t INT16;=0D +typedef uint16_t UINT16;=0D +typedef int32_t INT32;=0D +typedef uint32_t UINT32;=0D +typedef int64_t INT64;=0D +typedef uint64_t UINT64;=0D +typedef char CHAR8;=0D +typedef uint16_t CHAR16;=0D +=0D +//=0D +// Unsigned value of native width. (4 bytes on supported 32-bit processor= instructions,=0D +// 8 bytes on supported 64-bit processor instructions)=0D +//=0D +typedef UINT64 UINTN;=0D +=0D +//=0D +// Signed value of native width. (4 bytes on supported 32-bit processor i= nstructions,=0D +// 8 bytes on supported 64-bit processor instructions)=0D +//=0D +typedef INT64 INTN;=0D +=0D +//=0D +// Processor specific defines=0D +//=0D +=0D +//=0D +// A value of native width with the highest bit set.=0D +//=0D +#define MAX_BIT 0x8000000000000000ULL=0D +//=0D +// A value of native width with the two highest bits set.=0D +//=0D +#define MAX_2_BITS 0xC000000000000000ULL=0D +=0D +#if defined (__GNUC__)=0D +//=0D +// For GNU assembly code, .global or .globl can declare global symbols.=0D +// Define this macro to unify the usage.=0D +//=0D +#define ASM_GLOBAL .globl=0D +#endif=0D +=0D +//=0D +// The stack alignment required for LoongArch=0D +//=0D +#define CPU_STACK_ALIGNMENT 16=0D +=0D +#endif=0D --=20 2.27.0 |
|
[PATCH v2 33/34] NetworkPkg: Add LoongArch64 architecture.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4053
Add LoongArch64 architecture in to NetworkPkg. Cc: Maciej Rabeda <maciej.rabeda@...> Cc: Jiaxin Wu <jiaxin.wu@...> Cc: Siyuan Fu <siyuan.fu@...> Signed-off-by: Chao Li <lichao@...> --- NetworkPkg/Network.dsc.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NetworkPkg/Network.dsc.inc b/NetworkPkg/Network.dsc.inc index 99fad885bf..04b515a0bb 100644 --- a/NetworkPkg/Network.dsc.inc +++ b/NetworkPkg/Network.dsc.inc @@ -9,6 +9,7 @@ #=0D # Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR>=0D # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All right= s reserved.<BR>=0D +# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights = reserved.<BR>=0D #=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D @@ -38,7 +39,7 @@ !include NetworkPkg/NetworkComponents.dsc.inc=0D =0D !else=0D -[Components.IA32, Components.X64, Components.ARM, Components.AARCH64, Comp= onents.RISCV64]=0D +[Components.IA32, Components.X64, Components.ARM, Components.AARCH64, Comp= onents.RISCV64, Components.LOONGARCH64]=0D !include NetworkPkg/NetworkComponents.dsc.inc=0D =0D !endif=0D --=20 2.27.0 |
|
[PATCH v2 32/34] MdeModulePkg/DxeIplPeim : LoongArch DxeIPL implementation.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4053
Implement LoongArch DxeIPL instance. Cc: Liming Gao <gaoliming@...> Cc: Guomin Jiang <guomin.jiang@...> Signed-off-by: Chao Li <lichao@...> Co-authored-by: Baoqi Zhang <zhangbaoqi@...> --- MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf | 6 +- .../Core/DxeIplPeim/LoongArch64/DxeLoadFunc.c | 63 +++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 MdeModulePkg/Core/DxeIplPeim/LoongArch64/DxeLoadFunc.c diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf b/MdeModulePkg/Core/Dx= eIplPeim/DxeIpl.inf index 19b8a4c8ae..052ea0ec1a 100644 --- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf +++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf @@ -8,6 +8,7 @@ # Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>= =0D # Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>=0D # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All righ= ts reserved.<BR>=0D +# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights= reserved.<BR>=0D #=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D @@ -26,7 +27,7 @@ #=0D # The following information is for reference only and not required by the = build tools.=0D #=0D -# VALID_ARCHITECTURES =3D IA32 X64 EBC (EBC is for build only) = AARCH64 RISCV64=0D +# VALID_ARCHITECTURES =3D IA32 X64 EBC (EBC is for build only) = AARCH64 RISCV64 LOONGARCH64=0D #=0D =0D [Sources]=0D @@ -53,6 +54,9 @@ [Sources.RISCV64]=0D RiscV64/DxeLoadFunc.c=0D =0D +[Sources.LOONGARCH64]=0D + LoongArch64/DxeLoadFunc.c=0D +=0D [Packages]=0D MdePkg/MdePkg.dec=0D MdeModulePkg/MdeModulePkg.dec=0D diff --git a/MdeModulePkg/Core/DxeIplPeim/LoongArch64/DxeLoadFunc.c b/MdeMo= dulePkg/Core/DxeIplPeim/LoongArch64/DxeLoadFunc.c new file mode 100644 index 0000000000..95d3af19ea --- /dev/null +++ b/MdeModulePkg/Core/DxeIplPeim/LoongArch64/DxeLoadFunc.c @@ -0,0 +1,63 @@ +/** @file=0D + LoongArch specifc functionality for DxeLoad.=0D +=0D + Copyright (c) 2022, Loongson Technology Corporation Limited. All rights = reserved.<BR>=0D +=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#include "DxeIpl.h"=0D +=0D +/**=0D + Transfers control to DxeCore.=0D +=0D + This function performs a CPU architecture specific operations to execut= e=0D + the entry point of DxeCore with the parameters of HobList.=0D + It also installs EFI_END_OF_PEI_PPI to signal the end of PEI phase.=0D +=0D + @param[in] DxeCoreEntryPoint The entry point of DxeCore.=0D + @param[in] HobList The start of HobList passed to Dxe= Core.=0D +=0D +**/=0D +VOID=0D +HandOffToDxeCore (=0D + IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,=0D + IN EFI_PEI_HOB_POINTERS HobList=0D + )=0D +{=0D + VOID *BaseOfStack;=0D + VOID *TopOfStack;=0D + EFI_STATUS Status;=0D +=0D + //=0D + // Allocate 128KB for the Stack=0D + //=0D + BaseOfStack =3D AllocatePages (EFI_SIZE_TO_PAGES (STACK_SIZE));=0D + ASSERT (BaseOfStack !=3D NULL);=0D +=0D + //=0D + // Compute the top of the stack we were allocated. Pre-allocate a UINTN= =0D + // for safety.=0D + //=0D + TopOfStack =3D (VOID *)((UINTN)BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SI= ZE) * EFI_PAGE_SIZE - CPU_STACK_ALIGNMENT);=0D + TopOfStack =3D ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);=0D +=0D + //=0D + // End of PEI phase signal=0D + //=0D + Status =3D PeiServicesInstallPpi (&gEndOfPeiSignalPpi);=0D + ASSERT_EFI_ERROR (Status);=0D +=0D + //=0D + // Update the contents of BSP stack HOB to reflect the real stack info p= assed to DxeCore.=0D + //=0D + UpdateStackHob ((EFI_PHYSICAL_ADDRESS)(UINTN)BaseOfStack, STACK_SIZE);=0D +=0D + SwitchStack (=0D + (SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint,=0D + HobList.Raw,=0D + NULL,=0D + TopOfStack=0D + );=0D +}=0D --=20 2.27.0 |
|
[PATCH v2 31/34] MdeModulePkg/CapsuleRuntimeDxe: Add LoongArch64 architecture.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4053
Add LoongArch in INF for building CapsuleRuntimeDxe LoongArch64 image. Cc: Liming Gao <gaoliming@...> Cc: Guomin Jiang <guomin.jiang@...> Sigend-off-by: Chao Li <lichao@...> --- .../Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf= b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf index 8bf5035a69..601eada170 100644 --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf @@ -6,6 +6,7 @@ #=0D # Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>= =0D # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All righ= ts reserved.<BR>=0D +# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights= reserved.<BR>=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D ##=0D @@ -22,20 +23,20 @@ #=0D # The following information is for reference only and not required by the = build tools.=0D #=0D -# VALID_ARCHITECTURES =3D IA32 X64 EBC ARM AARCH64 RISCV64=0D +# VALID_ARCHITECTURES =3D IA32 X64 EBC ARM AARCH64 RISCV64 LOON= GARCH64=0D #=0D =0D [Sources]=0D CapsuleService.c=0D CapsuleService.h=0D =0D -[Sources.Ia32, Sources.EBC, Sources.ARM, Sources.AARCH64, Sources.RISCV64]= =0D +[Sources.Ia32, Sources.EBC, Sources.ARM, Sources.AARCH64, Sources.RISCV64,= Sources.LOONGARCH64]=0D SaveLongModeContext.c=0D =0D -[Sources.Ia32, Sources.X64, Sources.ARM, Sources.AARCH64, Sources.RISCV64]= =0D +[Sources.Ia32, Sources.X64, Sources.ARM, Sources.AARCH64, Sources.RISCV64,= Sources.LOONGARCH64]=0D CapsuleCache.c=0D =0D -[Sources.Ia32, Sources.X64, Sources.EBC, Sources.RISCV64]=0D +[Sources.Ia32, Sources.X64, Sources.EBC, Sources.RISCV64, Sources.LOONGARC= H64]=0D CapsuleReset.c=0D =0D [Sources.ARM, Sources.AARCH64]=0D --=20 2.27.0 |
|