[edk2-devel] [PATCH v5 1/1] MdeModulePkg/AcpiTableDxe: Prefer xDSDT over DSDT when installing tables

2024-01-28 Thread Dhaval Sharma
As per ACPI Spec 6.5+ Table 5-9 if xDSDT is available,
it should be used first. Handle required flow when xDSDT
is absent or present.

Test: Tested on RISCV64 Qemu platform with xDSDT and booted to
linux kernel.

Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Dandan Bi 
Cc: Pedro Falcato 
Cc: devel@edk2.groups.io
Signed-off-by: Dhaval Sharma 
Acked-by: Chasel Chiu 
---

Notes:
v5:
- If DSDT is not found, throw error and continue to build other tables
v4:
- Fix typos and commit message adding more clarity to patch subject
v3:
- Added description of ACPI spec clarification based on which this patch is 
created
- Optimizing if-else flow
v2:
- Added proper indentation for else if

 MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c | 24 
++--
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c 
b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
index e09bc9b704f5..3879e10b3349 100644
--- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
+++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
@@ -1892,14 +1892,24 @@ InstallAcpiTableFromHob (
   }
 }
 
-if (((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)ChildTable)->Dsdt != 
0) {
+//
+// First check if xDSDT is available, as that is preferred as per
+// ACPI Spec 6.5+ Table 5-9 X_DSDT definition
+//
+if (((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)ChildTable)->XDsdt 
!= 0) {
+  TableToInstall = (VOID 
*)(UINTN)((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)ChildTable)->XDsdt;
+} else if (((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE 
*)ChildTable)->Dsdt != 0) {
   TableToInstall = (VOID 
*)(UINTN)((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)ChildTable)->Dsdt;
-  Status = AddTableToList (AcpiTableInstance, TableToInstall, 
TRUE, Version, TRUE, &TableKey);
-  if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "InstallAcpiTableFromHob: Fail to add ACPI 
table DSDT\n"));
-ASSERT_EFI_ERROR (Status);
-break;
-  }
+} else {
+  DEBUG ((DEBUG_ERROR, "DSDT table not found\n"));
+  continue;
+}
+
+Status = AddTableToList (AcpiTableInstance, TableToInstall, TRUE, 
Version, TRUE, &TableKey);
+if (EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR, "InstallAcpiTableFromHob: Fail to add ACPI 
table DSDT\n"));
+  ASSERT_EFI_ERROR (Status);
+  break;
 }
   }
 }
-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114655): https://edk2.groups.io/g/devel/message/114655
Mute This Topic: https://groups.io/mt/104011845/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v5 0/1] MdeModulePkg/AcpiTableDxe: Prefer xDSDT over DSDT when installing tables

2024-01-28 Thread Dhaval Sharma
As per ACPI Spec 6.5+ Table 5-9 if xDSDT is available,
it should be used first. Handle required flow when xDSDT
is absent or present.

Test: Tested on RISCV64 Qemu platform with xDSDT and booted to
linux kernel.

Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Dandan Bi 
Cc: Pedro Falcato 
Cc: devel@edk2.groups.io
Signed-off-by: Dhaval Sharma 
Acked-by: Chasel Chiu 

Notes:
v5:
- If DSDT is not found, throw error and continue to build other tables with
  an error log
v4:
- Fix typos and commit message adding more clarity to patch subject
v3:
- Added description of ACPI spec clarification based on which this patch is 
created
- Optimizing if-else flow
v2:
- Added proper indentation for else if

https://github.com/tianocore/edk2/pull/5311

Dhaval (1):
  MdeModulePkg/AcpiTableDxe: Prefer xDSDT over DSDT when installing
tables

 MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c | 24 
++--
 1 file changed, 17 insertions(+), 7 deletions(-)

-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114654): https://edk2.groups.io/g/devel/message/114654
Mute This Topic: https://groups.io/mt/104011825/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v1] MdePkg/SmBios.h: Add New ProcessorFamily definitions for SMBIOS Type4

2024-01-28 Thread Jason Lou
From: Jason Lou 

The patch adds new ProcessorFamily definitions for SMBIOS Type4 based On
SMBIOS 3.8.0.

Signed-off-by: Jason Lou 
Cc: Zhiguang Liu 
Cc: Dandan Bi 
Cc: Star Zeng 
Cc: Zhichao Gao 
Cc: Benny Lin 
Cc: Gua Guo 
Cc: Michael D Kinney 
Cc: Liming Gao 
---
 MdePkg/Include/IndustryStandard/SmBios.h | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Include/IndustryStandard/SmBios.h 
b/MdePkg/Include/IndustryStandard/SmBios.h
index 56cec615a0..4da68f8bab 100644
--- a/MdePkg/Include/IndustryStandard/SmBios.h
+++ b/MdePkg/Include/IndustryStandard/SmBios.h
@@ -774,7 +774,15 @@ typedef enum {
   ProcessorFamilyQuadCoreLoongson3B  = 0x026E,
   ProcessorFamilyMultiCoreLoongson3B = 0x026F,
   ProcessorFamilyMultiCoreLoongson3C = 0x0270,
-  ProcessorFamilyMultiCoreLoongson3D = 0x0271
+  ProcessorFamilyMultiCoreLoongson3D = 0x0271,
+  ProcessorFamilyIntelCore3  = 0x0300,  ///< SMBIOS spec 3.8.0 updated 
the name
+  ProcessorFamilyIntelCore5  = 0x0301,
+  ProcessorFamilyIntelCore7  = 0x0302,
+  ProcessorFamilyIntelCore9  = 0x0303,
+  ProcessorFamilyIntelCoreUltra3 = 0x0304,
+  ProcessorFamilyIntelCoreUltra5 = 0x0305,
+  ProcessorFamilyIntelCoreUltra7 = 0x0306,
+  ProcessorFamilyIntelCoreUltra9 = 0x0307
 } PROCESSOR_FAMILY2_DATA;
 
 ///
-- 
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114653): https://edk2.groups.io/g/devel/message/114653
Mute This Topic: https://groups.io/mt/104010868/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-