From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.23132.1626664518540197289 for ; Sun, 18 Jul 2021 20:15:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Vd9m5KtD; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: ray.ni@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10049"; a="272100091" X-IronPort-AV: E=Sophos;i="5.84,251,1620716400"; d="scan'208";a="272100091" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2021 20:15:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,251,1620716400"; d="scan'208";a="656534994" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga006.fm.intel.com with ESMTP; 18 Jul 2021 20:15:17 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Sun, 18 Jul 2021 20:15:16 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Sun, 18 Jul 2021 20:15:16 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.44) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Sun, 18 Jul 2021 20:15:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=muj9zflP4cgMLcwFh8Yvi8prpXnXE7vm2yaUU17PyAojArnYtHrdBQQYTszF4VW2hD2lumBGD1YEeWliyOqJljzGGgpk3Qs69UUheNjKoIWPqRVIFNAHsr5g64Gr678h1y7SXnTUQMvZ0EVYE8gOjwOf9q/TwmDZyYJWHECrzAXwNvTYfcGG1u9MGXniD9kfCF3cxJ9bcV+lJ7wtKpYVuSXlozW+TXhObsQspivqmekgAS2VVQbpj/YMUQFXC5JfxzYSo/gZRWqupSZHZ9rp8WKhhrkAl1x9JvW57c/dsDPdTXMaxGaQ5VF8qMCmbU+TGg5fPjiHNT0/BRpRFLHiVw== 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=fLitLS/Ead1UJ9NWyeY9yI7ceX1U9oPhQFcEJ4TyAh0=; b=P0Us8Vse/ZPHv/fmyUmJuRjlGBnYpgoWrkKevfouhTbeWa0oowv13oUYhcajd5Sn3AhkhKbvMj/xQFCEx3Fnd2W0vnBuW2KdD7TuAXTjNTqmSOpcJsVx29bF1aSswqYcKd3CrWXPHAFRQsQNq8L6sX+slcoN51o4dq/sI0DNCwwDvLVUwg96ok0T0x8VrqYZUlGi6CvT8BXHoVe8RlyxWsuFu6WIjrW8qDWeHY3/goQ7uGSmvXIyUWgtaMKHF38j82jBEpVAtuxjaeo17JDsWy6ggrvJPyQHDVS2gebE4TDV52CbuwCfrp00/lDWZN/6T5aGG/CxVarQMgBMtcZ3eQ== 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=fLitLS/Ead1UJ9NWyeY9yI7ceX1U9oPhQFcEJ4TyAh0=; b=Vd9m5KtD2IyVJJd1cTwc48f79CVAvU2azjcRZDmaUbGtGBFa777uj+vh7dimxFNdWp5tE+ipYkrbnBahwPLQ4G8LVj40DYKRFTHevvGLJwnVlX7AiDW7ERsEz3tmTrEyf8bI7AOXH/OVtSlbo06fxeoiKwrmXI6fTYmC6FxgUpM= Received: from CO1PR11MB4930.namprd11.prod.outlook.com (2603:10b6:303:9b::11) by MWHPR11MB1776.namprd11.prod.outlook.com (2603:10b6:300:110::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.23; Mon, 19 Jul 2021 03:15:15 +0000 Received: from CO1PR11MB4930.namprd11.prod.outlook.com ([fe80::dc21:42bd:8553:2869]) by CO1PR11MB4930.namprd11.prod.outlook.com ([fe80::dc21:42bd:8553:2869%2]) with mapi id 15.20.4331.032; Mon, 19 Jul 2021 03:15:15 +0000 From: "Ni, Ray" To: "Hsu, WesleyX" , "devel@edk2.groups.io" CC: "Chaganty, Rangasai V" Subject: Re: [PATCH] Fix variables may be used uninitialize Thread-Topic: [PATCH] Fix variables may be used uninitialize Thread-Index: AQHXeg0qDXsw20lZ30iBrwt/igErzqtJpEhA Date: Mon, 19 Jul 2021 03:15:15 +0000 Message-ID: References: <20210716063733.723-1-wesleyx.hsu@intel.com> In-Reply-To: <20210716063733.723-1-wesleyx.hsu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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: f53d7bf8-29cd-48cf-6433-08d94a636dca x-ms-traffictypediagnostic: MWHPR11MB1776: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3276; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DdxRqy1oJPNsac6msxBYxUZYb/UlqKHSzVuxlLPhk4N9cNpgT3rQIrh7wJC7OzuaFuHzL4AOFyFdGlaTdKyDKIcs6WPkmV2atpVk1t8VsS5dUPEtSrE7u04OE7VrGeSbROXRkO5xhfOxnsDU3ItbHypuMWeJLjsQTZPwSptm0dTaoRzhi+upZ0AEEdtxnDK9AJ+6ZmTuaSoGP/WKRoGM82R/8UlFs7fEX5mllaS9bri83ib0mS/kq4y/NHodTQljF0KOQU9yZ/t1RVFzi+C1cA8CWmhSdHAxm8J6YNGGFN0THtmVEiYeYA++e6nWlPgxiuArIPvX1n/1PnVBLJC7Out/ZzxNgIeISmiC4lat0kjnn9LBhORVrI0jX7tFbBTKwak1W+47RXCRuaO60Ba2uzVFHbxFgceuB3/IJqfJAXe3YQ8HtwHnQ6rk9L+Gja0PjObHroJJv9z3L8xEmLAdVPywGXwHJB6YzVeVKkiVQJFZRFzIvdfHadf8xb0fhWztN99NmFHlHjdgsxRg4yMaQIcGO+F7ONibje9o/mp77Yg1FzX/hQrF7SS3qW5pglHFlUPtw87MmNTTH6oeplLZ+0xsfH/NXFIUUwSkkrfKlzCfnIWNIJy/CiOHFUPlMIrlGGiKwPzqyG5c+IGyXvE6yWBuvje9Re1+h2Que58ihJp1z2HNqOeB8GsbaS3R9roK+0ivEeS+nWXeOa6dADCB0ZNUSKBgBGl3DFK8J2IG1kWQg+JMCzaaCGp+Y2a3nu2Pmjg5ZW2U9Ada6xm2csaJ7N60CyTusNFi9I9mAu6MtMA= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB4930.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(53546011)(83380400001)(55016002)(4326008)(8936002)(5660300002)(64756008)(2906002)(508600001)(122000001)(7696005)(38100700002)(186003)(76116006)(66946007)(6506007)(8676002)(316002)(66556008)(52536014)(66476007)(107886003)(33656002)(86362001)(71200400001)(9686003)(26005)(110136005)(66446008)(38070700004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?cQlf/IXxyc5YWYRNcsVf8ns0pVVpcrTDpKpyzEfbL4jOXGcYjSwUxYB6O4Z6?= =?us-ascii?Q?y+Ul6Z3Oxob53SB6y5wOh7x/E7C2l5PvX0dO65M6wr+ou2HNQKRL39QdXqnB?= =?us-ascii?Q?51MUirIshgZACK+/QZCCwgZvb9Ic5WH1UnjPTA/aLv6FTF+17b9Eonq2rz+N?= =?us-ascii?Q?p3i4HwJqw75mtv6FlEbWpofpOxvR3OwyIgCNWHizQb5fnC/Z2BUNgNrAorKk?= =?us-ascii?Q?TRWy7Fq2xH1DmIW9HN6YYGpBbfIpA3ABQTeGhCDvV9p2+C+9RDs5GTPAS7Tc?= =?us-ascii?Q?AHwNZBvr1/g+8oB+OIyeJYQm4taIdHO6fKPxAX0kE9PYCR4weo9Wx8BoTdzh?= =?us-ascii?Q?nDX7UefeyfZsxy1GskysnuDjW7mXT+7Le/3JFaf72Ph5kIAdGUoEldGUTUnb?= =?us-ascii?Q?bg4o/0S3nSxmHtC7+20tMl1EDXUzOw3sWxkmyDN2Vr0Kg2zwKJ9r0II8gzlc?= =?us-ascii?Q?HlVo2kXu/DRiJwxjqoeG0veY94j4PBG14X8HfEWR7xcpRBS6H5Xm5CkQF1eR?= =?us-ascii?Q?812hMuOjLuH+7wSQyhG50UNSUkLxthyHTSgg7Wio31fDC2P6GSYW924ak9fO?= =?us-ascii?Q?zn4ZakljdG6K5FseI60mAnr+TsYeKGSwvwf5iedJAGGCwwlebrQ2H+RHW7ZA?= =?us-ascii?Q?5sbx3GKurFOKlY6VSafL6hXR09lUWPpclJYWJ1bXQW/JgdJ5lM+Npf1ephFo?= =?us-ascii?Q?Ytl/3ckmdFXRkaesK2bbZ7+vICUqLkkJCxeY0SiCaQemERIbMiu5ZDekjzBQ?= =?us-ascii?Q?reSf++3KdadwoZ/ODHLxqgGioefkh8EpM0z/P65ZY0fn04ORj6JE9AtV7zpZ?= =?us-ascii?Q?VEB1SM1yGSZjJSKNFHAZgwYGwHvy8MUn9Y5ElnGSCdgj6FtiEOYv1qk+zGQq?= =?us-ascii?Q?XZTqZDgX1YZNEutyBDgwfVkof3R7naD8nxq1gJ9eRY+7FMQB1bMq/K1T9SIV?= =?us-ascii?Q?20nzIoE37u3CJ0i/MJsFlZXuXMH+vxACXESL4WH/qzwlGiHcBqmZKiifcOiw?= =?us-ascii?Q?r7N5rvB1vrIqrP/DFFY1ycJpdtVh/ljurxmZvLxSwZ0Tr98x0nCKSQwK59h4?= =?us-ascii?Q?5rYKuKx17RhBDtjTNgIGDw1QIpkkI9l3J8OqdsnCgWX8YobRFuIG1qOBy4/b?= =?us-ascii?Q?nExvtxbcB8j26qq7ie4DBX0WQaPqte0eA21hP/QB4KCZQupxcQq7SrpvI16+?= =?us-ascii?Q?ZTQ60hpQ0t+g/bUaG15Pmnu79O6On86d4Wpar/kLzbCqBbDjQDYLrf6m96+O?= =?us-ascii?Q?RJCnM9XdvGoJee+xupuVUTrH5eTwRGaqvMGQ8Ls88XKpL+JtihsCvE13/GI1?= =?us-ascii?Q?yq5GefE/zJa8b6YGPUULi9ai?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4930.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f53d7bf8-29cd-48cf-6433-08d94a636dca X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jul 2021 03:15:15.3117 (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: O/l+k721HzhjFRFWsQGnFVJK3AMevI4repiwD6b7rXADps13PZoWRRfJO4JGcPUQEpZpRorq5unHy2gq31Akkg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1776 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni -----Original Message----- From: Hsu, WesleyX =20 Sent: Friday, July 16, 2021 2:38 PM 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.26.2.windows.1