From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web08.4395.1634880234342372878 for ; Thu, 21 Oct 2021 22:23:55 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=v1+9RtM9; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: min.m.xu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10144"; a="209330015" X-IronPort-AV: E=Sophos;i="5.87,171,1631602800"; d="scan'208";a="209330015" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2021 22:23:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,171,1631602800"; d="scan'208";a="553136432" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga004.fm.intel.com with ESMTP; 21 Oct 2021 22:23:52 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) 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.2242.12; Thu, 21 Oct 2021 22:23:52 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 21 Oct 2021 22:23:52 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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.2242.12 via Frontend Transport; Thu, 21 Oct 2021 22:23:51 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.175) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 21 Oct 2021 22:23:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IrduaV8r3uiQO9qHBqRUA3ip0eYyY76ydHzmSDepczT7iCFl37T9XRswWsOvmJN2VM2LnOmUwZbplDgj3VHKNhAHWfCQ6oSaNRqrXKIRtLJ1zeH8G1c7p0ix6sFN4VelHDozP3Ef9rv5aTIy2+D/1dMou99dJ0BvAzMFaKssucm4X7D0RxPzl3A88nu01aD/e5FjSPbZYFgXnGR1YBBrICcvmNkFDd+o6z3mhaSZR3Ug6gavttZ8xjPmam83RFeCSqhTOec1rX6YEi/wLJ3tBVe64vpUfPLVr45HmeCefH+CdrxOQduTtpnAfWlM6YD631K1L0n3ENtOHRgpBpVSRA== 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=OI1pmgjWZ+7sxJFkeGW0bvvUJ73slxOgWAqNlL0Ynf8=; b=mgSs0tTLiGuGQSekoz8zb7fHZeIiDPDR45+TF4EsDBqs2HQy0pk6L7YGeKC2o8hxedVrMIGtedfoRI1H0OY4O8jRdOGcHaO8BdJBFkHRLCZ5Cbh+vZCpL1SV+4dEXFwbr2Ee/041RMcj/wLiDpZ7hUBPFuCIcDooJOzQVSuJGB/h6SGKlMrDFlHwpveXc1gKdzhFPJnTtGico+6q3004VtpAsPfFakm5fTsj4N2tUnaoRuT+lvg712XL8I2Y4s62p83ux8qixgp0y3QeSYoFof30wghFeQ8IqJGCbinSVqyN5AK90BYvAAGdivhM21DVrhJlDcKqW968DHh9f9EoQg== 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=OI1pmgjWZ+7sxJFkeGW0bvvUJ73slxOgWAqNlL0Ynf8=; b=v1+9RtM98/XGIcpGhwBbLgmYGwRlUWbW1+RZGduUML8dlbtMxu2yXm9A1rp77PkVmDXuBZwJ3+SAr5VPccxu88h9r22mXlqKjSdHiFCr2QccGaiCXgnjMYsHoX8AT59dEfPe4mYt/ESXCilcLKNxg81rhSK0I+W4LfYVcAzTRZs= Received: from PH0PR11MB5064.namprd11.prod.outlook.com (2603:10b6:510:3b::15) by PH0PR11MB5078.namprd11.prod.outlook.com (2603:10b6:510:3e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.18; Fri, 22 Oct 2021 05:23:50 +0000 Received: from PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::7deb:6c36:73c2:f0d4]) by PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::7deb:6c36:73c2:f0d4%3]) with mapi id 15.20.4628.018; Fri, 22 Oct 2021 05:23:50 +0000 From: "Min Xu" To: Gerd Hoffmann CC: "devel@edk2.groups.io" , "Kinney, Michael D" , Liming Gao , "Liu, Zhiguang" , Brijesh Singh , Erdem Aktas , James Bottomley , "Yao, Jiewen" , Tom Lendacky Subject: Re: [edk2-devel] [PATCH V2 06/28] MdePkg: Update BaseIoLibIntrinsicSev to support Tdx Thread-Topic: [edk2-devel] [PATCH V2 06/28] MdePkg: Update BaseIoLibIntrinsicSev to support Tdx Thread-Index: AQHXuZq9J2lnNAejJ0OJzWlcSukajavPLkiAgAG44dCAASDXgIAMjBcw Date: Fri, 22 Oct 2021 05:23:50 +0000 Message-ID: References: <78bc0164be0e6adb1edf4454bdc3aaf1d55a2771.1633401643.git.min.m.xu@intel.com> <20211012100555.4sykhkinx3fc6gak@sirius.home.kraxel.org> <20211014053741.ev2wd7hrzkrdatln@sirius.home.kraxel.org> In-Reply-To: <20211014053741.ev2wd7hrzkrdatln@sirius.home.kraxel.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f6c13aa3-ad79-4428-0628-08d9951c21b3 x-ms-traffictypediagnostic: PH0PR11MB5078: 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: UB9ZkFAYB9Yw3sVS0F49n8eOQMme08r724OXEDUeDvy9izM/w0OiF5tvO+jC5Fif2Ho0mXxY5PrLCAPd9YKIMoPRw7j6JFyvha5YJWmyUAgc9tNLL/pMQ0vK4EQs90QM+ZIxiODGPEOjyHlArpGoVM9UGDu/WwewEDYXXYfrIecJSmF3v139qYq11ipPHO0b1VYlrI4AsoGSiHV6ujQRHibYUD4o9VfJWuMtRFd2UTkMpO9lbeQMdm8472XKzA3T0kxMTypGmM7yCeet9x/GA7PepYYtI+H4UptkY+784pGEjagcjvbFBqG6nI2Qvqd1YwvpQWLZaYHWdGnwF7pNCyjCxY4BAmtTXsf/+mQcxkjwvxxrQUJCoOn9hvupqHZTsL1lpsgO6vBwHDT5owplQTXHxgbQ714dkPLOJ7B33iTTgQvulRP+vjeEJsfHh2MDoXv42BkeuynV0BJ2Mt2za5xz3/f+eyzZMT5wS1POGYCAvEtMpcaauMhjvslmml7Pv4C4n+Sn0qmWnIDGyAfBIU3kA4xeBSagLX8AH1wHDdtzbGoKHvbt8qb2Lo+T0UqxhUs35HQTcZOaArzjSTWcC44x2EZswRBDDeU78HF5eCVfAZbpz+SBeVe/yBipz0z0wxf7a9O3biadHgCGRRFzG3AKaNjDSrGOI67FNNU/AOjT99syKJugxKpQz1App7/96Y0xJCd1kx5CMVfs7govmA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB5064.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(6029001)(366004)(66556008)(6916009)(122000001)(38100700002)(33656002)(54906003)(52536014)(26005)(66446008)(5660300002)(76116006)(4326008)(7696005)(2906002)(64756008)(508600001)(38070700005)(15650500001)(186003)(71200400001)(8936002)(66476007)(8676002)(83380400001)(316002)(9686003)(82960400001)(6506007)(86362001)(66946007)(55016002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?6de0SC6imt0kQNcbI9ilcM4m/eBdf1Kj57EluNulboD/CFF8U0xglktQqlOk?= =?us-ascii?Q?xZUs/FCRZQT153XMMzdvMhXb0EEGbze1tOeCpz5tp0Zd9FkOigEocCdt9rMv?= =?us-ascii?Q?+yXnlNWmejO2MvMmfVy8RDAyuDyIrWJpjlznCYOxGgTvVwPtStiis99DOr9n?= =?us-ascii?Q?9em/Ag9gVrdgCIyWNSJ3nJZZqDHNxpJd6+XlnPmJSMffIMZlcmgZXYLdonUa?= =?us-ascii?Q?+klpLZHCz+8QSn19hdDd0B+t57fkrIZFoH4LQbJV9tXkkPrguK/qIswJ9NXf?= =?us-ascii?Q?Ku3Sw5b/Z5rT+uNRRl4W7R3yhQCb+R9RBcQyZm5qeojZfEsMK/NLFsj6QVyy?= =?us-ascii?Q?9baJn1EVmnbpt8Vrfsbo1QaRLCOpVxV4EyNAiYv9RfOFuRFF2Zj8TWoP6Hhq?= =?us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/x0Ww08gedXc2huFA?= =?us-ascii?Q?cjxhzQ0iPJZzvLZ7mVhT5Mm6eE8CrX8/c8REszwn5gxTOiKr/3KlGplmnQkj?= =?us-ascii?Q?dDKpiGMwEigj0IgVYrODM8q6fh7GplOqfPCQGRVfA7bKv8m8+nUjeTO2AeUT?= =?us-ascii?Q?bEjvB8kw0hA=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5064.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f6c13aa3-ad79-4428-0628-08d9951c21b3 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2021 05:23:50.5594 (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: min.m.xu@intel.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5078 Return-Path: min.m.xu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On October 14, 2021 1:38 PM, Gerd Hoffmann wrote: > > > Calling CPUID should not be needed, we have a new fancy > > > ConfidentialComputing PCD for that now. > > The gUefiCpuPkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr is > defined in UefiCpuPkg. While BaseIoLibIntrinsicSev is in MdePkg. > > If the ConfidentialComputing PCD is used, then UefiCpuPkg has to be > included in BaseIoLibIntrinsicSev.inf. > > I check all the *.inf under MdePkg but no one *.inf include UefiCpuPkg. > > I am not sure if UefiCpuPkg can be included in BaseIoLibIntrinsicSev.in= f. >=20 > Hmm, I guess we should move the pcd then so it cam be used more widely. > Confidential computing has an impact beyond just cpu, it's also memory, i= o > and more. >=20 > > > Maybe that's something to cleanup for amd (Brijesh?) beforehand, so > > > the structure is there already and the tdx patches just need to add t= he > "case tdx:" > > > bits. > > Tdx patches can first use above structure. AMD can update it later. Eit= her > way is ok. >=20 > That'll work too, I don't care much about the ordering. >=20 Hi, Gerd I revisit this comments and I think we cannot use the PCD in BaseIoLib to determine Tdx or SEV or legacy guest. It is because BaseIoLib may be called in SEC phase in which the PCD (it is set in PlatformPei) is not available t= hen. That's why CPUID(0x21) is used in used in BaseIoLib to probe tdx guest. Thanks. Min