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.web10.3614.1676523562023917198 for ; Wed, 15 Feb 2023 20:59:22 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=ElR+NhS2; spf=pass (domain: intel.com, ip: 134.134.136.126, 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=1676523562; x=1708059562; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=L995vsMciJC40P9OnXd//uTlY/X38E7vLVHvxv7EozI=; b=ElR+NhS2HLQ9a9alrHHCEwZzD15NrLkZV9Uku8QMcC5q1zH27BEmRHlY t35EbfiHdnlBs7ZtmWh5TgMA9xfpzgNcKwKrwKnf5E/tRYyJXeN598dzx fIx2l+yZ6WKs7jghu1LabzFP2a6KuH7RHP8fJPXCCVH1t486Ig8CnKkb9 soQcuSsPrg9R50zWBnr8MoCJQdkZv6r/RRYsvftCYxMCgOHsvXcTwPtYo 9iVJrqeg5a1a55G01nnVP1u6+wMdkFqeDJwfKxfLsin59DsnFmydl6h8q PhdwpxCVQ4Ppb5HRYD5096XgnDkMR9s50scDi2UpNHyBOjyPSjmv2+Qv7 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="315299184" X-IronPort-AV: E=Sophos;i="5.97,301,1669104000"; d="scan'208";a="315299184" 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 20:59:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="619867744" X-IronPort-AV: E=Sophos;i="5.97,301,1669104000"; d="scan'208";a="619867744" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga003.jf.intel.com with ESMTP; 15 Feb 2023 20:59:21 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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 20:59:20 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX611.amr.corp.intel.com (10.22.229.24) 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 20:59:20 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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 via Frontend Transport; Wed, 15 Feb 2023 20:59:20 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.103) 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 20:59:20 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kTNTS8Tr5linchdeG9noq0uFXj+ZncSBBfmrHmjIT72xDJhAZDQUD9dlf9yHngY59wrAbO84T2/7qTGYNFc2AmUYi6t9YeCpizBM+yLKKRNgsZFjb417S+O4ykcOZGT256lCiBLJkXlYETr2qNAju7w5tTuZnmFf9uE5QQB2RBtIT3ywZxX5FlAzLr4WWCxW0UmR/xIgpeiZtoakbEa++egmqYdIRUzReth7csUIovS8Ktyh1KZdL2aPkmsQDng/7CUXAFicJZRlas6JRdjaIoGvDS8+hbZmIwJb4NViXg4dXPi3HriArvCfcrLDSx3/GxDOPbWo/QXeVqUzuWSaFQ== 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=EOPf7OcdEB1uGV9a0wzxyEfM9CwjNBZHYI5boXyEd4Y=; b=LMVwuP45z2Zs8604ADUzZ/NvQXQdJzvCqhWbf4GWcCpqOpGmY+abQZDfKhgvheON4sJIOAogHBbqYIeu/c41HLx9+uLvx28dCXd+wt3QCs7eVPWyopD3W+eNp/gpDyyLl9KB/oQf9lBhtdvVJr4lmBSaRj/MG75wx+DYS25V8kIf5oeAh0GphuFqLeIOgKgYSi54EAwKcngNft5SrXHPSzqSUbc6t68JodgF/mQnpTykWgmIA/QSOKRRMMxJrIoj6Sa6tfW3NR0NfVLoSK54RLKkRDaXJJm9yImsLAU2PqwZBuru+VkgCNcZ5vhU2gu8DzYhkd4AOmzuKFT/W7xZ0w== 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 IA1PR11MB7173.namprd11.prod.outlook.com (2603:10b6:208:41b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.24; Thu, 16 Feb 2023 04:59:18 +0000 Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::e342:cbf5:6c57:e8d6]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::e342:cbf5:6c57:e8d6%7]) with mapi id 15.20.6111.013; Thu, 16 Feb 2023 04:59:17 +0000 From: "Ni, Ray" 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 Thread-Topic: [PATCH v8 3/6] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data Thread-Index: AQHZQbDsRF7RZ69mG0qzheGW9VtbSq7Q8JuA Date: Thu, 16 Feb 2023 04:59:17 +0000 Message-ID: References: <20230216024635.9316-1-jiaxin.wu@intel.com> <20230216024635.9316-4-jiaxin.wu@intel.com> In-Reply-To: <20230216024635.9316-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_|IA1PR11MB7173:EE_ x-ms-office365-filtering-correlation-id: eb5b816b-f633-4c3f-329a-08db0fda8ee2 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ti5FVfOwd3lfJwTJLzT/LmFzxU7w7Sl/iKKxJKDn2EKOO/88WtLpJdbygAqB5k4OOBEIcClz6fqyQPDZB9PMkwEeQQ2UihgVVN+qoqu/6zPLX06G5Oj9WEC7MMfkDm0X+reqLW0EUYPobjUW0hVOe7Nymona7HBtsw8wptz4QS+u/09aDC5j+FOnjhgdHG/86fRq6M9nOBAuMLA/SUJDlnlaBNNmge8+/Si1rMFWovvcSPTbm8G7I0j2V6xIHp/1hWQzFP6EjPkomOKXkkHA/PdjxQWnYmNxbmfAZ+IOFovjygp2NckgmYNTg18BTn7PTjgjibMNulxoO3QIHem29el1r41tFXz0nmRtWyZwvM2uQ98v+4RfSLdHEYEfbFsUOwhl+xJacu9V7ahKn0UZTSbvPHXsS2VmJwKXWLvitGHAWb347GfI0tZJM8s6ZLoBXVCzBLa1V10mVDUJJ07hEkr44ziPLFvrlzAx/lhB7JqCl4b8hS55bpG+CoBVABNNuJHPVEmXfCNpiwhitZdof+CW3++SK77sR31BAVXwc9Kt/n0leSpb08wbrTVCS1Cdyr2NWa22D5W/P+kIq+AWvkml3ozNa4AAf4nK+bGZ2kecu1qel/7UL0f7xmWn7QiBEmQa/YCPw4+Ze1Ev4CmKLMeY1t01NToSOwhEWjm4YcC1CZbIx9X7/DU4QY5+HAQW 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)(376002)(346002)(396003)(366004)(39860400002)(136003)(451199018)(966005)(6506007)(33656002)(41300700001)(478600001)(71200400001)(7696005)(52536014)(38100700002)(8936002)(82960400001)(86362001)(186003)(9686003)(76116006)(4326008)(66946007)(53546011)(8676002)(66446008)(64756008)(66476007)(55016003)(66556008)(5660300002)(316002)(122000001)(38070700005)(83380400001)(54906003)(107886003)(2906002)(110136005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ANUXS9OLG0PP5c9VIwttyTaRIosCIA3vwgCoJPD+PJq/QVDGkL/XVK8DDXXA?= =?us-ascii?Q?1g0Y10k6yiAG8udox1yvtRJzsAkZZa5tkrz1qBN/7i+YZ7m3Xr2WihZeUmUL?= =?us-ascii?Q?jZRt8wOIkbzD9q7ItZHNa+hnFgdVhkvFb4e6GaBVKOhz5n3pC3Rmz4Vcnobj?= =?us-ascii?Q?+v5ueHibo9tfE/xF2SXXEqMMT6cM6ILxotE0himHy8NdetlKWMpL28OFe+WM?= =?us-ascii?Q?ENNWSAk+WG93nLMhLbw4vEeSb0UnAg6tRIQHE2WEgYT0wam4iVRxbv1nFr7j?= =?us-ascii?Q?zoTs1l5VAswCPfQREKdJM2TDWZs3WMZGt1vMZChTG/TsyKHwoBVmhKucIOpL?= =?us-ascii?Q?V1VS1pHudzR+qravFY+iABilfWGaLM2RNqW1kVhjUVP1mXiyi/8RKtW/8fD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XSV3QqMP8Fn0z8otF7tKP44tlWOm6vP?= =?us-ascii?Q?VEk2OrObhiunnwTh7lg7Iu4PF/axPSAmJ4mH/t/AEdOyL40o8dWp9joJmV7W?= =?us-ascii?Q?IFEWXttcnyuXL+lYsSuUhuo4ww9zRGYpLOst2xE1ZX2cKukLPTC1+H0SBI9t?= =?us-ascii?Q?AfypcI4a5+Z+aVAE9lGyd8rlh45IQoU2xMT+lNu9EbZ7FZeSBrKil+u8UDl7?= =?us-ascii?Q?wUkYp9irsoAK4+b8NJJKCHTbOTuxi/OO0ZUgYO1cqsNAPgPAK7m7de5JWQ?= =?us-ascii?Q?=3D=3D?= 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: eb5b816b-f633-4c3f-329a-08db0fda8ee2 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Feb 2023 04:59:17.6908 (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: g5xwYnBmu0Yj0iaq2vcpLJrg3zyBGLSCbRseUWSkDqFWkI4ildcHmj3zCRV4jUhiyf8I84S2TGs4yWfUcYmU7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB7173 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 > -----Original Message----- > From: Wu, Jiaxin > Sent: Thursday, February 16, 2023 10:47 AM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Ni, Ray ; Zeng, S= tar > ; Laszlo Ersek ; Gerd Hoffmann > ; Kumar, Rahul R > Subject: [PATCH v8 3/6] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB > Data >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4337 >=20 > 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. >=20 > 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. >=20 > 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. >=20 > 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 >=20 > 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. 1. Processors -> processor. > + CPU runs the SMI handler at Smbase+0x8000. Also, the SMM save state are= a is 2. better align the term to use processor. MP protocol also uses the term "processor" > + > + 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 doable= to 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". > +#pragma pack(1) > +typedef struct { > + /// > + /// CpuIndex tells which CPU range this specific HOB instance describe= d. > + /// If CpuIndex is set to 0, it indicats the HOB describes the CPU fro= m 0 to > + /// NumberOfCpus - 1. The HOB list may contains multiple this HOB > instances. > + /// Each HOB instances describe the information for CPU from CpuIndex = 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; 4. "ProcessorIndex". Please also update the comments to use "processor".