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 A07A874004C for ; Fri, 17 Nov 2023 11:35:32 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=fbfpAqg0MyzDXZpl8bsJGv9HJIxg24rfu30TKLKzNKY=; 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=1700220931; v=1; b=F4CUnhYPOEuUOUMoxC56+FcCo2ElurhLbJDB5hYNBdlruIafWsdeMRUqZUzoCemPmRSVsCrI CCwozjRBp1OYvsopl222fNMfWzCxD/qXdAlU+Ph0XEysUUhprPpo9V0U4A2Hw3JOzizpsV/xTeN N/VexZZlLdxDJQkiXhys7Yfk= X-Received: by 127.0.0.2 with SMTP id N5xbYY7687511xxNzSbWxi2L; Fri, 17 Nov 2023 03:35:31 -0800 X-Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mx.groups.io with SMTP id smtpd.web11.9668.1700220930636750630 for ; Fri, 17 Nov 2023 03:35:30 -0800 X-Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1cc1e1e74beso16761485ad.1 for ; Fri, 17 Nov 2023 03:35:30 -0800 (PST) X-Gm-Message-State: KTDSxuKSmeq34grTSnWt4OGrx7686176AA= X-Google-Smtp-Source: AGHT+IHVrFXGWshiaHTH8dyLkKlbz9rQdV8rIKBI42rLs/UmGOw4oWiwp5M1kH2wKhleDRFbuqx+pQ== X-Received: by 2002:a17:902:dace:b0:1ce:6200:c12 with SMTP id q14-20020a170902dace00b001ce62000c12mr743878plx.44.1700220929802; Fri, 17 Nov 2023 03:35:29 -0800 (PST) X-Received: from dhaval.. ([171.76.84.160]) by smtp.gmail.com with ESMTPSA id k5-20020a170902c40500b001b7f40a8959sm1196441plk.76.2023.11.17.03.35.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 03:35:29 -0800 (PST) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Liming Gao , Zhiguang Liu , Dandan Bi Subject: [edk2-devel] [PATCH v2 1/1] MdeModulePkg: Fix issue with ACPI table creation Date: Fri, 17 Nov 2023 17:05:23 +0530 Message-Id: <20231117113523.44080-2-dhaval@rivosinc.com> In-Reply-To: <20231117113523.44080-1-dhaval@rivosinc.com> References: <20231117113523.44080-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=F4CUnhYP; 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 spec 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 | 13 ++++++++= ++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c b= /MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c index e09bc9b704f5..11097ed4c3be 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c @@ -1892,7 +1892,18 @@ 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=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 + 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 xDSDT\n"));=0D + ASSERT_EFI_ERROR (Status);=0D + break;=0D + }=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 --=20 2.39.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111395): https://edk2.groups.io/g/devel/message/111395 Mute This Topic: https://groups.io/mt/102645488/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-