From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=Urqaa7w0; spf=pass (domain: arm.com, ip: 40.107.7.47, mailfrom: krzysztof.koch@arm.com) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.47]) by groups.io with SMTP; Wed, 15 May 2019 01:20:39 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IPbSeftDw+IdJ+oNinPS9ZXr9gJNqdQBQsV0YB0irnw=; b=Urqaa7w014uwd1mKT5F/9WhbbD3XQBYdLzDLib6y3jn+twfky9irAjPlpAJjz9f68oeNBJbYN6Xrtd/YAnaO2oREujVhWTdXoO8fqfFNcaR42q9rTHlMh8k4K2VJfppzZxXauCYKnPZfrST0t4rX8q/2taZczYB9Wsjvq58qwVY= Received: from VE1PR08MB4783.eurprd08.prod.outlook.com (10.255.114.16) by VE1PR08MB4640.eurprd08.prod.outlook.com (10.255.27.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1900.16; Wed, 15 May 2019 08:20:35 +0000 Received: from VE1PR08MB4783.eurprd08.prod.outlook.com ([fe80::eda0:d207:467d:4f00]) by VE1PR08MB4783.eurprd08.prod.outlook.com ([fe80::eda0:d207:467d:4f00%3]) with mapi id 15.20.1900.010; Wed, 15 May 2019 08:20:35 +0000 From: "Krzysztof Koch" To: "devel@edk2.groups.io" , "jaben.carsey@intel.com" , "ray.ni@intel.com" CC: nd , Sami Mujawar Subject: Re: [PATCH v1 1/1] ShellPkg: acpiview: Add GT Frame Number validation to GTDT parser Thread-Topic: [PATCH v1 1/1] ShellPkg: acpiview: Add GT Frame Number validation to GTDT parser Thread-Index: AQHVBaQmD3F4MuRkn0a78tmZNanT/qZiy91QgAkWM7A= Date: Wed, 15 May 2019 08:20:34 +0000 Message-ID: References: <20190508134408.23096-1-krzysztof.koch@arm.com> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Krzysztof.Koch@arm.com; x-originating-ip: [217.140.106.49] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b7c14a69-2bfb-432a-3de5-08d6d90e345b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:VE1PR08MB4640; x-ms-traffictypediagnostic: VE1PR08MB4640: x-ms-exchange-purlcount: 1 nodisclaimer: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0038DE95A2 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(136003)(376002)(396003)(366004)(346002)(13464003)(189003)(199004)(53546011)(81166006)(81156014)(8676002)(8936002)(6506007)(64756008)(66556008)(7696005)(74316002)(54906003)(316002)(76176011)(3846002)(305945005)(7736002)(33656002)(2501003)(102836004)(2906002)(99286004)(6116002)(229853002)(256004)(14444005)(110136005)(6436002)(9686003)(72206003)(66476007)(55016002)(52536014)(5660300002)(66066001)(71190400001)(68736007)(66446008)(71200400001)(26005)(2201001)(186003)(4326008)(53936002)(86362001)(6246003)(476003)(478600001)(14454004)(25786009)(966005)(66946007)(11346002)(486006)(446003)(76116006)(73956011)(6306002);DIR:OUT;SFP:1101;SCL:1;SRVR:VE1PR08MB4640;H:VE1PR08MB4783.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: h+SlHQ+ooUM0UI6oGLLyOdgy5SYHwRHyZ+bspNrRZ2U4cZ1h9PiOW0bC/7sfoor2lKfXXyi9UhFKd+Iqh829lKXyPDu0sCu9n0zaE55LjNUckwM7+j+r+l7mJ1rx52oJRVNUe3a9oZIuXKCLTPjoGeGCNFQbi2TXlDpVDoahZvPxadI+vf63olt0C1CdsapZkjOVYOuz7DL0UCvOFn+8zRa2eNtjP1fQHzxrj+Gb7kL78lDPU2At77mU9ZMpeOx8JqqViTW9sH6Y4KSdPNTmtPNtUUAOuC75fEtxEH4hGjIyHsTuvuk9dbo/nHMlTD5gwTnF7c4U43cZBCI7EWXlWbighJPpjMEsW4DbuOMk44aeawSLL8F2V1cYvM+HNm0S4LnPr1brC4Y0dNEZvsfQmQcaUvqOjHGcmbtPsO+T8y0= MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: b7c14a69-2bfb-432a-3de5-08d6d90e345b X-MS-Exchange-CrossTenant-originalarrivaltime: 15 May 2019 08:20:34.9487 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4640 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Jaben and Ray, Is there anything I can do to help get this patch merged? Kind regards, Krzysztof Koch -----Original Message----- From: Sami Mujawar =20 Sent: Thursday, May 9, 2019 14:37 To: devel@edk2.groups.io Cc: jaben.carsey@intel.com; ray.ni@intel.com; Krzysztof Koch ; nd Subject: RE: [PATCH v1 1/1] ShellPkg: acpiview: Add GT Frame Number validat= ion to GTDT parser Reviewed-by: Sami Mujawar Regards, Sami Mujawar -----Original Message----- From: Krzysztof Koch =20 Sent: 08 May 2019 02:44 PM To: devel@edk2.groups.io Cc: jaben.carsey@intel.com; ray.ni@intel.com; Sami Mujawar ; Girish Pathak ; Pierre Gondois ; Matteo Carlini ; Stephanie Hughes-Fitt= ; nd Subject: [PATCH v1 1/1] ShellPkg: acpiview: Add GT Frame Number validation = to GTDT parser The ACPI 6.2 specification mandates that the Generic Timer (GT) Block Timer= Structures must have a frame number in the range 0-7. Update the GTDT parser to warn if this condition is violated. Signed-off-by: Krzysztof Koch --- The changes can be seen at: https://github.com/KrzysztofKoch1/edk2/tree/woa= _528_acpiview_gt_frame_validate_v1 Notes: v1: - Add GTDT Frame Number checks [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c | 4= 7 +++++++++++++++++++- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/Gtdt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtPa= rser.c index f31c4a2761751c58d4b1d3eb75084e24ec318e7f..572e52385c54932b14630481e85= a67d0b211966a 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.= c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtPars +++ er.c @@ -1,7 +1,7 @@ /** @file GTDT table parser =20 - Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2019, ARM Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -38,6 +38,21 @@ ValidateGtBlockTimerCount ( IN VOID* Context ); =20 +/** + This function validates the GT Frame Number. + + @param [in] Ptr Pointer to the start of the field data. + @param [in] Context Pointer to context specific information e.g. this + could be a pointer to the ACPI table header. +**/ +STATIC +VOID +EFIAPI +ValidateGtFrameNumber ( + IN UINT8* Ptr, + IN VOID* Context + ); + /** An ACPI_PARSER array describing the ACPI GTDT Table. **/ @@ -92,7 +107,7 @@ STATIC CONST ACPI_PARSER GtBlockParser[] =3D { An ACPI_PARSER array describing the GT Block timer. **/ STATIC CONST ACPI_PARSER GtBlockTimerParser[] =3D { - {L"Frame Number", 1, 0, L"%d", NULL, NULL, NULL, NULL}, + {L"Frame Number", 1, 0, L"%d", NULL, NULL, ValidateGtFrameNumber,=20 + NULL}, {L"Reserved", 3, 1, L"%x %x %x", Dump3Chars, NULL, NULL, NULL}, {L"Physical address (CntBaseX)", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL}= , {L"Physical address (CntEL0BaseX)", 8, 12, L"0x%lx", NULL, NULL, NULL, @= @ -145,6 +160,34 @@ ValidateGtBlockTimerCount ( } } =20 +/** + This function validates the GT Frame Number. + + @param [in] Ptr Pointer to the start of the field data. + @param [in] Context Pointer to context specific information e.g. this + could be a pointer to the ACPI table header. +**/ +STATIC +VOID +EFIAPI +ValidateGtFrameNumber ( + IN UINT8* Ptr, + IN VOID* Context + ) +{ + UINT32 FrameNumber; + + FrameNumber =3D *(UINT8*)Ptr; + + if (FrameNumber > 7) { + IncrementErrorCount (); + Print ( + L"\nERROR: GT Frame Number =3D %d. GT Frame Number must be in range = 0-7.", + FrameNumber + ); + } +} + /** This function parses the Platform GT Block. =20 -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'