From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 13CEAAC0BE3 for ; Mon, 22 Apr 2024 14:04:13 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=kLw5Cg/nKo4qHCmGn3sIYj+Vhgx+Y8tXTsIJlIaMndA=; c=relaxed/simple; d=groups.io; h=Received-SPF:From:To:CC:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20240206; t=1713794652; v=1; b=ygGA3SkYfmrWgtB6tLsgRp/bGboBgXtERJ59y4YuYrflU5R7q5L/6bc9CtM44QXkvgIePgpC +3pMtKmjEo0bYE6pZeTR9Uogf3zTAF1sUJ9eFaNP5b9VKEfMpw6em8DGnrCg1QL+Mb7f8jV6MIU iLzAFp+k7H/deuLrD3dMHRmBt98H+OEJ23MQxh0ob1rlLNA5tuYpLfQpvhEdG1Z1WQnsiZ8wqvI 52Mk6Ceqe7XRBLWr4QpQc7cS/1cQoMKHTa9wLWW1QV1UaX4DqhNv3xuFbXCQ2T2eknd2XYWk4HD Cb6eH0/fj8caGLNftw2GmBrXBKQAAx2AZ58aAOnnZ1kUg== X-Received: by 127.0.0.2 with SMTP id kkSTYY7687511xseNAZJj867; Mon, 22 Apr 2024 07:04:12 -0700 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.80]) by mx.groups.io with SMTP id smtpd.web10.19310.1713794651728551774 for ; Mon, 22 Apr 2024 07:04:11 -0700 X-Received: from SJ0PR03CA0199.namprd03.prod.outlook.com (2603:10b6:a03:2ef::24) by PH7PR12MB7454.namprd12.prod.outlook.com (2603:10b6:510:20d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Mon, 22 Apr 2024 14:04:07 +0000 X-Received: from DS2PEPF00003439.namprd02.prod.outlook.com (2603:10b6:a03:2ef:cafe::63) by SJ0PR03CA0199.outlook.office365.com (2603:10b6:a03:2ef::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.33 via Frontend Transport; Mon, 22 Apr 2024 14:04:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C X-Received: from SATLEXMB03.amd.com (165.204.84.17) by DS2PEPF00003439.mail.protection.outlook.com (10.167.18.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7519.19 via Frontend Transport; Mon, 22 Apr 2024 14:04:05 +0000 X-Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 22 Apr 2024 09:04:03 -0500 X-Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 22 Apr 2024 07:04:03 -0700 X-Received: from BLR-LAB-SFW01.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 22 Apr 2024 09:04:01 -0500 From: "Abdul Lateef Attar via groups.io" To: CC: Abdul Lateef Attar , Chasel Chiu , Nate DeSimone , Liming Gao , Eric Dong Subject: [edk2-devel] [PATCH v1] MinPlatformPkg/Test: Fix DumpAcpiMadt infinite loop Date: Mon, 22 Apr 2024 19:33:53 +0530 Message-ID: <2c10c7f9d2f548cf05cb23639dffe7c6576412ac.1713794592.git.AbdulLateef.Attar@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003439:EE_|PH7PR12MB7454:EE_ X-MS-Office365-Filtering-Correlation-Id: e4660734-9d02-4c15-e80a-08dc62d51297 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?+Uf3umZtPLv3GEngeMFnLm2mt3jtj6onZz3qUXZ4YNf6ftmaZrVOVNEyZmOd?= =?us-ascii?Q?N0TF0o0Mfbuwc0HqlVPcKRyLUHub60cPz56BLyh4v9VYZrcyebat3kDJyN1U?= =?us-ascii?Q?klN4W7IfZO4E79Tw8zr6wCeDvkIuZQWhHmC4qRWJV+AFXvQLq5J7KO64mBMk?= =?us-ascii?Q?7gTHqyrWz7NFEU8jiH27Fuu3iwnwsHIfvfJYXpUJSOcvsnho46wSflSJ7GBk?= =?us-ascii?Q?HFKPbaaTM2qktrnTfjENtyVIllC4hdGEhSXBkSvrz7RsdIJtC02yavIb1BKr?= =?us-ascii?Q?ftjAxd60jmWFZODbyRh6w8Ok6QVmoq29YYQHJ419hxtz6EZJrF8eq42N6ybW?= =?us-ascii?Q?d94vcPNh0Jn8p2OX+B0PgZ8EfsLI/lrhci//Wt5EYmMCTKzJjLCd8fUaVpWC?= =?us-ascii?Q?FwCt6apbX/ogGhTfY+RV4LdaUK+UDMYMUUFb3UTXclmQ9r7pOescUwIRvuAy?= =?us-ascii?Q?h3TFvNLMFcCz+VfS2YuXiHa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us-ascii?Q?WKmw3BEbs5KQyfQ+9C7JFsEVhc27?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2024 14:04:05.6769 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e4660734-9d02-4c15-e80a-08dc62d51297 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF00003439.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7454 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 Resent-Date: Mon, 22 Apr 2024 07:04:11 -0700 Resent-From: AbdulLateef.Attar@amd.com Reply-To: devel@edk2.groups.io,AbdulLateef.Attar@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 2mRTISFdS9w6e1Fknett1X45x7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=ygGA3SkY; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Update the MadtLen varaible before the next record is read, to void infinite loop. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong Signed-off-by: Abdul Lateef Attar --- .../Test/Library/TestPointCheckLib/DxeCheckAcpiMadt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/D= xeCheckAcpiMadt.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointChe= ckLib/DxeCheckAcpiMadt.c index 7e29b47a0b..04cc6f963a 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= AcpiMadt.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= AcpiMadt.c @@ -1,6 +1,7 @@ /** @file =20 Copyright (c) 2017, Intel Corporation. All rights reserved.
+Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -235,8 +236,9 @@ DumpAcpiMadt ( DEBUG ((DEBUG_INFO, "\n")); break; } - ApicStructHeader =3D (APIC_STRUCT_HEADER *)((UINT8 *)ApicStructHeader = + ApicStructHeader->Length); + // Update MadtLen first to avoid the dead loop and system hang MadtLen -=3D ApicStructHeader->Length; + ApicStructHeader =3D (APIC_STRUCT_HEADER *)((UINT8 *)ApicStructHeader = + ApicStructHeader->Length); } } =20 @@ -324,8 +326,9 @@ CheckAcpiMadt ( default: break; } - ApicStructHeader =3D (APIC_STRUCT_HEADER *)((UINT8 *)ApicStructHeader = + ApicStructHeader->Length); + // Update MadtLen first to avoid the dead loop and system hang MadtLen -=3D ApicStructHeader->Length; + ApicStructHeader =3D (APIC_STRUCT_HEADER *)((UINT8 *)ApicStructHeader = + ApicStructHeader->Length); } return EFI_SUCCESS; } \ No newline at end of file --=20 2.34.1 -=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 (#118095): https://edk2.groups.io/g/devel/message/118095 Mute This Topic: https://groups.io/mt/105669987/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-