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 BA355D811BC for ; Mon, 11 Mar 2024 14:16:09 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=i3OYz9aMKLzgQ7PWCUsCtH5i7JqyNa9CQgl0tXpTpwU=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:From:Subject:To:Cc:References:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1710166568; v=1; b=C+UxAIko9lM3fVQqXVB4uuj5XQk0YwrjEszt3Wt0J1pu+7lqqJhGf/2t7mwBxEo3o8QWyc01 94jO7KIF0xkbwMbO7hczvnzI751vidoaOe+lW7MKXfBnLc/eZgwPpLGasUApeFJCghzHDHml+Vu UcBZ+XENGbKOWtYIqIUJDObxb3XnAKLbum4htm8qciakdPDT0p+ja0fZPCS83htW5qZaugQAd7C b+6iUg0SarpMkV7CTq4+eE9vP6jVTeNMJI1YTpuKbws9t5IIWOk4NbgwR8cfrNsWzH9IYTFP/KS zYHEtDcsei32BRvsVGaV3rJRaxpiV0kzbnuFJVrS3TjFQ== X-Received: by 127.0.0.2 with SMTP id HixYYY7687511xp615Lccfli; Mon, 11 Mar 2024 07:16:08 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.63865.1710166567708828604 for ; Mon, 11 Mar 2024 07:16:07 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 28F55FEC; Mon, 11 Mar 2024 07:16:44 -0700 (PDT) X-Received: from [10.34.100.133] (e126645.nice.arm.com [10.34.100.133]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8AE313F762; Mon, 11 Mar 2024 07:16:06 -0700 (PDT) Message-ID: Date: Mon, 11 Mar 2024 07:16:07 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: "PierreGondois" Subject: Re: [edk2-devel] [PATCH v2 3/4] DynamicTablesPkg: Adds ACPI WSMT Table generator To: Abdul Lateef Attar , devel@edk2.groups.io Cc: Abdul Lateef Attar , Sami Mujawar References: <9f0314d4ca44d8c1302866ad6ba03ffeb3c788fa.1709566848.git.AbdulLateef.Attar@amd.com> In-Reply-To: <9f0314d4ca44d8c1302866ad6ba03ffeb3c788fa.1709566848.git.AbdulLateef.Attar@amd.com> 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,pierre.gondois@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: La3K7JmxcPquaiFkMPQgvEYex7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=C+UxAIko; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none) Hello Abdul, On 3/4/24 16:43, Abdul Lateef Attar wrote: > From: Abdul Lateef Attar >=20 > Adds generic ACPI WSMT table generator library. > Register/Deregister WSMT table. > Update the WSMT table during boot as per specification. >=20 > Cc: Sami Mujawar > Cc: Pierre Gondois > Signed-off-by: Abdul Lateef Attar > --- > DynamicTablesPkg/DynamicTables.dsc.inc | 2 + > DynamicTablesPkg/Include/AcpiTableGenerator.h | 1 + > .../Include/ArchNameSpaceObjects.h | 10 + > .../Library/Acpi/AcpiWsmtLib/AcpiWsmtLib.inf | 30 +++ > .../Library/Acpi/AcpiWsmtLib/WsmtGenerator.c | 230 ++++++++++++++++++ > 5 files changed, 273 insertions(+) > create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/AcpiWsmtLi= b.inf > create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/WsmtGenera= tor.c >=20 [snip] > +STATIC > +EFI_STATUS > +BuildWsmtTable ( > + 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= , > + OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table > + ) > +{ > + EFI_STATUS Status; > + CM_ARCH_WSMT_PROTECTION_FLAGS *ProtectionFlags; > + > + ASSERT (This !=3D NULL); > + ASSERT (AcpiTableInfo !=3D NULL); > + ASSERT (CfgMgrProtocol !=3D NULL); > + ASSERT (Table !=3D NULL); > + ASSERT (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID); > + ASSERT (AcpiTableInfo->AcpiTableSignature =3D=3D This->AcpiTableSignat= ure); > + > + if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) || > + (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) > + { > + DEBUG (( > + DEBUG_ERROR, > + "ERROR: WSMT: Requested table revision =3D %d, is not supported." > + "Supported table revision: Minimum =3D %d, Maximum =3D %d\n", > + AcpiTableInfo->AcpiTableRevision, > + This->MinAcpiTableRevision, > + This->AcpiTableRevision > + )); > + return EFI_INVALID_PARAMETER; > + } > + > + *Table =3D NULL; > + > + Status =3D AddAcpiHeader ( > + CfgMgrProtocol, > + This, > + (EFI_ACPI_DESCRIPTION_HEADER *)&mAcpiWsmt, > + AcpiTableInfo, > + sizeof (EFI_ACPI_WSMT_TABLE) > + ); > + if (EFI_ERROR (Status)) { > + DEBUG (( > + DEBUG_ERROR, > + "ERROR: WSMT: Failed to add ACPI header. Status =3D %r\n", > + Status > + )); > + return Status; > + } > + > + Status =3D GetEArchObjWsmtProtectionFlags ( > + CfgMgrProtocol, > + CM_NULL_TOKEN, > + &ProtectionFlags, > + NULL > + ); > + if (EFI_ERROR (Status)) { > + DEBUG (( > + DEBUG_ERROR, > + "ERROR: WSMT: Failed to get protection flags information." \ > + " Status =3D %r\n", > + Status > + )); > + } else { > + mAcpiWsmt.ProtectionFlags =3D ProtectionFlags->ProtectionFlags; > + } It seems that EFI_WSMT_PROTECTION_FLAGS_COMM_BUFFER_NESTED_PTR_PROTECTION bit can only be set if EFI_WSMT_PROTECTION_FLAGS_FIXED_COMM_BUFFERS is set. Maybe this should be checked here. > + > + *Table =3D (EFI_ACPI_DESCRIPTION_HEADER *)&mAcpiWsmt; > + > + return Status; > +} > + Regards, Pierre -=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 (#116633): https://edk2.groups.io/g/devel/message/116633 Mute This Topic: https://groups.io/mt/104724520/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-