From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 2CE2D78003C for ; Mon, 20 Nov 2023 04:24:38 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=8XLkv0R4C55pmjXvK2P3kVNGvrh0bbsIIQet5KvsyD8=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1700454276; v=1; b=dMd7N7xms/vsQJyQsxUoDF4honZvsp9lx96/z2lJ2l5uWKhAdgSSsvAdNkQBFo/UjtnQCxRv 8n/AZ2npphF7QrZWDlzPCn/ikEvyxHh1nDIQ2jG+cL7nWMRjPtTea//tv/0asL+OyKTQD2T2vC2 d0Ed9W+GzAwNmxECNnmpJ22I= X-Received: by 127.0.0.2 with SMTP id 9Qu6YY7687511xjKAYxWL92V; Sun, 19 Nov 2023 20:24:36 -0800 X-Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mx.groups.io with SMTP id smtpd.web11.44036.1700454276344329895 for ; Sun, 19 Nov 2023 20:24:36 -0800 X-Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1cc1ee2d8dfso35258885ad.3 for ; Sun, 19 Nov 2023 20:24:36 -0800 (PST) X-Gm-Message-State: qsnv8Tjtt9JnQxuUKQkyPyYnx7686176AA= X-Google-Smtp-Source: AGHT+IEs36NR1UgAmNzsY+k6Rfj3IYKXZXaU2kBG9CSEVFwZHfJz8GntBxvu2WbKiYpedEtaDDfXxg== X-Received: by 2002:a17:902:6a8b:b0:1cc:43af:f568 with SMTP id n11-20020a1709026a8b00b001cc43aff568mr6611450plk.6.1700454275591; Sun, 19 Nov 2023 20:24:35 -0800 (PST) X-Received: from dhaval.blr.rivosinc.com ([49.249.129.34]) by smtp.gmail.com with ESMTPSA id h18-20020a170902f7d200b001cf5d425244sm1144451plw.298.2023.11.19.20.24.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 20:24:35 -0800 (PST) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Liming Gao , Zhiguang Liu , Dandan Bi Subject: [edk2-devel] [PATCH v3 1/1] MdeModulePkg: Fix issue with ACPI table creation Date: Mon, 20 Nov 2023 09:54:29 +0530 Message-Id: <20231120042429.860029-2-dhaval@rivosinc.com> In-Reply-To: <20231120042429.860029-1-dhaval@rivosinc.com> References: <20231120042429.860029-1-dhaval@rivosinc.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,dhaval@rivosinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=dMd7N7xm; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io As per ACPI Spec 6.5+ Table 5-9 if xDSDT is avaialble, it should be used first. Handle required flow when xDSDT is abscent or present. Test: Tested on RISCV64 Qemu platform with xDSDT and booted to linux kernel. Cc: Liming Gao Cc: Zhiguang Liu Cc: Dandan Bi Signed-off-by: Dhaval Sharma --- Notes: v2: - Added proper indentation for else if MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c | 22 ++++++++= +++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c b= /MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c index e09bc9b704f5..ead8376177c9 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c @@ -1892,14 +1892,22 @@ InstallAcpiTableFromHob ( }=0D }=0D =0D - if (((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)ChildTable)->Dsd= t !=3D 0) {=0D + //=0D + // First check if xDSDT is available that is preferred as per=0D + // ACPI Spec 6.5+ Table 5-9 X_DSDT definition=0D + //=0D + if (((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)ChildTable)->XDs= dt !=3D 0) {=0D + TableToInstall =3D (VOID *)(UINTN)((EFI_ACPI_3_0_FIXED_ACPI_DESC= RIPTION_TABLE *)ChildTable)->XDsdt;=0D + } else if (((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)ChildTabl= e)->Dsdt !=3D 0) {=0D TableToInstall =3D (VOID *)(UINTN)((EFI_ACPI_3_0_FIXED_ACPI_DESC= RIPTION_TABLE *)ChildTable)->Dsdt;=0D - Status =3D AddTableToList (AcpiTableInstance, TableToIns= tall, TRUE, Version, TRUE, &TableKey);=0D - if (EFI_ERROR (Status)) {=0D - DEBUG ((DEBUG_ERROR, "InstallAcpiTableFromHob: Fail to add ACP= I table DSDT\n"));=0D - ASSERT_EFI_ERROR (Status);=0D - break;=0D - }=0D + } else {=0D + break;=0D + }=0D + Status =3D AddTableToList (AcpiTableInstance, TableToInstall, TRUE= , Version, TRUE, &TableKey);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "InstallAcpiTableFromHob: Fail to add ACPI = table DSDT\n"));=0D + ASSERT_EFI_ERROR (Status);=0D + break;=0D }=0D }=0D }=0D --=20 2.39.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111451): https://edk2.groups.io/g/devel/message/111451 Mute This Topic: https://groups.io/mt/102702109/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-