* [edk2-devel] [staging/dynamictables-reorg PATCH 0/2] DynamicTablesPkg: CI related fixes
@ 2024-07-03 9:53 PierreGondois
2024-07-03 9:53 ` [edk2-devel] [staging/dynamictables-reorg PATCH 1/2] DynamicTablesPkg: Fix conversion compiler warnings PierreGondois
2024-07-03 9:53 ` [edk2-devel] [staging/dynamictables-reorg PATCH 2/2] DynamicTablesPkg: Add EFIAPI to generators hooks PierreGondois
0 siblings, 2 replies; 6+ messages in thread
From: PierreGondois @ 2024-07-03 9:53 UTC (permalink / raw)
To: devel
Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
Sunil V L, Yeo Reum Yun
Small fixes reported while running the CI.
These patches should be applied on top of:
- [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs
https://edk2.groups.io/g/devel/message/119632
Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com>
Cc: Girish Mahadevan <gmahadevan@nvidia.com>
Cc: Jeff Brasen <jbrasen@nvidia.com>
Cc: Jeshua Smith <jeshuas@nvidia.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Cc: Pierre Gondois <pierre.gondois@arm.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Yeo Reum Yun <YeoReum.Yun@arm.com>
Pierre Gondois (2):
DynamicTablesPkg: Fix conversion compiler warnings
DynamicTablesPkg: Add EFIAPI to generators hooks
DynamicTablesPkg/Include/AcpiTableGenerator.h | 8 ++++----
.../Acpi/Common/AcpiMcfgLib/McfgGenerator.c | 1 +
.../Acpi/Common/AcpiPcctLib/PcctGenerator.c | 16 ++++++++++++----
.../Acpi/Common/AcpiPpttLib/PpttGenerator.c | 1 +
.../Acpi/Common/AcpiSratLib/SratGenerator.c | 1 +
.../SsdtCpuTopologyGenerator.c | 7 +++++--
.../Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c | 15 ++++++++++-----
7 files changed, 34 insertions(+), 15 deletions(-)
--
2.25.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119777): https://edk2.groups.io/g/devel/message/119777
Mute This Topic: https://groups.io/mt/107016602/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 6+ messages in thread
* [edk2-devel] [staging/dynamictables-reorg PATCH 1/2] DynamicTablesPkg: Fix conversion compiler warnings
2024-07-03 9:53 [edk2-devel] [staging/dynamictables-reorg PATCH 0/2] DynamicTablesPkg: CI related fixes PierreGondois
@ 2024-07-03 9:53 ` PierreGondois
2024-07-03 10:35 ` Sami Mujawar
2024-07-03 9:53 ` [edk2-devel] [staging/dynamictables-reorg PATCH 2/2] DynamicTablesPkg: Add EFIAPI to generators hooks PierreGondois
1 sibling, 1 reply; 6+ messages in thread
From: PierreGondois @ 2024-07-03 9:53 UTC (permalink / raw)
To: devel
Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
Sunil V L, Yeo Reum Yun, Pierre Gondois
Some CM objects fields are wider than the targeted field in ACPI
tables. Some assignments are also subject to data loss and
trigger the following warnings:
- '<': signed/unsigned mismatch
- '=': conversion from 'UINTxx' to 'UINTyy', possible loss of data
with xx > yy.
Add checks/cast to remove the warnings.
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
.../Acpi/Common/AcpiPcctLib/PcctGenerator.c | 15 +++++++++++----
.../SsdtCpuTopologyGenerator.c | 6 ++++--
.../Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c | 15 ++++++++++-----
3 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
index 205c44405785..061e12bf1b3d 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
@@ -379,10 +379,12 @@ AddSubspaceStructType1 (
Doorbell = &GenericPccCmObj->DoorbellReg;
ChannelTiming = &GenericPccCmObj->ChannelTiming;
+ ASSERT ((PccCmObj->PlatIrq.Flags >> 8) == 0);
+
PccAcpi->Type = GenericPccCmObj->Type;
PccAcpi->Length = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS);
PccAcpi->PlatformInterrupt = PccCmObj->PlatIrq.Interrupt;
- PccAcpi->PlatformInterruptFlags = PccCmObj->PlatIrq.Flags;
+ PccAcpi->PlatformInterruptFlags = (UINT8)PccCmObj->PlatIrq.Flags;
PccAcpi->Reserved = EFI_ACPI_RESERVED_BYTE;
PccAcpi->BaseAddress = GenericPccCmObj->BaseAddress;
PccAcpi->AddressLength = GenericPccCmObj->AddressLength;
@@ -441,10 +443,12 @@ AddSubspaceStructType2 (
PlatIrqAck = &PccCmObj->PlatIrqAckReg;
ChannelTiming = &GenericPccCmObj->ChannelTiming;
+ ASSERT ((PccCmObj->PlatIrq.Flags >> 8) == 0);
+
PccAcpi->Type = GenericPccCmObj->Type;
PccAcpi->Length = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS);
PccAcpi->PlatformInterrupt = PccCmObj->PlatIrq.Interrupt;
- PccAcpi->PlatformInterruptFlags = PccCmObj->PlatIrq.Flags;
+ PccAcpi->PlatformInterruptFlags = (UINT8)PccCmObj->PlatIrq.Flags;
PccAcpi->BaseAddress = GenericPccCmObj->BaseAddress;
PccAcpi->Reserved = EFI_ACPI_RESERVED_BYTE;
PccAcpi->BaseAddress = GenericPccCmObj->BaseAddress;
@@ -519,13 +523,16 @@ AddSubspaceStructType34 (
ErrorStatus = &PccCmObj->ErrorStatusReg;
ChannelTiming = &GenericPccCmObj->ChannelTiming;
+ ASSERT ((PccCmObj->PlatIrq.Flags >> 8) == 0);
+ ASSERT ((GenericPccCmObj->AddressLength >> 32) == 0);
+
PccAcpi->Type = GenericPccCmObj->Type;
PccAcpi->Length = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC);
PccAcpi->PlatformInterrupt = PccCmObj->PlatIrq.Interrupt;
- PccAcpi->PlatformInterruptFlags = PccCmObj->PlatIrq.Flags;
+ PccAcpi->PlatformInterruptFlags = (UINT8)PccCmObj->PlatIrq.Flags;
PccAcpi->Reserved = EFI_ACPI_RESERVED_BYTE;
PccAcpi->BaseAddress = GenericPccCmObj->BaseAddress;
- PccAcpi->AddressLength = GenericPccCmObj->AddressLength;
+ PccAcpi->AddressLength = (UINT32)GenericPccCmObj->AddressLength;
CopyMem (
&PccAcpi->DoorbellRegister,
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c
index 74595131935c..f82b7449713c 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c
@@ -1026,7 +1026,8 @@ CreateAmlCpuTopologyTree (
if (Generator->ProcNodeList[Index].OverrideNameUidEnabled) {
Name = Generator->ProcNodeList[Index].OverrideName;
} else {
- Name = CpuIndex;
+ ASSERT ((CpuIndex >> 16) == 0);
+ Name = (UINT16)CpuIndex;
}
Status = CreateAmlCpuFromProcHierarchy (
@@ -1061,7 +1062,8 @@ CreateAmlCpuTopologyTree (
Name = Generator->ProcNodeList[Index].OverrideName;
Uid = Generator->ProcNodeList[Index].OverrideUid;
} else {
- Name = ProcContainerName;
+ ASSERT ((ProcContainerName >> 16) == 0);
+ Name = (UINT16)ProcContainerName;
Uid = *ProcContainerIndex;
}
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c
index 5b6d5515622b..3dcca2b33987 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c
@@ -311,7 +311,7 @@ GeneratePrt (
)
{
EFI_STATUS Status;
- INT32 Index;
+ UINT32 Index;
AML_OBJECT_NODE_HANDLE PrtNode;
CM_ARCH_COMMON_OBJ_REF *RefInfo;
UINT32 RefCount;
@@ -561,6 +561,11 @@ GeneratePciCrs (
break;
case PCI_SS_M32:
+ ASSERT ((AddrMapInfo->PciAddress >> 32) == 0);
+ ASSERT (((AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1) >> 32) == 0);
+ ASSERT (((Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0) >> 32) == 0);
+ ASSERT ((AddrMapInfo->AddressSize >> 32) == 0);
+
Status = AmlCodeGenRdDWordMemory (
FALSE,
IsPosDecode,
@@ -569,10 +574,10 @@ GeneratePciCrs (
AmlMemoryCacheable,
TRUE,
0,
- AddrMapInfo->PciAddress,
- AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,
- Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0,
- AddrMapInfo->AddressSize,
+ (UINT32)(AddrMapInfo->PciAddress),
+ (UINT32)(AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1),
+ (UINT32)(Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0),
+ (UINT32)(AddrMapInfo->AddressSize),
0,
NULL,
AmlAddressRangeMemory,
--
2.25.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119778): https://edk2.groups.io/g/devel/message/119778
Mute This Topic: https://groups.io/mt/107016603/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [edk2-devel] [staging/dynamictables-reorg PATCH 2/2] DynamicTablesPkg: Add EFIAPI to generators hooks
2024-07-03 9:53 [edk2-devel] [staging/dynamictables-reorg PATCH 0/2] DynamicTablesPkg: CI related fixes PierreGondois
2024-07-03 9:53 ` [edk2-devel] [staging/dynamictables-reorg PATCH 1/2] DynamicTablesPkg: Fix conversion compiler warnings PierreGondois
@ 2024-07-03 9:53 ` PierreGondois
2024-07-03 10:36 ` Sami Mujawar
1 sibling, 1 reply; 6+ messages in thread
From: PierreGondois @ 2024-07-03 9:53 UTC (permalink / raw)
To: devel
Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
Sunil V L, Yeo Reum Yun
For X64 builds, the EFIAPI is replaced by '(__attribute__((ms_abi))'.
This might lead to build error for some ACPI tablte generators
due to function prototype mismatch.
Add the EFIAPI to ACPI table generator hooks:
- ACPI_TABLE_GENERATOR_BUILD_TABLEEX
- ACPI_TABLE_GENERATOR_FREE_TABLEEX
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
DynamicTablesPkg/Include/AcpiTableGenerator.h | 8 ++++----
.../Library/Acpi/Common/AcpiMcfgLib/McfgGenerator.c | 1 +
.../Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c | 1 +
.../Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c | 1 +
.../Library/Acpi/Common/AcpiSratLib/SratGenerator.c | 1 +
.../AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c | 1 +
6 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/DynamicTablesPkg/Include/AcpiTableGenerator.h b/DynamicTablesPkg/Include/AcpiTableGenerator.h
index d0eda011c301..f5c6179be082 100644
--- a/DynamicTablesPkg/Include/AcpiTableGenerator.h
+++ b/DynamicTablesPkg/Include/AcpiTableGenerator.h
@@ -214,7 +214,7 @@ typedef struct AcpiTableGenerator ACPI_TABLE_GENERATOR;
@return EFI_SUCCESS If the table is generated successfully or other
failure codes as returned by the generator.
**/
-typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_BUILD_TABLE) (
+typedef EFI_STATUS (EFIAPI *ACPI_TABLE_GENERATOR_BUILD_TABLE)(
IN CONST ACPI_TABLE_GENERATOR *This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
@@ -234,7 +234,7 @@ typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_BUILD_TABLE) (
@return EFI_SUCCESS If freed successfully or other failure codes
as returned by the generator.
**/
-typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_FREE_TABLE) (
+typedef EFI_STATUS (EFIAPI *ACPI_TABLE_GENERATOR_FREE_TABLE)(
IN CONST ACPI_TABLE_GENERATOR *CONST This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
@@ -257,7 +257,7 @@ typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_FREE_TABLE) (
@return EFI_SUCCESS If the table is generated successfully or other
failure codes as returned by the generator.
**/
-typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_BUILD_TABLEEX) (
+typedef EFI_STATUS (EFIAPI *ACPI_TABLE_GENERATOR_BUILD_TABLEEX)(
IN CONST ACPI_TABLE_GENERATOR *This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
@@ -280,7 +280,7 @@ typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_BUILD_TABLEEX) (
@return EFI_SUCCESS If freed successfully or other failure codes
as returned by the generator.
**/
-typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_FREE_TABLEEX) (
+typedef EFI_STATUS (EFIAPI *ACPI_TABLE_GENERATOR_FREE_TABLEEX)(
IN CONST ACPI_TABLE_GENERATOR *CONST This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/McfgGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/McfgGenerator.c
index 722f9c17d541..40dea304e301 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/McfgGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/McfgGenerator.c
@@ -261,6 +261,7 @@ error_handler:
**/
STATIC
EFI_STATUS
+EFIAPI
FreeMcfgTableResources (
IN CONST ACPI_TABLE_GENERATOR *CONST This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
index 061e12bf1b3d..12e34f3e442c 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
@@ -1075,6 +1075,7 @@ error_handler:
**/
STATIC
EFI_STATUS
+EFIAPI
FreePcctTableResources (
IN CONST ACPI_TABLE_GENERATOR *CONST This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c
index 2b8088a07f44..fd465cbab0e9 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c
@@ -1342,6 +1342,7 @@ error_handler:
**/
STATIC
EFI_STATUS
+EFIAPI
FreePpttTableResources (
IN CONST ACPI_TABLE_GENERATOR *CONST This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c
index dcdacc4e966e..1a9434e6bd08 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c
@@ -552,6 +552,7 @@ error_handler:
**/
STATIC
EFI_STATUS
+EFIAPI
FreeSratTableResources (
IN CONST ACPI_TABLE_GENERATOR *CONST This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c
index f82b7449713c..994c6e44d0d7 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c
@@ -1313,6 +1313,7 @@ exit_handler:
**/
STATIC
EFI_STATUS
+EFIAPI
FreeSsdtCpuTopologyTableResources (
IN CONST ACPI_TABLE_GENERATOR *CONST This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
--
2.25.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119779): https://edk2.groups.io/g/devel/message/119779
Mute This Topic: https://groups.io/mt/107016605/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [edk2-devel] [staging/dynamictables-reorg PATCH 1/2] DynamicTablesPkg: Fix conversion compiler warnings
2024-07-03 9:53 ` [edk2-devel] [staging/dynamictables-reorg PATCH 1/2] DynamicTablesPkg: Fix conversion compiler warnings PierreGondois
@ 2024-07-03 10:35 ` Sami Mujawar
2024-07-03 10:44 ` PierreGondois
0 siblings, 1 reply; 6+ messages in thread
From: Sami Mujawar @ 2024-07-03 10:35 UTC (permalink / raw)
To: Pierre Gondois, devel@edk2.groups.io
Cc: AbdulLateef Attar, Girish Mahadevan,
Jeff Brasen (jbrasen@nvidia.com), Jeshua Smith, Leif Lindholm,
Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com), Sunil V L,
Yeo Reum Yun, nd
Hi Pierre,
Thank you for these patches.
On 03/07/2024, 10:54, "Pierre Gondois" <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>> wrote:
Some CM objects fields are wider than the targeted field in ACPI
tables. Some assignments are also subject to data loss and
trigger the following warnings:
- '<': signed/unsigned mismatch
- '=': conversion from 'UINTxx' to 'UINTyy', possible loss of data
with xx > yy.
Add checks/cast to remove the warnings.
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com <mailto:Pierre.Gondois@arm.com>>
---
.../Acpi/Common/AcpiPcctLib/PcctGenerator.c | 15 +++++++++++----
.../SsdtCpuTopologyGenerator.c | 6 ++++--
.../Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c | 15 ++++++++++-----
3 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
index 205c44405785..061e12bf1b3d 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
@@ -379,10 +379,12 @@ AddSubspaceStructType1 (
Doorbell = &GenericPccCmObj->DoorbellReg;
ChannelTiming = &GenericPccCmObj->ChannelTiming;
+ ASSERT ((PccCmObj->PlatIrq.Flags >> 8) == 0);
[SAMI] I think we can change this to ASSERT ((PccCmObj->PlatIrq.Flags & ~MAX_UINT8) == 0);
That way we can also avoid magic numbers.
I think similar changes are required elsewhere in this patch.
If you agree, I will make the changes before merging.
Otherwise, this series looks good to me.
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Regards,
Sami Mujawar
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119781): https://edk2.groups.io/g/devel/message/119781
Mute This Topic: https://groups.io/mt/107016603/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [edk2-devel] [staging/dynamictables-reorg PATCH 2/2] DynamicTablesPkg: Add EFIAPI to generators hooks
2024-07-03 9:53 ` [edk2-devel] [staging/dynamictables-reorg PATCH 2/2] DynamicTablesPkg: Add EFIAPI to generators hooks PierreGondois
@ 2024-07-03 10:36 ` Sami Mujawar
0 siblings, 0 replies; 6+ messages in thread
From: Sami Mujawar @ 2024-07-03 10:36 UTC (permalink / raw)
To: Pierre Gondois, devel@edk2.groups.io
Cc: AbdulLateef Attar, Girish Mahadevan,
Jeff Brasen (jbrasen@nvidia.com), Jeshua Smith, Leif Lindholm,
Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com), Sunil V L,
Yeo Reum Yun, nd
Hi Pierre,
Thank you for this patch.
These changes look good to me.
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Regards,
Sami Mujawar
On 03/07/2024, 10:54, "Pierre Gondois" <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>> wrote:
For X64 builds, the EFIAPI is replaced by '(__attribute__((ms_abi))'.
This might lead to build error for some ACPI tablte generators
due to function prototype mismatch.
Add the EFIAPI to ACPI table generator hooks:
- ACPI_TABLE_GENERATOR_BUILD_TABLEEX
- ACPI_TABLE_GENERATOR_FREE_TABLEEX
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>>
---
DynamicTablesPkg/Include/AcpiTableGenerator.h | 8 ++++----
.../Library/Acpi/Common/AcpiMcfgLib/McfgGenerator.c | 1 +
.../Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c | 1 +
.../Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c | 1 +
.../Library/Acpi/Common/AcpiSratLib/SratGenerator.c | 1 +
.../AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c | 1 +
6 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/DynamicTablesPkg/Include/AcpiTableGenerator.h b/DynamicTablesPkg/Include/AcpiTableGenerator.h
index d0eda011c301..f5c6179be082 100644
--- a/DynamicTablesPkg/Include/AcpiTableGenerator.h
+++ b/DynamicTablesPkg/Include/AcpiTableGenerator.h
@@ -214,7 +214,7 @@ typedef struct AcpiTableGenerator ACPI_TABLE_GENERATOR;
@return EFI_SUCCESS If the table is generated successfully or other
failure codes as returned by the generator.
**/
-typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_BUILD_TABLE) (
+typedef EFI_STATUS (EFIAPI *ACPI_TABLE_GENERATOR_BUILD_TABLE)(
IN CONST ACPI_TABLE_GENERATOR *This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
@@ -234,7 +234,7 @@ typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_BUILD_TABLE) (
@return EFI_SUCCESS If freed successfully or other failure codes
as returned by the generator.
**/
-typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_FREE_TABLE) (
+typedef EFI_STATUS (EFIAPI *ACPI_TABLE_GENERATOR_FREE_TABLE)(
IN CONST ACPI_TABLE_GENERATOR *CONST This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
@@ -257,7 +257,7 @@ typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_FREE_TABLE) (
@return EFI_SUCCESS If the table is generated successfully or other
failure codes as returned by the generator.
**/
-typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_BUILD_TABLEEX) (
+typedef EFI_STATUS (EFIAPI *ACPI_TABLE_GENERATOR_BUILD_TABLEEX)(
IN CONST ACPI_TABLE_GENERATOR *This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
@@ -280,7 +280,7 @@ typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_BUILD_TABLEEX) (
@return EFI_SUCCESS If freed successfully or other failure codes
as returned by the generator.
**/
-typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_FREE_TABLEEX) (
+typedef EFI_STATUS (EFIAPI *ACPI_TABLE_GENERATOR_FREE_TABLEEX)(
IN CONST ACPI_TABLE_GENERATOR *CONST This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/McfgGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/McfgGenerator.c
index 722f9c17d541..40dea304e301 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/McfgGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/McfgGenerator.c
@@ -261,6 +261,7 @@ error_handler:
**/
STATIC
EFI_STATUS
+EFIAPI
FreeMcfgTableResources (
IN CONST ACPI_TABLE_GENERATOR *CONST This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
index 061e12bf1b3d..12e34f3e442c 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
@@ -1075,6 +1075,7 @@ error_handler:
**/
STATIC
EFI_STATUS
+EFIAPI
FreePcctTableResources (
IN CONST ACPI_TABLE_GENERATOR *CONST This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c
index 2b8088a07f44..fd465cbab0e9 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c
@@ -1342,6 +1342,7 @@ error_handler:
**/
STATIC
EFI_STATUS
+EFIAPI
FreePpttTableResources (
IN CONST ACPI_TABLE_GENERATOR *CONST This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c
index dcdacc4e966e..1a9434e6bd08 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c
@@ -552,6 +552,7 @@ error_handler:
**/
STATIC
EFI_STATUS
+EFIAPI
FreeSratTableResources (
IN CONST ACPI_TABLE_GENERATOR *CONST This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c
index f82b7449713c..994c6e44d0d7 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c
@@ -1313,6 +1313,7 @@ exit_handler:
**/
STATIC
EFI_STATUS
+EFIAPI
FreeSsdtCpuTopologyTableResources (
IN CONST ACPI_TABLE_GENERATOR *CONST This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
--
2.25.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119782): https://edk2.groups.io/g/devel/message/119782
Mute This Topic: https://groups.io/mt/107016605/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [edk2-devel] [staging/dynamictables-reorg PATCH 1/2] DynamicTablesPkg: Fix conversion compiler warnings
2024-07-03 10:35 ` Sami Mujawar
@ 2024-07-03 10:44 ` PierreGondois
0 siblings, 0 replies; 6+ messages in thread
From: PierreGondois @ 2024-07-03 10:44 UTC (permalink / raw)
To: Sami Mujawar, devel@edk2.groups.io
Cc: AbdulLateef Attar, Girish Mahadevan,
Jeff Brasen (jbrasen@nvidia.com), Jeshua Smith, Leif Lindholm,
Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com), Sunil V L,
Yeo Reum Yun, nd
Hi Sami,
On 7/3/24 12:35, Sami Mujawar wrote:
> Hi Pierre,
>
> Thank you for these patches.
>
>
> On 03/07/2024, 10:54, "Pierre Gondois" <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>> wrote:
>
>
> Some CM objects fields are wider than the targeted field in ACPI
> tables. Some assignments are also subject to data loss and
> trigger the following warnings:
> - '<': signed/unsigned mismatch
> - '=': conversion from 'UINTxx' to 'UINTyy', possible loss of data
> with xx > yy.
>
>
> Add checks/cast to remove the warnings.
>
>
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com <mailto:Pierre.Gondois@arm.com>>
> ---
> .../Acpi/Common/AcpiPcctLib/PcctGenerator.c | 15 +++++++++++----
> .../SsdtCpuTopologyGenerator.c | 6 ++++--
> .../Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c | 15 ++++++++++-----
> 3 files changed, 25 insertions(+), 11 deletions(-)
>
>
> diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
> index 205c44405785..061e12bf1b3d 100644
> --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
> +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
> @@ -379,10 +379,12 @@ AddSubspaceStructType1 (
> Doorbell = &GenericPccCmObj->DoorbellReg;
>
>
> ChannelTiming = &GenericPccCmObj->ChannelTiming;
>
>
>
>
>
>
> + ASSERT ((PccCmObj->PlatIrq.Flags >> 8) == 0);
>
> [SAMI] I think we can change this to ASSERT ((PccCmObj->PlatIrq.Flags & ~MAX_UINT8) == 0);
> That way we can also avoid magic numbers.
> I think similar changes are required elsewhere in this patch.
> If you agree, I will make the changes before merging.
Yes sure, thanks!
Regards,
Pierre
>
> Otherwise, this series looks good to me.
>
> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
>
>
> Regards,
>
> Sami Mujawar
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119783): https://edk2.groups.io/g/devel/message/119783
Mute This Topic: https://groups.io/mt/107016603/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-07-03 10:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-03 9:53 [edk2-devel] [staging/dynamictables-reorg PATCH 0/2] DynamicTablesPkg: CI related fixes PierreGondois
2024-07-03 9:53 ` [edk2-devel] [staging/dynamictables-reorg PATCH 1/2] DynamicTablesPkg: Fix conversion compiler warnings PierreGondois
2024-07-03 10:35 ` Sami Mujawar
2024-07-03 10:44 ` PierreGondois
2024-07-03 9:53 ` [edk2-devel] [staging/dynamictables-reorg PATCH 2/2] DynamicTablesPkg: Add EFIAPI to generators hooks PierreGondois
2024-07-03 10:36 ` Sami Mujawar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox