From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web11.9731.1636682971353125775 for ; Thu, 11 Nov 2021 18:09:31 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=EkT4W4Es; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: ray.ni@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10165"; a="233002126" X-IronPort-AV: E=Sophos;i="5.87,227,1631602800"; d="scan'208";a="233002126" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2021 18:09:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,227,1631602800"; d="scan'208";a="502277442" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga007.fm.intel.com with ESMTP; 11 Nov 2021 18:09:28 -0800 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 11 Nov 2021 18:09:28 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 11 Nov 2021 18:09:27 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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.12 via Frontend Transport; Thu, 11 Nov 2021 18:09:27 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.49) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 11 Nov 2021 18:09:27 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HCItJJcadH2kQwfw20+TLIPbzigeAGalS+8P1LL44Ei/tYs+KCu8JGh4mfPRy8c33Gf7UKHwToAyYzQWB34vVxHVmZV00pNy1oOCHPvMuSWzuP6PhArRiR215o0gNyaK8XweI+Ypz1EInmUPT3bX1CTpARrFURAqpAyo5oarJFqhTNtsUVpN9xk/gWM2urcBqGW3PUVvM7wSIA5gjfcfWxmFsbVwQmmeBpB8OpPuPfNHUlQVNgUBUE0IF1DccTN9WjIx5O5RR9rTipW8ZkUkt21ZOBFoMxt/wXb3Xilyiy40dd035kJcj16/KpanwBxzCgy+aLfvBlb7AOArpViv/w== 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=V//jx9F7DI+gQWF8WtCCuDDT35gJAHCkbx567LZ38Rg=; b=c0Hfx63gAMrj83DrSjH3E8H1RYnjB4UjPGqWKFgA7NIdrKkMWkcSLDRkY5a0ek5eb8+Aw4Z84UyYiaka3deU5sp88bCO04grZ8NR+Sdw2e56yDYS/0PT2Ne9Fe/iF3NprjVFxNwG3Tw3Nk7XPRs8ANoZXUrDp56PR1h/59BPapDl2Nr1qxi7xCsJtk9kMMO+KI2rruiUp7PNl0Yg7sjb333ezNAg0NpozHJYoXdn9zwolm9Pe5pgJg6M0BdNO/0z8ikM+1f2cuxKPttkyLEDu5QD/d1cLPI+eubf9V6WLcaQ1A4ZNZfjSCLOz+qMioO/IDL1ukUEiWAsO0zK0dQ1GA== 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=V//jx9F7DI+gQWF8WtCCuDDT35gJAHCkbx567LZ38Rg=; b=EkT4W4EsjMnwegqbYrBhLy10LyPO7UgBTrsoBEe1p6jBHVe3z5iApfV6VJdiDpBFxOkDvWI0PtK3SUnZVmvrvVJ+EjY1+reagyQ+0wSx9YMTLXO2Rc0tNmGNq25noAs06nlz71RPiOp45KJR9rJDcDnr/e5EmNg+vgcrRy45fNk= Received: from BN0PR11MB5696.namprd11.prod.outlook.com (2603:10b6:408:14b::11) by BN6PR11MB3956.namprd11.prod.outlook.com (2603:10b6:405:77::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16; Fri, 12 Nov 2021 02:09:25 +0000 Received: from BN0PR11MB5696.namprd11.prod.outlook.com ([fe80::317e:de35:e920:7778]) by BN0PR11MB5696.namprd11.prod.outlook.com ([fe80::317e:de35:e920:7778%3]) with mapi id 15.20.4669.013; Fri, 12 Nov 2021 02:09:25 +0000 From: "Ni, Ray" To: "devel@edk2.groups.io" , "brijesh.singh@amd.com" CC: James Bottomley , "Xu, Min M" , "Yao, Jiewen" , Tom Lendacky , "Justen, Jordan L" , Ard Biesheuvel , Erdem Aktas , "Michael Roth" , Gerd Hoffmann , "Kinney, Michael D" , Liming Gao , "Liu, Zhiguang" , "Kumar, Rahul1" , "Dong, Eric" Subject: Re: [edk2-devel] [PATCH v12 32/32] UefiCpuPkg/MpInitLib: Use SEV-SNP AP Creation NAE event to launch APs Thread-Topic: [edk2-devel] [PATCH v12 32/32] UefiCpuPkg/MpInitLib: Use SEV-SNP AP Creation NAE event to launch APs Thread-Index: AQHX1oCWuCmN7rkAK0id2Akf+defRKv/I5XA Date: Fri, 12 Nov 2021 02:09:25 +0000 Message-ID: References: <20211110221457.2397234-1-brijesh.singh@amd.com> <20211110221457.2397234-33-brijesh.singh@amd.com> In-Reply-To: <20211110221457.2397234-33-brijesh.singh@amd.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-office365-filtering-correlation-id: 550c8252-43b6-4469-d29d-08d9a5817365 x-ms-traffictypediagnostic: BN6PR11MB3956: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0lzmhdTRoL+zeJ7wPGj7tAhYpU8+8R3TGmyorIJysth0lwueNiGnuMzwpx1f4JGG7bg5CvPkSnCNRRcHW3izOxYJdoc4klKC6hlGH6oKTgL1/t9SYkrB2C4VR5PGMKLMKUDD/EgGE09Cyy/4IMXlnXYf2lTgaCoH2cjkZCDlDTDELshlmveh69GcM/h3PGOsZMvHotthNt4fwFnqS++6oIO4p6ZyAJPc2TLLhXfsaQ8BxtfLo87ZA1QIPYYs/r5MyqUtNh6+oFwjGavmJTVubgHYf0Os3yT/ufGFQEvbp64YmQkgQBitJ5anXe5mpfuQAJD7GTZ8NaxziB2LfLRrfXkf6ujdEtsocAr1B605g0dpTMTQ+xYI9hoibaGPTIh4yIr/UgV0b7RQeyKhIbfXysFlNrl9//od1HIqB91Ji4iEiWrZhRCxiBgSpKaIcfoeaEqkK09NWxuMIjyCRNU23CcKf4GeZz75gRrajM65VH++pYFWf4rsyj0u+1UtBFXnPKS0fhWPlhIuezsZcunMo9zQfkqY+snv3SpiXZdnGjrzfY8EAnhIQsS7XP9zm878p1GGvb10tmLmwEoMNbDbrRxDObhUqPn9so+8C2o/8y4FaqA3+rHw43WLKSvaJl925zSq5sLrkdjuiXGJ6+iKPeBUIufkBJ3eCxgRQR3uJKSJUabIyc6BLMA5AQE9QZm2rCfPPc8DG767cG1YzpgTZw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN0PR11MB5696.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(6029001)(366004)(5660300002)(7696005)(8936002)(66946007)(64756008)(66556008)(66476007)(8676002)(4326008)(26005)(38100700002)(2906002)(122000001)(76116006)(186003)(52536014)(66446008)(54906003)(508600001)(110136005)(38070700005)(55016002)(82960400001)(9686003)(6506007)(107886003)(71200400001)(86362001)(316002)(33656002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?iHTPfZjxEnalIXaFYxWiawxukpLGcusqOXteXm8vTuArQtfq6ihlzBMs+Aym?= =?us-ascii?Q?drr0wVIXfqIk9X00akOHYZJ7acKn7AAPjU/UFtDXShrIeA5SjfROW+PwH+md?= =?us-ascii?Q?6KizALxgXfYVOLAxm4ya4AIj+jJrsaX6bedQZCyhhkKWP3Bq+GjygOMTC07V?= =?us-ascii?Q?53k5DSlVztjjabFWgSB14A+pnS9Kcm7gzgU+IbEDQD2S9QeeVIle+dkGGSnD?= =?us-ascii?Q?wFJ/1DQh5tL9SRDH9ty7+Wwnp0DPtoFajlDdt0W2l0K23TLhLu0twePvkYGc?= =?us-ascii?Q?YkK3mwrjZf1fvuoc7USSKbnhJBl7OcaQmA51YcYl/H/8bddCq4vfHOSQNCYe?= =?us-ascii?Q?574ZOFR/Ww9ONMEQ++dGtUtdUCkKfx60Vpbd6R+aPqnTLBWRIlvVbVgII+GY?= =?us-ascii?Q?MfkJQgnr1Iw47IkRphn4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7iHthwmIM8gEyikYJMo0jJ2W+K6hrYD+mboqjZYgmVF80rlXCpKjVmXV3b?= =?us-ascii?Q?g8VT+0wlX690KuvX9Nk/IvIreZceY8qPfzckvSG6FTcsvFIOrCkxLGpunpyh?= =?us-ascii?Q?iTH57SqKbIcfDhQN0HpKkpumaBB2IRBQdFxXXRZ7BwdRQd1txrbcY49n/HQ+?= =?us-ascii?Q?RBFH+5xmn3siLvz0ow39Tl9ISYUjmwsxB0zJiGk2o8kviC/JEFgrTRlBl6wv?= =?us-ascii?Q?NLD/JDxoZ9zKFkWcBb7bWn3iyD5yK6KDMUB758MpIT1kHw80LxxBCsY1eC3+?= =?us-ascii?Q?5oIrvT1nuUh9SoHL/YSFz/M=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN0PR11MB5696.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 550c8252-43b6-4469-d29d-08d9a5817365 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2021 02:09:25.2733 (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: 4woSNbKjdQJPwPFtNaMJ6mM0se/rH+hyegDqRQf8v7d2ub3eKOPJ5sO6S5FATmjGJz0zI2tVvYKc/wFi9S1eLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB3956 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 Acked-by: Ray Ni 3 comments: 1. It seems to me that the latest SevSnp doesn't need much special handling= in AP waking up flow. Is there a plan to drop the old SevEs so that the MpInitLib logic can = have a chance to be back to normal? > [Sources.IA32] > + Ia32/AmdSev.c > Ia32/MpFuncs.nasm >=20 > [Sources.X64] > + X64/AmdSev.c > X64/MpFuncs.nasm 2. I am not sure if it's a good idea that "THREE" files share the same name= . Any objections from others? > @@ -1056,9 +1057,12 @@ AllocateResetVector ( > ); > // > // The AP reset stack is only used by SEV-ES guests. Do not allocate= it > - // if SEV-ES is not enabled. > + // if SEV-ES is not enabled. An SEV-SNP guest is also considered > + // an SEV-ES guest, but uses a different method of AP startup, elimi= nating > + // the need for the allocation. > // > - if (ConfidentialComputingGuestHas (CCAttrAmdSevEs)) { > + if (ConfidentialComputingGuestHas (CCAttrAmdSevEs) && > + !ConfidentialComputingGuestHas (CCAttrAmdSevSnp)) { 3. Can you use "CpuMpData->UseSevEsAPMethod" in above if check? =20