From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web08.1159.1626507740913713371 for ; Sat, 17 Jul 2021 00:42:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=iT3OCoeK; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: rangasai.v.chaganty@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10047"; a="210818123" X-IronPort-AV: E=Sophos;i="5.84,247,1620716400"; d="scan'208";a="210818123" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2021 00:42:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,247,1620716400"; d="scan'208";a="656994098" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by fmsmga005.fm.intel.com with ESMTP; 17 Jul 2021 00:42:19 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Sat, 17 Jul 2021 00:42:18 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Sat, 17 Jul 2021 00:42:18 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.175) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Sat, 17 Jul 2021 00:42:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IAkCB5l8gcKtAU2TYbnXjTvjdhX4bOxigTRi1K5hD6h7hVMSTbGeeVodQKqXssK0I/Y3k9cmMlDVLPyBkT1/ZLMC8aqoXbb+oPK2Wal1hwwDADrjS0v3eLnIuuVLquCaBjvq06sKMfq06zFO75ir+uEmKXfl2M4IyUd6B+S76pW+yTbbt9Axrou/8+73wGa2fejRMJz6/4Q2etBTm4oYBWmjWv8El58zOKBPpYFecys3HuuV6CZeoIVo8AswOtlJ5vKyRYCqSfPnAjIVaLM4J48P2blrgYGtCS4zNPTm5yQ+IlQUN3bccq2nc/fLKkZz62IO7wTcmIjySpY5EytYhQ== 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-SenderADCheck; bh=HlVr1odvt9RU/3SU9RXgpzqzn8MfprRZbqHvKrDlpak=; b=YyGnDV1wsQmFhdrXFZBqLTRtIGbz/3EK2lxj6nN1+gMV+RYFF3lATZJpEn/ORrH59h2Eyh1/Wbn1HcYIQQfvDsMx68Z0J5yAfMqjzuNEHjdiZ8g5E49P6ViQ2643aIxAxDPWzirzqGckWHogmXtGVtyRma0uRqh7iNDkpAAQ/kqXdM6R72bwk87sfrtbtm2ZTbkbC9QKTXC3n13p5V14NyLdNLM6t7HXQr3msjeJb/r6vY2LHBE+G+lOrY9tiNHGCOUn9uZbOSa6Ma8SlRpFq9g1EcUpFxTAtzjwz4+A0OZeA23PdinQ9thSc439qYc3ocpetuWdmnh6wiLcKbApnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HlVr1odvt9RU/3SU9RXgpzqzn8MfprRZbqHvKrDlpak=; b=iT3OCoeKLh4VOdeCX/TOpqdHXxDCE6rmHwbf9m2+k1prnvB4YKkcRv86zqRqqMDdkEZm539JXzb3VS1pNyK/eYgul54YywLFazJpYeMSVWnOthyvYmxf2UvzuNWKiIGbXtmGi2h48LOdlugyOrADLm1pIqxuxJQ7jmykUiJ0Wbg= Received: from MW3PR11MB4602.namprd11.prod.outlook.com (2603:10b6:303:52::19) by MWHPR11MB1421.namprd11.prod.outlook.com (2603:10b6:300:24::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.22; Sat, 17 Jul 2021 07:42:17 +0000 Received: from MW3PR11MB4602.namprd11.prod.outlook.com ([fe80::5d92:adb0:834d:f5f2]) by MW3PR11MB4602.namprd11.prod.outlook.com ([fe80::5d92:adb0:834d:f5f2%9]) with mapi id 15.20.4331.029; Sat, 17 Jul 2021 07:42:17 +0000 From: "Chaganty, Rangasai V" To: "Hsu, WesleyX" , "devel@edk2.groups.io" CC: "Ni, Ray" Subject: Re: [PATCH] Fix variables may be used uninitialize Thread-Topic: [PATCH] Fix variables may be used uninitialize Thread-Index: AQHXehFtdlLjjo7ot0uEk5YYqYh8cKtGylWg Date: Sat, 17 Jul 2021 07:42:17 +0000 Message-ID: References: <20210716070818.803-1-wesleyx.hsu@intel.com> In-Reply-To: <20210716070818.803-1-wesleyx.hsu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8c8e1664-bf2a-417d-785f-08d948f666ca x-ms-traffictypediagnostic: MWHPR11MB1421: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1051; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: P3WT9+Go9xX/Gj7bRop6rvTj5B+6bcH9XjCW+Txi/eiRcF2P6P8hDi/7dskJpzOCYTQmIaymcmqCj+qJpZwzXhs1fWZLxKhiQjpaKVUPumGrsCgbGE4u+2zlKDk6CvDzzBJRA3Z9FzyRoSRF5QAeT/qdb4vql1Lj9r9cLfJy67K7da6dPrI+atjemXbzmLdo+ckgcHgywzdqNDJjXzTThSO1bHPt185j3E5zvme2QD9mteeHdwb7oJaHDHMYxi3dfI/WQjTP6A8m+aQMqYEY18cwMxd5fqeZ9xWF7oXxEqDca8x4t3Y8nYN+DaevMWeP5/KWlkH4WNFA0mUPQARLM1sMEgvmYWfopezFjpQMmPjpi/CPmpGw6HUzINF97AceAEG/pAs6abjXxYytj1DynnA7yYqV/AQ2FVenYDQPdPGOpYW8HEd82Kw5wYEATIrpY5eA6VP39B8vRLYWw1HClcJyrAet5Mnn1jV765gCV7hSVjI6Twjbzwl4BLJAO4v4yExKUo24w9Mm/m/FKmDu6Hlsy3ZzikqrOjCW5dH7veZMd+484H9C9ZHpHUR53Sk9oDDGRFjbvZXZDWI/zJfgs9NgYEgNjbcLG9KNMXEQAmGu+lq7v21wFMEOx/nTv6mq6v/TOuB1UDLco38KW2S+iOTgINt/QNIpgKKZLWeb9/OrmyPse+28FaxX4ELBO+FO6/ao0jy4A3JqZ39lnChtDHuIMSU6PaLaN8rvc36FVK2KgWBVzuRdbtdP+SZNdBdWU4TESYd3wMclyxOqRKPB5KX3vrntYe4RiVthYQIGfss= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR11MB4602.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(39860400002)(346002)(136003)(366004)(396003)(5660300002)(52536014)(71200400001)(2906002)(66476007)(110136005)(66556008)(33656002)(76116006)(9686003)(55016002)(316002)(64756008)(66946007)(6506007)(8936002)(4326008)(53546011)(186003)(478600001)(26005)(122000001)(38100700002)(66446008)(83380400001)(8676002)(107886003)(86362001)(7696005)(38070700004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ViJ83Uyf+3YEz5NtJq2ndZNXTibeKGZR0BdvXuY6WM0EzjjzSsD8GLDb47C2?= =?us-ascii?Q?U9vqiLXefLFr106zzLjpovQjgnZFDt25rsez/VRHjyRXpYhMFA2lQ9FVVmDD?= =?us-ascii?Q?sBedta5tH+XvKcTA2RmDC7HQ3hK40luXkA63YHLjyFNIume0BVuyszYHDrEy?= =?us-ascii?Q?BMHq3VmQkLIMRN+BFis62cN2/udg1VGZ+zav+YrVfZkBz5k8lWdGFkqbc8Da?= =?us-ascii?Q?rc5MsvUAjtxoHH3jyCZE+rCp+649tq4O5qoqoFLP217j9L84Xw2+pZYpm3SE?= =?us-ascii?Q?xFwMZMc9Uyd1u7iTGjFuOhdbw8ufKYJ1qUVjtnFAnsRE8KT4FwiqtQRv7bIt?= =?us-ascii?Q?qlnweUzOXwlisDghB4hvy+SyKEQADc+eGQ9UZyr7Ez5BVjfOjHMnd+KsxxEp?= =?us-ascii?Q?aZHCqCbuZSY0rUpbDWpnZRFKMmITW9yezPX8OfK8zPQhRRvZYvploKecjKJN?= =?us-ascii?Q?tr/zm+sdls6/HjaLe3t0Kv0m8fGYqObHP9r5WU34N5TQxpoyK8uV4YRuYkeX?= =?us-ascii?Q?5Ybz1HRI0uQgRVnuuYklI2Wijh4E5KIJcqCruFgzonyXpmxMlAHOWYfhhIlg?= =?us-ascii?Q?uDCniIi20zfoZrtUyZFyv8LjOKPp2vcCsbMCtIY8fWiVb3K38cW8eWB1Zj2S?= =?us-ascii?Q?QRf1926XE7OOy4SbUx6NZyEBsiN2m4DL8ZHf6Q3EFScONL/AQcaQ1qg/3M2t?= =?us-ascii?Q?DR6/+AqglLKneJ5vbp+oKbT9Rvu72p5KeIQecUK6u9A/P7wtD30TW5sg8lqJ?= =?us-ascii?Q?DuqlEqAZhSODDs2lA6wmZ7o7kDRWefMCvxMtWinu3NdlpjuNN+9V7vmaka3s?= =?us-ascii?Q?P8SqBdioC/ESyuHjqysrIDfGtdCJ/PfX3/b0EOJUd/b8OTG8sOrbtYUj+qr+?= =?us-ascii?Q?IsY4FLLyzWBeD9q5AvgOzNE/BK0lWmjZsvODhfGaEWvPDwrKscCtFQ0clpVg?= =?us-ascii?Q?MhIAcylbwEY3DcVw6sQ5bvujD2xWKO/eILHdEIQOlEoM0QgaT0QD7Kfjn2pM?= =?us-ascii?Q?1ydw7+7BSSVxXL1g4rz9A68SOHGVref6USsNAaV/yjPTouOto2J8FEP2mk/z?= =?us-ascii?Q?If89uFMGRw5/BNwW/+te63WUv+O+NWu2UDyjmrkBSrX0KsLc1DYkTovyprj0?= =?us-ascii?Q?Cc6bSb6jeop4a/Qpd2X4kh41UzOnuG6zfr1oeaDjyUmhgW9HWkXwgc4LCAxL?= =?us-ascii?Q?7wk++LFcg2RYf2LGCMeqGyjch885EGmAeBIyjx/YMzjvsT9CDRHYWGy8k1Sj?= =?us-ascii?Q?4tvUCpcz1Vlb4AP2a1pIyxPiICOE9/QSFP1dhMa3QZnp6owkbkRGyJqHj2e1?= =?us-ascii?Q?TzkmF8CeWHCfXGqiCptgEW0z?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW3PR11MB4602.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c8e1664-bf2a-417d-785f-08d948f666ca X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2021 07:42:17.2887 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 2dhaxfT80JL3Pms7beX9CW/WON6nSSLYBp/Mcw8VFYW6W7R81RNnDbVu9qQFjqKN0K/Zghy9zfVPrUZynY9QBPUYgjhDeOrD0xVY7hrGHhc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1421 Return-Path: rangasai.v.chaganty@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Sai Chaganty =20 -----Original Message----- From: Hsu, WesleyX =20 Sent: Friday, July 16, 2021 12:08 AM To: devel@edk2.groups.io Cc: Hsu, WesleyX ; Ni, Ray ; Chaga= nty, Rangasai V Subject: [PATCH] Fix variables may be used uninitialize REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3491 Initialize variables may be used uninitialized after adding "-ffat-lto-obje= cts" option in GCC5 tool chain. Change-Id: Iec8c9a884bac5cf1ce7258867c074c4668e5fa44 Signed-off-by: WesleyX Hsu Cc: Ray Ni Cc: Rangasai V Chaganty --- Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable= .c | 5 +++++ Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c = | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/Tran= slationTable.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/= TranslationTable.c index 341e2beb..2a5fa637 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/Translation= Table.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/Translat +++ ionTable.c @@ -107,6 +107,11 @@ CreateSecondLevelPagingEntryTable ( UINT64 EndAddress; BOOLEAN Is5LevelPaging; =20 + Lvl4PagesStart =3D 0; + Lvl4PagesEnd =3D 0; + Lvl4PtEntry =3D NULL; + Lvl5PtEntry =3D NULL; + if (MemoryLimit =3D=3D 0) { return EFI_SUCCESS; } diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/Translat= ionTable.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/Translat= ionTable.c index d152039f..01375139 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTabl= e.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationT +++ able.c @@ -133,7 +133,7 @@ CreateContextEntry ( mVtdUnitInformation[VtdIndex].Is5LevelPaging =3D TRUE; if ((mAcpiDmarTable->HostAddressWidth <=3D 48) && ((mVtdUnitInformation[VtdIndex].CapReg.Bits.SAGAW & BIT2) !=3D 0= )) { - mVtdUnitInformation[VtdIndex].Is5LevelPaging =3D FALSE; + mVtdUnitInformation[VtdIndex].Is5LevelPaging =3D FALSE; } } else if ((mVtdUnitInformation[VtdIndex].CapReg.Bits.SAGAW & BIT2) = =3D=3D 0) { DEBUG((DEBUG_ERROR, "!!!! Page-table type is not supported on VTD %d= !!!!\n", VtdIndex)); @@ -195,6 +195,11 @@ CreateSecondLevelPagingEntryTabl= e ( UINT64 BaseAddress; UINT64 EndAddress; =20 + Lvl4PagesStart =3D 0; + Lvl4PagesEnd =3D 0; + Lvl4PtEntry =3D NULL; + Lvl5PtEntry =3D NULL; + if (MemoryLimit =3D=3D 0) { return EFI_SUCCESS; } -- 2.32.0.windows.2