From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.13477.1676032462792336168 for ; Fri, 10 Feb 2023 04:34:23 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=A04HARtk; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676032462; x=1707568462; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=26GUBKsIPg1NHBr6QmU522NNyhWcWE6yuh01d84b/9M=; b=A04HARtk/m6kp89/PEJT4jxcViOvNiAhqKZGhfVGppvt3uAc9LLR3Lti o9Sw9OAmUEddM0EFJCeyg5l5FOwRXc0sFabT6CvOqnLoy0FbK2oq/cY53 UyFETJTY7XuTG9AN0ydWMS8br9bCsR5AaUWMEPM+8NKUIeYN0CaHoBzob XvwqAynv8t9+wqJ30t9tP4whI6TLV8viI+t3HplcVAv02/lgkW03/J9m6 ellVjsx/pmZnVhxmSV386aRAlt0qT+hv480qM21OaZ1Jy9AK1L/FDPSbr 34V6mnjSFhaczglwl6JnzpBuBpdjITTYjqqOU5emYnYs8CA30jO9wZSzf A==; X-IronPort-AV: E=McAfee;i="6500,9779,10616"; a="310772810" X-IronPort-AV: E=Sophos;i="5.97,287,1669104000"; d="scan'208";a="310772810" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2023 04:34:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10616"; a="913521398" X-IronPort-AV: E=Sophos;i="5.97,287,1669104000"; d="scan'208";a="913521398" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga006.fm.intel.com with ESMTP; 10 Feb 2023 04:34:21 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.2507.16; Fri, 10 Feb 2023 04:34:21 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Fri, 10 Feb 2023 04:34:21 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.172) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Fri, 10 Feb 2023 04:34:21 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h7+MWTN6CySvOWx9zsX+Zy5zDAGMv7bOw567yjb9XGBSDPuWGmHLSbfn4NTTJMi9Q3Z67N+bxhajdG+8QjGCfEFDdIumXl5fHqKH1KhACi+Qkf7+NzOtLALPvpcuHcDcJG/wliYsU8lSbkQcPmQkZKxoc3r/npInwDHVwH4QrlCQLiVL3yAuzdHGHdV1IpP3iahT15QRiESqPcetVdKZBdOASD6M8807cPbV85BZiYT3OzOTqSbSBG/CTXXH6cektqg+J3mel/gnjTjX5vvgbxTa24iHY1Or0J6AIYS3en/M4P5I3AohnIcqvRiDJ1SorNMX6lKC+wiwnvsv22iwfw== 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=q5k6iTI42ZyQ07NZOgBHkroc2FRxv6QQl5pn6lWJIoo=; b=b4+68u4mVEYHfSR3GcFv/MtiBf8FJNFt5Og1E0WK/nXP8PzZt/GnrCBewej18RXkSQssCzrw5zzOUhzu176mLO4nh44IrUFfrYD7fqwF7W2jNYUoBotIxWrYIXmlDEk3KXZNnDvMH7swdHqGUsBIuLkEdKnO1kJV1f+JVha7T/H1DTp0ylfCycNpy87FwQcKR9sOJNnhxNxVRUuG3LzCK24QjGw/WdpcWVS80d1c3Ljw7sAO7oBsjrBYuA4DEpnNHlV8kqbd2w32FMktf80fzKICvz4LbdzDkRsfme52uvXQ632rp3B+Zr8w75GPdRDoQ1kz0JpBmgwH+lqeumw57g== 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 Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by DM4PR11MB5390.namprd11.prod.outlook.com (2603:10b6:5:395::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.21; Fri, 10 Feb 2023 12:34:14 +0000 Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::f890:e4ec:e2d8:5831]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::f890:e4ec:e2d8:5831%3]) with mapi id 15.20.6086.017; Fri, 10 Feb 2023 12:34:14 +0000 From: "Ni, Ray" To: "devel@edk2.groups.io" , "Wu, Jiaxin" CC: "Dong, Eric" , "Zeng, Star" , Laszlo Ersek , Gerd Hoffmann , "Kumar, Rahul R" Subject: Re: [edk2-devel] [PATCH v4 3/5] UefiCpuPkg/PiSmmCpuDxeSmm: Consume SMM Base Hob for SmBase info Thread-Topic: [edk2-devel] [PATCH v4 3/5] UefiCpuPkg/PiSmmCpuDxeSmm: Consume SMM Base Hob for SmBase info Thread-Index: AQHZPRXvUunGC8Xwak2WQ/WGAugRZK7IE2FA Date: Fri, 10 Feb 2023 12:34:14 +0000 Message-ID: References: <20230210060519.11100-1-jiaxin.wu@intel.com> <20230210060519.11100-4-jiaxin.wu@intel.com> In-Reply-To: <20230210060519.11100-4-jiaxin.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|DM4PR11MB5390:EE_ x-ms-office365-filtering-correlation-id: 4ffe137e-7ef5-43cd-9049-08db0b631e86 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wHS7A9sRgeclZWEhHZ5FbiiAuWoRSkQgVxkFmdv0IoEicEF6sdvS9BdB7mSSF0JgvpcgvIIFOUc+AgAtOrYc+WUoT2n5YPLbGU8PRNNML/c4RTt+kMYpkBWfA7mKN3e2o5Snb8OcFyNB/1dxF6MjsBWEgTZzAMxaM0+5UIfxZ4hYWKfaWA++O8MJGIw48dGjfbc/X/psoAEazxGM/4lAcdFjzwcrPn7RS2XZ8exMydD0RdZkbV9a1XtJiRySMKIwCTdnFX2oEq/2IOFsp+2ZZpOSFgSI1ieIEMrX9YR8K5mmTK3iKmCjYf1r7aYyGlzTyUDE54Cug9Y+1HTe0pMzgxsdVCclby5ska8haog3ZQKcyRv6wjmEn4l7LKAl1QJjpToEyMiQ4f/Iv8Pzk332HrAy9eFUvMlG/DnTHdCujPyOpPkx0LaKmujxZtDu6yQPzWb+p6MLdJTuPt8yWoPS5hdc2lAwBhbQ51ZitofHqRNHj7vqqAxA0kjFf1Q9EfYhic/CFEcXBgZDtdgEvQU9KlflF05ld5fvjOD01wslLDGFVmIVSm1CIn1zVs9vmn+/W3YXE7Xfj2dk0D53UHAKdFhy4QLKfXRJjj0WqpPpfnJQkN7CKA2UxTYOsl0VLc5j4I/d/jWRenggkaG4z+BQLrSomkjPskAJQ4P5rGWmjtUL95+Kyw5XwO7+xNBSctLLFIaOGuZdD+agfoFSleqcmg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN6PR11MB8244.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(6029001)(136003)(376002)(39860400002)(366004)(346002)(396003)(451199018)(4744005)(2906002)(86362001)(38100700002)(82960400001)(122000001)(71200400001)(7696005)(186003)(6506007)(9686003)(26005)(33656002)(38070700005)(55016003)(66946007)(76116006)(66556008)(66476007)(66446008)(54906003)(6636002)(316002)(110136005)(41300700001)(4326008)(478600001)(107886003)(64756008)(52536014)(8676002)(5660300002)(8936002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1r4+XOqd4a+nBZGVkETr3hAG+KB6tKmyOzcZm/1rc2QYrSe+xYVCauag4r88?= =?us-ascii?Q?rKYLQFr7b4qkU2SK/6ao/GN5C9SslxAIpHPgFnb085thhscSRa+vnMCFnuwa?= =?us-ascii?Q?o/IcSxi5Gc5dk1hiYuT0rFG+TIAKjmAxT8XTEpl1QV7btKAuEEQe4LYugGvJ?= =?us-ascii?Q?nX1oufDSuGCrNSmYg0YbpWEW/p3QZmGy9VyhB3yIJ/SDipVixqU1NoIJOF8x?= =?us-ascii?Q?qf+dBQc5+M8oMSOXdeRuGrSfD9x+rCtvnERXTgjxkML4SN7f5pYKKGX8qhGR?= =?us-ascii?Q?Ayx6HanzjTMA7FY9HuTf0k7ToDwcfgIFz4XBLRkE1MutGdgl72Te3BTL8V+M?= =?us-ascii?Q?DCsbvpmwVUiG4DDo8w0jK4R58nMHh7GXovMl8GdfrvP+B8jLulP8j+1ixA+B?= =?us-ascii?Q?ztwkXNhe5GPJWaapYccowtd+BSCPSqsv8yex70XD5oF5ZkCQRtLhyPnvUo4t?= =?us-ascii?Q?V4OkjUbC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f4NGWoRZp?= =?us-ascii?Q?n0//rIj1ueqyE3TFwXnczAkQaBj5fyo/ILIHq9pGxvr1uYvM2wAuh6E+571k?= =?us-ascii?Q?K/Wj9Nk3FRMP4ndkEWjBjqWjRLfXPi1O90bzzu7/MRmwCoYiB1rny17L8Hhk?= =?us-ascii?Q?dGEG2ZWX6uV99ZJtiB3V7RZLiqRPoNBpozTxBhuajzUt2ldXGA8P7VzdLR9h?= =?us-ascii?Q?bxUOvGhmZ6P1Eyjpn9TLGGrlHUIbOZpvX8vxIZG3?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4ffe137e-7ef5-43cd-9049-08db0b631e86 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Feb 2023 12:34:14.4391 (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: 3CLqiyzW8QiefWI2riKpDjV5Kp4dGbvWl7o4+6xKE546YoIAB/PT/kwFrudaapUGJVA/KXIoEtZBeKl2KBbFfw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5390 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 > + ZeroMem (mSmmInitialized, sizeof (BOOLEAN) * mMaxNumberOfCpus); > ... > + for (Index =3D 0; Index < mNumberOfCpus; Index++) { > + while (mSmmInitialized[Index] =3D=3D FALSE) { > + } Above code sets the BOOLEAN array to all FALSE. Then polling on the array to be all TRUE. We need to add "volatile" to the mSmmInitialized to tell the compiler not to optimize the code but always check the memory content. A better way is to use compiler barrier but there is no edk2 lib API to wrap it for different compilers Let's just use "volatile" for now. Thanks, Ray