From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.80]) by mx.groups.io with SMTP id smtpd.web08.916.1659768410893120857 for ; Fri, 05 Aug 2022 23:46:52 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=RjkDCQN5; spf=pass (domain: arm.com, ip: 40.107.6.80, mailfrom: sami.mujawar@arm.com) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=KMM4NmTMVxIPVwskCHmzdm0/l1ZKlu92KY1eheUQYF9tF59BhKE7ENqG6AqbjyxmGKAZcxxQdOmHI3mFGio420HCIYAGnTtSzamGq9FBehKPAoiw2+PTJtZ77GS263vrius6ZfqrwzhN4DT3kihERX/BmdjYLZ9i0DDVH6yurBW1bo8E3Z/OtEz7OSDWl6e3kMuE282fW7mRbdaHgDAD+Cohm37A9EsbxY0ED1VgiuAZ4jIuHZJVIUvTrGr6YWAHD8FNfcb/50M9VDtBMEFDQT6gDH6P5iBaMvLB9HS5irK4Mf5cPFxcm8F56m0VRnxwN1qmNa/lroA1oQvQoeUAVQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wKxpXYH73dOpdjUfL3Ts/rBLQbNvCaVV3Q7FTsceJvo=; b=LgSduyMKsS+r8U1GJ1lTepJujGH9QOjFFKX+toAzCZDxVen4zM9DeMHAgZCu9dx06tQr2sae/3p37q6LjzrrwM7b9C76dbTNPm8Emv3g/WpKlU8IPGI7oGsfWI3CIi3Wz/L4IfdbPJH2NLp+NVVnHP89bECvywu5wRwfrWD/dx5TQ68dFWTj43Do5UPMTWoOYMezmvp7jIfnlKP+SQsQMayYS7MEkvTnebsZ0t/pxAQLroNGodoBqMDgv4VmWpx9cW2XOjytjG1PW7Zt9OgB2qCbpuWjyzKfFhJzhBnE/vvZn0tNc8ID3ie97jRasDAizel5yChMRAbbt7ZfVCuKGQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) 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=wKxpXYH73dOpdjUfL3Ts/rBLQbNvCaVV3Q7FTsceJvo=; b=RjkDCQN5Ku8s83mQfp7MpcI1+kZ3xoTaPZW+XB4fX4naxLdXvVccB3UBUvvG30ota8pWqLYce51BBz48B9pzc6iJnwehu4wrtMxIq0+lUm/MUimkV9oeWzcDS6YeIIbv7Dm5pFqxCEcujFA69O76+6ShEnPpGquY6+2TWJwdvsI= Received: from AM7PR02CA0015.eurprd02.prod.outlook.com (2603:10a6:20b:100::25) by AS4PR08MB7926.eurprd08.prod.outlook.com (2603:10a6:20b:575::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16; Sat, 6 Aug 2022 06:46:48 +0000 Received: from VE1EUR03FT063.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:100:cafe::56) by AM7PR02CA0015.outlook.office365.com (2603:10a6:20b:100::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.17 via Frontend Transport; Sat, 6 Aug 2022 06:46:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT063.mail.protection.outlook.com (10.152.18.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16 via Frontend Transport; Sat, 6 Aug 2022 06:46:47 +0000 Received: ("Tessian outbound 2af316122c7a:v123"); Sat, 06 Aug 2022 06:46:47 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 772e850c1243d6ef X-CR-MTA-TID: 64aa7808 Received: from c42eae7aaffa.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 03A4E0D7-5CFD-4B01-900B-127F624F2450.1; Sat, 06 Aug 2022 06:46:35 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c42eae7aaffa.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Sat, 06 Aug 2022 06:46:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hDQEoxDHDBNUOBh/o401v4Yvld3GH2rq3o4ddDxGLMe8SSh/1QcGpKDL6nI3QSadFUNJtfa1oFFeeVskup9WUoZbWJ/RpvuR4+XzpfQb66Brq+I554aDWBtcmoXGcf+76Z66nxktzS8EbyQ1HbLNmVQd9N275kSyiUrbLx/HsXeeiyN4208d+EzG2+chbqsp5Mr+ANvpzWIrtsFD81JW3Kj7LMwJl33RVLMqEhMi6G59Y5m/M11DLzldrOqi0jUvc/ICd8GPY6kXR5V3g9Zbe0RL2UgT9vPkRbymoDWvyMuuqcwLrFk/jGYNg7Gq+0KwDKnQVAb+2HPwsOezdBx7qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wKxpXYH73dOpdjUfL3Ts/rBLQbNvCaVV3Q7FTsceJvo=; b=aJFDnDJejjhLx3J9aFv3ezsNkA4RfiLkM85MarZMC6853jicrF00YRAbakjMKYdkAXbM007pbZC/GEiv9quIiVXGsRdZk3m3TCyTHzl+brnjYghcfy0fxqBXyWwmWqLV575/8hoyKWlo1kxauxB60zZX50CJNRQtojTng7o6nXV1qEm5b8HT2z8hZKgDKOkqZBxIqjlR8uQsU1Z/GGZpi7C8YxbgJ11uLtIK/+N5PiQqLe73SZi9zWAtWvmuvuU77xLx7m2BoES+uzOwnJyHzbLUlIiB7zjBvPqZkOwPKsWh4Io2yIp9POK4kB92XRwqQebs4MUWLwh63efbfL89/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none 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=wKxpXYH73dOpdjUfL3Ts/rBLQbNvCaVV3Q7FTsceJvo=; b=RjkDCQN5Ku8s83mQfp7MpcI1+kZ3xoTaPZW+XB4fX4naxLdXvVccB3UBUvvG30ota8pWqLYce51BBz48B9pzc6iJnwehu4wrtMxIq0+lUm/MUimkV9oeWzcDS6YeIIbv7Dm5pFqxCEcujFA69O76+6ShEnPpGquY6+2TWJwdvsI= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by VI1PR08MB3198.eurprd08.prod.outlook.com (2603:10a6:803:49::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16; Sat, 6 Aug 2022 06:46:31 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::d562:5a52:f638:7fe9]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::d562:5a52:f638:7fe9%4]) with mapi id 15.20.5504.017; Sat, 6 Aug 2022 06:46:31 +0000 Message-ID: Date: Sat, 6 Aug 2022 07:46:29 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v1] DynamicTablesPkg: Fix using RmrNodeCount unitlitialised To: Edward Pickup , devel@edk2.groups.io Cc: Alexei.Fedorov@arm.com, nd@arm.com, "nd@arm.com" References: <20220804092050.1004518-1-edward.pickup@arm.com> From: "Sami Mujawar" In-Reply-To: <20220804092050.1004518-1-edward.pickup@arm.com> X-ClientProxiedBy: LO4P123CA0206.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a5::13) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 4065552e-e967-40d7-505d-08da77776f11 X-MS-TrafficTypeDiagnostic: VI1PR08MB3198:EE_|VE1EUR03FT063:EE_|AS4PR08MB7926:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: gEGnjkHFKJBtF3uSorI/nUNHzZScRlUKvqkn9EeOSUHo2Pbogou5NQCRoceMu0M1GA4p+XY9FQ+LXI767SfoR5nfmIy/m9BZshqPo2jch1LaanXuCzqjLu1tOMRGyBlBKPsmR3HO/NVeJXryHF1lfNDxe0nbwhYhwfkDpM9tfBAO2L4aylpdIV8tpaA3Hz8TMr7ePTpR4io5aQkS8mr7D9j/ddvxCLxnkIieAtqgxcV1hyJLc6ABneAsDdUOoA922D8FvLIbTh6hgsdQA+UXHr84QGbgmjC4JqH/pArA771QcqxWxTu9dvJBdk6AGv/iGVfhZ4wzp8NFyoNssLcsZc9tvK+lb6uQL14j9XQ2sF9GPNpU++Kq8nXUD0zIpynR+ZE7kb7ZBJbinNa1G73MnzLUOgnQBdo908rs7n+4VFf61RtI6oO1JJJIgcvxHW9RUwv7hIycA/FftocHAQ9nmR+vKI4WrlTjv5RzTu8EDBi0UY1wV0Crz1TyRas9TVrZM1iJWlwuMh9SWhpFExYRlQNpzAnDa+Z1+oBWoZX1I7ljDJ5Ru7nXSxm+yiVhrSS20FFj/vEi62rk4gnLmSIOZv2DTeBkHvhZARUzajuXnRW8xyu3iV2XH0qFedh2jKyHSoHdbW+soHVAqdlrvHrKFASc7zRd6nrSkkrSQuwDO3VZ7YWMhBijMo7pSIOvrb10W7tnTtpxsRF74dUrTxmObkbUAafPpxbQe9lA85BfUFg3lYYsBRpIa/i6Jt2M8z4jABfFHraCGhpAtstmAn/hkDw58yRgfm09p9II7m8DIvXpy1BG4JHkIY+Fq+KuV4YgOdAEf/XsVzUBMvJdg4ljRwg8q3blWDM9i+FDOfRFtf8= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(346002)(39860400002)(396003)(136003)(366004)(376002)(5660300002)(6486002)(966005)(44832011)(38100700002)(8936002)(6512007)(186003)(26005)(53546011)(6506007)(2616005)(86362001)(478600001)(2906002)(31696002)(41300700001)(83380400001)(66946007)(31686004)(66476007)(66556008)(4326008)(8676002)(316002)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3198 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3359d616-ed47-4631-34d4-08da777764ce X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EcFQbEJou6ahUB1GZbGsbdueSZvPqEoYaVevTZ5FN9H/FirHnz9Q/Ar1d1bVY9fhFHEnnTDeLw4BxMqX0uJxIZLNBE5vhiDxa2lSMrady0lK3kfqU8O5PhGqeviuE4erhbSOooqRbSdF69/lJA3SWnFUyGhUyJt3lck4wSAiRkzAT69zcOcw5AZIyzwJAJw0L4esvJSgEnaVBI7Ckc0iuAKp1KftocjpH3MGGykPgO1DFtG9QcO0miT7qJuV/5SeKTTJBUElByfBQKIMbHpPKxn4BWyx+HME+quthpcZtPItvXLjkG7cL1ly4t3A2jszTc00VPlFPGXjlWSVxjRbHXuXRAoUVVIB4KA6YfHbwqQ2o6+DbO/CCa4RR+Vg/J9MX1k7qdmWfJRjywL2gq2r9WU+waym2kMMkvcu4eflOsdLxrFh6Kv3dny3GWWM/HwIkLjrWahouTTyu5Ot6MsCLx5EJUROuxBYEXBxUCmGG1UrzzDB4srPePFb0/QtGYoh8jh3Fi/kox0xNXzsoY35qnZCloAualSyk0R2B1/NEkclha9O6/dt6w5Rm5LrfSrXqaNmB0r+Psp/Q7eIatR71H8vY1YoXKZIaVzKDAtytRuIppEPw92kbQhyi3veRVANWFUtr0zpgiX7bflrTQB3Mj2UhNfKN8h031zpLIThcs0CikwWHsDymrh5XjunmpyzWfQTy6t4Hh4MO3NweplMePKGV6I3fnfzYLdoH3vMJrkfvxvcyaNDzn8Wyxfr+nRTog/v7Wj4fmQ78mRyhCRSMTQm7C0Ur9/SZYT0sM2H8PuGCX3n730iW8IT01ojgUxx7XPt34NKzq8dVqA0GV1NksoQQ2h+8jxdJmxIHBASReWzh+0haxov2B0oeUGGkpy0 X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230016)(4636009)(346002)(396003)(376002)(136003)(39860400002)(36840700001)(40470700004)(46966006)(2906002)(2616005)(44832011)(70586007)(83380400001)(966005)(6486002)(70206006)(36860700001)(478600001)(316002)(47076005)(40460700003)(41300700001)(336012)(5660300002)(186003)(40480700001)(6506007)(26005)(31696002)(356005)(82740400003)(31686004)(53546011)(81166007)(36756003)(86362001)(8676002)(8936002)(4326008)(82310400005)(6512007)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2022 06:46:47.3472 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4065552e-e967-40d7-505d-08da77776f11 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7926 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Edward, Thank you for this patch. This fix looks good to me. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 04/08/2022 10:20 am, Edward Pickup wrote: > Fix using RmrNodeCount uninitliased by initliasing it to zero. Also, add > an additional check for ACPI version. This fixes a crash running on > kvmtool. > > Signed-off-by: Edward Pickup > --- > > Change can be seen at https://github.com/edpickup/edk2/tree/2322_rmrnodecount_uninitialised_v1 > > DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c > index 40d99162cc610de2d0c2f0a5fff6e457c08d07fb..f28973c1a8620aa5b756e85af1b46ebfaf018839 100644 > --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c > +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c > @@ -2107,6 +2107,8 @@ BuildIortTable ( > ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID); > > ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature); > > > > + RmrNodeCount = 0; > > + > > if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) || > > (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) > > { > > @@ -2714,7 +2716,10 @@ BuildIortTable ( > } > > } > > > > - if (RmrNodeCount > 0) { > > + if ((AcpiTableInfo->AcpiTableRevision >= > > + EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05) && > > + (RmrNodeCount > 0)) > > + { > > Status = AddRmrNodes ( > > This, > > CfgMgrProtocol, >