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.web12.10693.1591923824156092885 for ; Thu, 11 Jun 2020 18:03:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ZY5Bq6mC; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: eric.dong@intel.com) IronPort-SDR: 2s2ImP0lYw/g9tvy387wHvCQnuLyVWzQ2L6ZB3/czeBEnzEGn77ARmIzkIIXAbsEgHLDkFaj8A 0oIKR03hvR3Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2020 18:03:43 -0700 IronPort-SDR: kgKxpHD8JRPCqbUkyLiZPm3fi+4x7PgBm862owK+Whk/2N9Lo0pEoDf/AatwTDNYh4ZF84amIG XbM71vK9xZRQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,501,1583222400"; d="scan'208";a="271758622" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 11 Jun 2020 18:03:42 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 11 Jun 2020 18:03:41 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 11 Jun 2020 18:03:41 -0700 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (104.47.46.56) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 11 Jun 2020 18:03:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jMCuQq/au3MwvEopsD/pP8DUK2HqAbRrJUBfoGEiRcmFOeTYZ/JXO83WYfeRxnTv8QvKkG5HcLVDGF2FXoKdreyT0bTPoznRt5S5Zg8FWozx33LE99gW0lAWcA4+X/qFwzG9W3Q9dcmdL5z/0pZsDB7tq+gFGNFtStGsqp1lyOv/0Zhqp9OxoEQetGodYKcALJmAmprKLkIvRgVLmfX7zCt+7uKS/oZqNRLH8TDBjqBz/GvDFgjZW7jgCxy+YPPucyEjEyaZGcqJ4GI+XZm9d0Tr5sfQBTo1Pygfqq27yrbwhjK+71UkBYClPQEUXrJNhSDl9onXTo858aX9AZn/2A== 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=m751/n13aGBOO1D5aEo+CsSn7hVFDNV3Kmtdqs2QKOw=; b=BoNASwpWy08X3lLoUX9yVCEXCqy0SYR9wu9w4atAKjx1Yz9u3pOZ19WR3PA221hcdnK9AeJStK09CgZrXaWtvPr7pfS4fpPb6fVM57M7CLWYYaAM5sH1iThsB/YZVEOUiUfgeS2E39PKAM3WVE70nVcytDXV/2D+QfCdroO+9EPsm47ZsgiJ8YtLu0KEhhMxONXjUiafXs7rqK4GiKagdkH9pAfK8dky1XpuVvTtlQgokO/3XBt/kiFYRO78n0Ou7/B3iHw2opugetQN0uw3U2JUef4m6OkOd0nBPykX6lpRmxj202y/waYmR9HEQGv41ViV74Uxf/g29zY8BYPDNg== 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=m751/n13aGBOO1D5aEo+CsSn7hVFDNV3Kmtdqs2QKOw=; b=ZY5Bq6mC8TPhH2uJEPZlVPpvGlQW5cYIoHFqC1epjpOrJmFSmlBp8vmv71trhRs5cG9wpjUSih1tfhuNWn85vnq5q4+SCRzoQVIA7YZyMSMOX4qyZhhq8qnIRU7jU26JPAPYEeCXsZLciNQe0WWo0oBezXtEtcdQDa/ga2Aj6KM= Received: from DM6PR11MB3274.namprd11.prod.outlook.com (2603:10b6:5:b::26) by DM5PR11MB1289.namprd11.prod.outlook.com (2603:10b6:3:b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.18; Fri, 12 Jun 2020 01:03:37 +0000 Received: from DM6PR11MB3274.namprd11.prod.outlook.com ([fe80::cc01:6f05:1402:e7d7]) by DM6PR11MB3274.namprd11.prod.outlook.com ([fe80::cc01:6f05:1402:e7d7%6]) with mapi id 15.20.3088.019; Fri, 12 Jun 2020 01:03:37 +0000 From: "Dong, Eric" To: Tom Lendacky , "devel@edk2.groups.io" CC: Brijesh Singh , Ard Biesheuvel , "Justen, Jordan L" , Laszlo Ersek , "Gao, Liming" , "Kinney, Michael D" , "Ni, Ray" Subject: Re: [PATCH v9 41/46] UefiCpuPkg/MpInitLib: Add CPU MP data flag to indicate if SEV-ES is enabled Thread-Topic: [PATCH v9 41/46] UefiCpuPkg/MpInitLib: Add CPU MP data flag to indicate if SEV-ES is enabled Thread-Index: AQHWOz1mLIxKL1GN90mX3L9wH2K2SKjUNBQg Date: Fri, 12 Jun 2020 01:03:37 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.52.210] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dfa111e6-8dfe-48ff-13a5-08d80e6c7053 x-ms-traffictypediagnostic: DM5PR11MB1289: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 0432A04947 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: A2ZhMnopAP1TUI3YExDb4Su55kzmmMBEXXYJ6pxoLXXqLCj3K3kLN7+zjY6egQs44VWA6KhRLP/EfPQPad7U5wGkV9SapDOmmYE8R2C7YMiY+l+JawiZ92/ikBw3GvbfJcHurq6egWowXN0kd6LFBeQ2s3wNfJoPpkx+ciK0DOvCvh0QdfAeDlRGMRGST71bvQzS+GJoMmpFdaHRUdsrDCUEl+0dzUMU6VG5kDRQxXRfRoJa7nxKyxOiXCUdr6266fLX5iz+KwUe8SMBqqL4gPgA+mzQ3FKUxjy/jEzC9Tjt+H0Mft4japO3JrS6/fx34Bx8Ra+BsebDJ7fg+Zj16eLxq2R2yudKHYbIIlnsq4vWEXLD6re5irkB4BUYWouoW9ob5tKNHjEwI5Wdv0kMmQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB3274.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(6029001)(346002)(136003)(376002)(39860400002)(396003)(366004)(7696005)(5660300002)(52536014)(71200400001)(26005)(64756008)(66556008)(76116006)(83380400001)(33656002)(86362001)(66446008)(66946007)(6506007)(53546011)(66476007)(186003)(110136005)(9686003)(55016002)(316002)(8936002)(966005)(54906003)(107886003)(8676002)(2906002)(4326008)(478600001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: Awh8idezVCFG6do6bw/cfxc8Pwxq2o50kALwhcY3Bd1DEOvf+adMivPZRpKQ7Gt0hT1qmJY5MUQSzfxALOCaOIvIGycMIZn2mEZEErPTKxImH2ly31dOd1Cy5zbf0HxzdRFWaEwetY7c/LyzmHI9U/ttXfFHLQ4oNCBN7dt9p+HgP3dEV2psB5zkPNh+f0nnEaAMiepKh7gTWAMtz0fvX6imiD5pbJ9wMo8JG1fwnAl4Vcqs3q5iiogyhH6i3CbkkARPa1f/aWTamIlqRpymXSWzdZWUpD35F3IT0VwgVefCgeT5oU9tnAxiUE3whTqsSYriYOAB9akiZFY8QdQJde0No1QJb+eq5Q+ySTO1UucNLkpqsDWPpE1qdQFuVXCh8KNPJ0BXkyIJX3wqa2dOHS/2hzLHszqD6pgcO4eZOW8w3E3j5QfiG/2ACpTW/fYNePPOqX/dxsJngI42OkWKczEY9gDHFYx51bQCvpFLW5SCvy3GsYFd63zb3GTrGllO MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: dfa111e6-8dfe-48ff-13a5-08d80e6c7053 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jun 2020 01:03:37.5835 (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: JDSlbyKYNrcE3q79SLUYo0hDOKiiR9njizFVG0D5xG7MCyd3IBZlVfkTdii7j4ZLhwd92XkbWN3E4c2yTEhnbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1289 Return-Path: eric.dong@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Dong Thanks, Eric > -----Original Message----- > From: Tom Lendacky > Sent: Friday, June 5, 2020 9:28 PM > To: devel@edk2.groups.io > Cc: Brijesh Singh ; Ard Biesheuvel > ; Dong, Eric ; Justen, > Jordan L ; Laszlo Ersek ; > Gao, Liming ; Kinney, Michael D > ; Ni, Ray > Subject: [PATCH v9 41/46] UefiCpuPkg/MpInitLib: Add CPU MP data flag to > indicate if SEV-ES is enabled >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2198 >=20 > When starting APs in an SMP configuration, the AP needs to know if it is > running as an SEV-ES guest in order to assign a GHCB page. >=20 > Add a field to the CPU_MP_DATA structure that will indicate if SEV-ES is > enabled. This new field is set during MP library initialization with the > PCD value PcdSevEsIsEnabled. This flag can then be used to determine if > SEV-ES is enabled. >=20 > Cc: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > Signed-off-by: Tom Lendacky > --- > UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 1 + > UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 1 + > UefiCpuPkg/Library/MpInitLib/MpLib.h | 2 ++ > UefiCpuPkg/Library/MpInitLib/MpLib.c | 1 + > 4 files changed, 5 insertions(+) >=20 > diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf > b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf > index 9907f4157b09..583276595619 100644 > --- a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf > +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf > @@ -71,4 +71,5 @@ [Pcd] > gUefiCpuPkgTokenSpaceGuid.PcdCpuApLoopMode #= # > CONSUMES >=20 > gUefiCpuPkgTokenSpaceGuid.PcdCpuApTargetCstate #= # > SOMETIMES_CONSUMES >=20 >=20 > gUefiCpuPkgTokenSpaceGuid.PcdCpuApStatusCheckIntervalInMicroSeconds > ## CONSUMES >=20 > + gUefiCpuPkgTokenSpaceGuid.PcdSevEsIsEnabled #= # > CONSUMES >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard #= # > CONSUMES >=20 > diff --git a/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf > b/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf > index 89ee9a79d8c5..4b3d39fbf36c 100644 > --- a/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf > +++ b/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf > @@ -61,6 +61,7 @@ [Pcd] > gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchRegionSize ## > CONSUMES >=20 > gUefiCpuPkgTokenSpaceGuid.PcdCpuApLoopMode ## > CONSUMES >=20 > gUefiCpuPkgTokenSpaceGuid.PcdCpuApTargetCstate ## > SOMETIMES_CONSUMES >=20 > + gUefiCpuPkgTokenSpaceGuid.PcdSevEsIsEnabled ## > CONSUMES >=20 >=20 >=20 > [Ppis] >=20 > gEdkiiPeiShadowMicrocodePpiGuid ## SOMETIMES_CONSUMES >=20 > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.h > b/UefiCpuPkg/Library/MpInitLib/MpLib.h > index a8ca03efb8e3..5b46c295b6b2 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.h > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h > @@ -276,6 +276,8 @@ struct _CPU_MP_DATA { > // driver. >=20 > // >=20 > BOOLEAN WakeUpByInitSipiSipi; >=20 > + >=20 > + BOOLEAN SevEsIsEnabled; >=20 > }; >=20 >=20 >=20 > extern EFI_GUID mCpuInitMpLibHobGuid; >=20 > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c > b/UefiCpuPkg/Library/MpInitLib/MpLib.c > index ab7a8ed6633a..a8b605f569bf 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c > @@ -1727,6 +1727,7 @@ MpInitLibInitialize ( > CpuMpData->CpuData =3D (CPU_AP_DATA *) (CpuMpData + 1); >=20 > CpuMpData->CpuInfoInHob =3D (UINT64) (UINTN) (CpuMpData->CpuData > + MaxLogicalProcessorNumber); >=20 > InitializeSpinLock(&CpuMpData->MpLock); >=20 > + CpuMpData->SevEsIsEnabled =3D PcdGetBool (PcdSevEsIsEnabled); >=20 >=20 >=20 > // >=20 > // Make sure no memory usage outside of the allocated buffer. >=20 > -- > 2.27.0