From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.3860.1676524275413632958 for ; Wed, 15 Feb 2023 21:11:16 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=DnIjRz79; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: jiaxin.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676524275; x=1708060275; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=4eFCavPl2qSy3R8SZ2iSAyxtXtEKinLrBYSWGgzQsqs=; b=DnIjRz79Z/FF0VHH5rnKUNMSui2yVbDRU+PR6V+he1A1evA3rRwdK5NT H2vRlAvrHZenSs2eOU9+/jLUXf2YEr4+GP4TFSLmwPkuQxEmPh+F5e5X4 e7CDDYVJJZeOMONW8Vm/O04jRRE21dYTa1Owbyr4tYIlNJKPUzBqTwFDN PW0qKptriAyqoSlio2oLfTaP5o0MzfWaRNcitIdRUv2IUq29U5Wd1GNui UkAKQZVbYtIiHg3w5uh5E8YabMVeKhTWXx1db13w5daAr4cSlgJr2hZQB ssAvKVM8NwSfXnHqppR+trZKPxQsKxLjfB3BsmnEKTyITZyk6mApdXfGz A==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="315301312" X-IronPort-AV: E=Sophos;i="5.97,301,1669104000"; d="scan'208";a="315301312" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 21:11:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="619870337" X-IronPort-AV: E=Sophos;i="5.97,301,1669104000"; d="scan'208";a="619870337" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga003.jf.intel.com with ESMTP; 15 Feb 2023 21:11:11 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 15 Feb 2023 21:11:10 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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; Wed, 15 Feb 2023 21:11:10 -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; Wed, 15 Feb 2023 21:11:10 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.108) 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; Wed, 15 Feb 2023 21:11:10 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DWGcU4tQtbsCbD1MAU5sB3tmp/C5fiAQmnnBgfz2GeYgmQbRtMGwV/iQKnLofaM6b+XZ59ueDHa5GWLyCcLeUsfT5Yzlo3/QAuGhJIQi5jawSpGwHGybVchR9qD876uKx8a4nRlv5HFKKF6azpgvqxsOKMvLCsV8/bn8DGq74rrl1GZ4wctgJpn+tUfFinetwII6vkUxTRHM4KK/jgfKplW9qNhANKg3i+1wBVCvXK1d34+Ka8mWZV32ioMJWqbl+vAMYjgwAuAdCuV3gtGkq/zgToUCw9H2lYh74ukvrubRbVMLfoFxqxqYpBCrO1SwKX+b6VT/CDMwtXMkRWRwVg== 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=PvTWPNUSimCUk4o8N1YpJAXJOm624epl50nioE8gzYE=; b=ofYHjjb9H3jzy+ofxB1uyhZJt/cmNzLVJs2WKn6xYGSofnnCKn+zuDavgw0okpzHtF+wIAFckElxGqcJ2aWC7/RLyuOERYpL4ett58mIAcX3N3BYMga3pZEDccirIW3Huh2sdD83B4PuMhtpcOx4jzof2cNDF1Nd4E/gEteATUKYBdafpDxvVIxHbsu/ZNYCdftxzBbg3+1wag1xvd9CnxI8BoT+7KCYvy1DXvfsU91CbJRFwVO2UBLWCLaTxxLn2DuueEf5MNfXyf8ArWVOo4wstR544RstSV5OoY3pZ9lG55HqLCPcXhFpmu/IG3dwzxjFOHTEivC5Q8+/RYa38w== 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 MN0PR11MB6158.namprd11.prod.outlook.com (2603:10b6:208:3ca::18) by SN7PR11MB8025.namprd11.prod.outlook.com (2603:10b6:806:2dc::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Thu, 16 Feb 2023 05:11:08 +0000 Received: from MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::e5d9:d16e:172b:aa01]) by MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::e5d9:d16e:172b:aa01%3]) with mapi id 15.20.6086.024; Thu, 16 Feb 2023 05:11:08 +0000 From: "Wu, Jiaxin" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Dong, Eric" , "Zeng, Star" , Laszlo Ersek , Gerd Hoffmann , "Kumar, Rahul R" Subject: Re: [PATCH v8 3/6] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data Thread-Topic: [PATCH v8 3/6] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data Thread-Index: AQHZQbDsRF7RZ69mG0qzheGW9VtbSq7Q8JuAgAAVRzA= Date: Thu, 16 Feb 2023 05:11:08 +0000 Message-ID: References: <20230216024635.9316-1-jiaxin.wu@intel.com> <20230216024635.9316-4-jiaxin.wu@intel.com> In-Reply-To: Accept-Language: zh-CN, 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: MN0PR11MB6158:EE_|SN7PR11MB8025:EE_ x-ms-office365-filtering-correlation-id: 69b22256-36bc-42e4-fb66-08db0fdc3675 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jbctnwxGRdXhXJHj5Kpk+AupCj4CKWXQiK1FxQjzIABYIWBz6Xxcc1N82smrTtwWPUV0d18Z63kMZlEECcNckFSN4PYd9bryMNf82HGUjm9rMq7xPJgXbEtQ2hnf9pi9ZTnTLQzWMsPJFoAwXyBmINotpnjk0K8975n1eb6yfUM4PH6R/CiDM9WHIgoV0fLFq1Sz//1/seoGmtfbn7Z5LGHEo5EQOvxHswfa0yQ1+IXreZA2jlc22ks91nvvM3RDzyT+IjbzJWb41I2xBQnJFcriXbmoJVdGsz2am3l8yUs7iyILFV0DIMAKk6Jp+PtIxdC9bWaWsV98h7VE3fs63hPKsn3D3LQJFSYhNstqk14HUOJzsn5VH8/Ikm9LFdPiYH24Ct2O+pb8n5j+/Cq0tuPQx/TP5zxDoHFYVqG6w7UTGiE/ou67AQEq3I4IPgyPSEL2e15JxVhtmnXUjVt8mm5MF3feuanHrBPsTfdfIDoul1vDkoSg9vgh0IYiYlz38fAxnvVc7xB/v3ABtqA/zhRy+Sa6JfGAtK/rrc+XzVy50A8ZhPo+JoFT28TkWuFwImojIMttqMn/6iy5sMSl/4Sn3HsnNFZVG4xIQ+JG2m7I1Z1dWl/VmWtntXPNVlcX8SYXQQMhay/zF6ucLD449OUqL9wQ5taJmwTKMG1Ul7Iem2Mp3Mk+x/Qt7ZnBxwp3 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR11MB6158.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(396003)(136003)(39860400002)(366004)(346002)(376002)(451199018)(53546011)(9686003)(107886003)(478600001)(2906002)(38100700002)(122000001)(38070700005)(8936002)(33656002)(8676002)(76116006)(66476007)(6506007)(64756008)(4326008)(71200400001)(41300700001)(52536014)(86362001)(55016003)(66446008)(66946007)(5660300002)(66556008)(26005)(186003)(7696005)(966005)(83380400001)(54906003)(316002)(110136005)(82960400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Ciwa+xO2KKD9oel0u/du3slEHf8Lq204QhuDUA+DXXaBdCkYc8a3Eyt371If?= =?us-ascii?Q?77jVLXvumbhUS9WPXUghmhkxFPuGJkpmyWHlHj4lrbB9oLJd/gErqQ+h6wl8?= =?us-ascii?Q?nShX2qxXcwwiKr0rWxVk9dJ7lgY7n9UuiXBBsjakajvztTtGr+8o2LLIzcIs?= =?us-ascii?Q?2PtJWJ2zWb9CaSyn0M2bO3RE1T4w1msxLVjg0Hr8NQqXYdpmF5dlyON5/eSU?= =?us-ascii?Q?+cQR44BFbNYSSDNvCXHBk/x0KVXggEnJi3mfj3DQWhUNkctAVe94j3x6jxEm?= =?us-ascii?Q?8lOTTdoTHBH1YrgDPY9Q+SWm4NzKYtjwW73fBAhHj89awFRcRcvZso/PGbbZ?= =?us-ascii?Q?i24Jz+PesLOxpSy1LmYhDdOEJA5a8mbXKyDvUZvF3KYSfV4esHOXb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EIqiU0S0fbtJOOTbEUUcg5QU74iKqKUud60nl1j5Rqe1Jglw?= =?us-ascii?Q?zCMH+YlVrcjESIu8aAI9nSEgEVfy7qu+VKSft2xpjLYHhtblcrCjW7YlZqFs?= =?us-ascii?Q?krUvUuvEFOyVxqNqtv6pcNJQwZehjsv4Bl60ML4Tnm7YPf1YeJ/cPqHIp4eU?= =?us-ascii?Q?Al4u/NwiiroTGy/XmtOkS2cKEYbHp4PW4nUGcYrofomEpzR+/kH9/kHBV/u+?= =?us-ascii?Q?ukv2XbDvLo6mabdQoAwb27+CnSQmDCQCYYZNB9PrEnS+HYWAT0mpa5ONC2in?= =?us-ascii?Q?4oLS3iPk/V3dSFJFGl14oVf+bconBw6TeXx9taX0?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN0PR11MB6158.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69b22256-36bc-42e4-fb66-08db0fdc3675 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Feb 2023 05:11:08.3668 (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: rOfElJKtEJE1f6+E4NNZxAL7DTN82Lpt+BL5CwAKcw9ihPZ4BnjJTIxeUhp2ZjlHM/UM9O3FWOP2FXcxN+o++g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB8025 Return-Path: jiaxin.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks Ray, I will update all you mentioned. > -----Original Message----- > From: Ni, Ray > Sent: Thursday, February 16, 2023 12:59 PM > To: Wu, Jiaxin ; devel@edk2.groups.io > Cc: Dong, Eric ; Zeng, Star ; > Laszlo Ersek ; Gerd Hoffmann ; > Kumar, Rahul R > Subject: RE: [PATCH v8 3/6] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB > Data >=20 >=20 >=20 > > -----Original Message----- > > From: Wu, Jiaxin > > Sent: Thursday, February 16, 2023 10:47 AM > > To: devel@edk2.groups.io > > Cc: Dong, Eric ; Ni, Ray ; Zeng,= Star > > ; Laszlo Ersek ; Gerd Hoffmann > > ; Kumar, Rahul R > > Subject: [PATCH v8 3/6] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB > > Data > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4337 > > > > The default SMBASE for the x86 processor is 0x30000. When > > SMI happens, CPU runs the SMI handler at SMBASE+0x8000. > > Also, the SMM save state area is within SMBASE+0x10000. > > > > One of the SMM initialization from CPU perspective is to relocate > > and program the new SMBASE (in TSEG range) for each CPU thread. When > > the SMBASE relocation happens in a PEI module, the PEI module shall > > produce the SMM_BASE_HOB in HOB database which tells the > > PiSmmCpuDxeSmm driver (runs at a later phase) about the new SMBASE > > for each CPU thread. PiSmmCpuDxeSmm driver installs the SMI handler > > at the SMM_BASE_HOB.SmBase[Index]+0x8000 for CPU thread Index. When > > the HOB doesn't exist, PiSmmCpuDxeSmm driver shall relocate and > > program the new SMBASE itself. > > > > This patch adds the SMM Base HOB for any PEI module to do > > the SmBase relocation ahead of PiSmmCpuDxeSmm driver and > > store the relocated SmBase address in array for reach > > Processors. > > > > Cc: Eric Dong > > Cc: Ray Ni > > Cc: Zeng Star > > Cc: Laszlo Ersek > > Cc: Gerd Hoffmann > > Cc: Rahul Kumar > > Signed-off-by: Jiaxin Wu > > --- > > UefiCpuPkg/Include/Guid/SmmBaseHob.h | 75 > > ++++++++++++++++++++++++++++++++++++ > > UefiCpuPkg/UefiCpuPkg.dec | 5 ++- > > 2 files changed, 79 insertions(+), 1 deletion(-) > > create mode 100644 UefiCpuPkg/Include/Guid/SmmBaseHob.h > > > > diff --git a/UefiCpuPkg/Include/Guid/SmmBaseHob.h > > b/UefiCpuPkg/Include/Guid/SmmBaseHob.h > > new file mode 100644 > > index 0000000000..9434276991 > > --- /dev/null > > +++ b/UefiCpuPkg/Include/Guid/SmmBaseHob.h > > @@ -0,0 +1,75 @@ > > +/** @file > > + The Smm Base HOB is used to store the information of: > > + * The relocated SmBase address in array for each Processors. >=20 > 1. Processors -> processor. >=20 > > + CPU runs the SMI handler at Smbase+0x8000. Also, the SMM save state > area is >=20 > 2. better align the term to use processor. > MP protocol also uses the term "processor" >=20 > > + > > + Note: > > + 1. Smbase relocation process needs to program the vender specific > > hardware > > + interface to set Smbase, it should be in the thread scope. It's doab= le to >=20 > 3. "it should be in the thread scope" -> "it might be in the thread scope= ". > The HOB itself doesn't have "thread scope" requirement. > With the "thread scope" possibility, following statement looks good to me= . > Just change "should be" to "might be". >=20 > > +#pragma pack(1) > > +typedef struct { > > + /// > > + /// CpuIndex tells which CPU range this specific HOB instance descri= bed. > > + /// If CpuIndex is set to 0, it indicats the HOB describes the CPU f= rom 0 to > > + /// NumberOfCpus - 1. The HOB list may contains multiple this HOB > > instances. > > + /// Each HOB instances describe the information for CPU from CpuInde= x to > > + /// CpuIndex + NumberOfCpus - 1. The instance order in the HOB list = is > > random > > + /// so consumer can not assume the CpuIndex of first instance is 0. > > + /// > > + UINT32 CpuIndex; >=20 > 4. "ProcessorIndex". Please also update the comments to use "processor".