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 2D28C740039 for ; Wed, 29 Nov 2023 07:34:35 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=gk8tEi2SRyqkcYrdCzbXUC5rMoii3XWNtxGUqRLx0Bo=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1701243273; v=1; b=Zz0je+1n4rEbxBAtJNAOpDkHGvuE4Ici3mlsi9BJMYWpdlzYLXfMkXJfaFrQrnQMgjXnsKvP Cli8U8Lz87v4dk9ytqT0p/1mPlagEO91ge9YBmFH1JuIwl2HhBPsROWHgpXBEG7UM1tiRDLqW3q peIY3y1wVwGQbJfDW1oMISvw= X-Received: by 127.0.0.2 with SMTP id 9BDwYY7687511x2ZGbCoXfDg; Tue, 28 Nov 2023 23:34:33 -0800 X-Received: from mail-vk1-f177.google.com (mail-vk1-f177.google.com [209.85.221.177]) by mx.groups.io with SMTP id smtpd.web10.26295.1701243272748194095 for ; Tue, 28 Nov 2023 23:34:32 -0800 X-Received: by mail-vk1-f177.google.com with SMTP id 71dfb90a1353d-4afe5fc8ad7so1415525e0c.3 for ; Tue, 28 Nov 2023 23:34:32 -0800 (PST) X-Gm-Message-State: k8OM9q9MfvYCv7PUxlr6omfVx7686176AA= X-Google-Smtp-Source: AGHT+IH6IyDzn+0xrtXwWOacntMQmYr7RUSWcIt3dKMhiCmLnVg4Zf1S+TWBBDRIc3JuofI4zF3VNx6UeLBsKjPPtcs= X-Received: by 2002:a1f:7347:0:b0:4a8:fcf8:9c77 with SMTP id o68-20020a1f7347000000b004a8fcf89c77mr8693006vkc.6.1701243270992; Tue, 28 Nov 2023 23:34:30 -0800 (PST) MIME-Version: 1.0 References: <20231120042429.860029-1-dhaval@rivosinc.com> <20231120042429.860029-2-dhaval@rivosinc.com> In-Reply-To: <20231120042429.860029-2-dhaval@rivosinc.com> From: "Pedro Falcato" Date: Wed, 29 Nov 2023 07:34:19 +0000 Message-ID: Subject: Re: [edk2-devel] [PATCH v3 1/1] MdeModulePkg: Fix issue with ACPI table creation To: devel@edk2.groups.io, dhaval@rivosinc.com Cc: Liming Gao , Zhiguang Liu , Dandan Bi , Gerd Hoffmann 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,pedro.falcato@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" 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=Zz0je+1n; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=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 On Mon, Nov 20, 2023 at 4:24=E2=80=AFAM Dhaval Sharma = wrote: > > As per ACPI Spec 6.5+ Table 5-9 if xDSDT is avaialble, nit: available > it should be used first. Handle required flow when xDSDT > is abscent or present. nit: absent Separate nit: Please update the patch's subject to something more descriptive. "Fix issue with ..." is really generic and useless for anyone reading the log/blame. Maybe something like "MdeModulePkg/AcpiTableDxe: Prefer xDSDT over DSDT when installing tables"? > > 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 ( > } > } > > - if (((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)ChildTable)->D= sdt !=3D 0) { > + // > + // First check if xDSDT is available that is preferred as per nit: available, as that is preferred... > + // ACPI Spec 6.5+ Table 5-9 X_DSDT definition > + // > + if (((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)ChildTable)->X= Dsdt !=3D 0) { > + TableToInstall =3D (VOID *)(UINTN)((EFI_ACPI_3_0_FIXED_ACPI_DE= SCRIPTION_TABLE *)ChildTable)->XDsdt; (+CC Gerd for qemu) Is it possible that XDsdt may come filled out with a > 32-bit address on 32-bit platforms/builds? In other words, is truncation of the address a problem here? Assuming all of these tables are coming from qemu + OvmfPkg/AcpiPlatformDxe, that is. I would not expect real platforms to ever do such a thing. For what it's worth, I checked the spec, and it clearly mentions that the *OSPM* must ignore DSDT over X_DSDT. But we're not OSPM, so we're not exactly bound by their constraints. --=20 Pedro -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111837): https://edk2.groups.io/g/devel/message/111837 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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-