From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web12.9656.1639655794848149880 for ; Thu, 16 Dec 2021 03:56:35 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=L7IO5LYf; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639655794; x=1671191794; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=E33x815+MRKwtyFhV6B+2gfgNYT5cUcB4FGj6RmBwUI=; b=L7IO5LYf584q1xl1t6mbaCg/vCLl3fpDoGdhx/oYr9d4L6OCEOsDq1zQ WGMmvNPJJ6cQrgBKuDG5KS7UU2hF/nW4Pn8hBTA+73s9TxWclDn7NJfk7 K29vzvrhMEsJr78Qy3BUtXsddynT+adrddHLn/QPB8cu58fs8SThqsfmR jE7vtAkvjzOcCX8g1QQcI49LvCuXZftetxQQgCTwY0FSF7SUaTXRpXv5C yfwBt5feagxr0cE1umKI79HgdxVF7SZiMNxNuKRGCcSFP8I2HhBXIm98a jau+Ooq/Ks6Yc02+V7gmIK6Gm5lLIC+sCClzh+3wuFHIr8ADJxK9sup/w A==; X-IronPort-AV: E=McAfee;i="6200,9189,10199"; a="239692102" X-IronPort-AV: E=Sophos;i="5.88,211,1635231600"; d="scan'208";a="239692102" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2021 03:56:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,211,1635231600"; d="scan'208";a="466017967" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga006.jf.intel.com with ESMTP; 16 Dec 2021 03:56:33 -0800 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 16 Dec 2021 03:56:32 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Thu, 16 Dec 2021 03:56:32 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.48) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Thu, 16 Dec 2021 03:56:32 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cBh8/0Hejg3nTZkJoQs+5GFonGMAgDg3sEcNLHH4Srjm+r9nrd5j2sbotHLYXnV4fepsTzPgrZi9LYNbnaJwWcoz23AKE0qqIsTJAetLz6dCrc9uGebr1jAXOvCAaYHSvzSFFxJZNbTeUMPDBr5bNqn7wSVdt3WAP/HVIibkqFUTdIKEyOqvjP5/1dIJ1b9ihB3L4CFDMCWEa/JY3gLz3ejZaGbLT1dSn5xGshw0MApfcovZuvag6OJpLCvtjLLGF8qnXwOe+9rdiUhje+XUnt7Ak5lu39OdDhHKamodULBMrOiJWTAVHKCUU46oAGa6oIAQkPYGHpH+wX/GSz7w6Q== 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=fllH88Fe6oip1Z8zmmsBHKhakIfThbMAcVwlrxShfpE=; b=haJh09jdxZiIBLDydeh++V8s/lcMsD1xMMYC/6lfqNmb/npx76nB/dqkChIfB0wux4r55+snXpENP3azvj9IPjiXT7SXS0uzx45L9fzCN7xW0RZuVeDNryL/ibrLuZiOgoBMq5XeFtXoRPUSVNRhKmdX8VPpWPaif4aRi1M/2P2ui9myYq6lLJ4nN22GWhSOwrJTjCo0ABD/y7XcPOY9qc0kJ+19dbE/0wgphnSwrYR9X7iE9tSvU7J2BKFKYLjWboDpJ8/zL3oc77GLewQH5HTjSgLQlHnc/Kwa2yCI3X67tCAzyXSK5yWwgUoV5cql54TP0Df/XhhncnCs6iDocw== 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 PH0PR11MB5064.namprd11.prod.outlook.com (2603:10b6:510:3b::15) by PH0PR11MB4886.namprd11.prod.outlook.com (2603:10b6:510:33::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.14; Thu, 16 Dec 2021 11:56:31 +0000 Received: from PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::fd42:b334:5030:af8d]) by PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::fd42:b334:5030:af8d%6]) with mapi id 15.20.4778.018; Thu, 16 Dec 2021 11:56:31 +0000 From: "Min Xu" To: Gerd Hoffmann CC: "devel@edk2.groups.io" , "Kinney, Michael D" , Brijesh Singh , "Aktas, Erdem" , James Bottomley , "Yao, Jiewen" , Tom Lendacky Subject: Re: [PATCH 06/10] OvmfPkg: Add TdxStartupLib Thread-Topic: [PATCH 06/10] OvmfPkg: Add TdxStartupLib Thread-Index: AQHX8PBm3y4jVsICTkKzHW+y/ZV866wzVb4AgAGvF6A= Date: Thu, 16 Dec 2021 11:56:31 +0000 Message-ID: References: <20211214134126.869-1-min.m.xu@intel.com> <20211214134126.869-7-min.m.xu@intel.com> <20211215100914.4vq24pkjrhmqjdg4@sirius.home.kraxel.org> In-Reply-To: <20211215100914.4vq24pkjrhmqjdg4@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: 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: 0b15294f-f87c-45cd-607f-08d9c08b19de x-ms-traffictypediagnostic: PH0PR11MB4886:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: H8V/6rgFtfG903O4KEknQlBYCr/2UL+0LfOaLXddpsI0j4f+jWUKGj62bvpUCpZ1g+stiBbUpFn9lT3nmqQQZgoqgZxOAgyE2yOCzFC+q2v2lX1ApftcieAdycw6P68mJfKhGXC+SD8nuk/7zAnP1j24CtmIKW+KpT35GN9AGRjVvOJAGDEuke7QdC8WvtsacjkU6zzOqFYjcLQWTWkbIIeg2UntkFqvgsI2muhJK4s1/BJESCXeAcYY30CKagNEmHG8XOwN8bYOyq0vboFuxH5Q/ZyBxuNYXJJAM2esDvQYd650GaerILO2wl2smoNYo3qzuhNmHJCcW1ZMmPVfKPRy2qRebZ8s4qH/7njYCVfEb1ctz4nVoQ9E3bCQf4Ltd9O6QuqgmpzY0DQZ9jCelNbtV2ZAMUKE0kfETIo5U/Q6OWhX8Opjs60lsWHm4i1MWWqPD8U4JD05GSxCTpV1k0VmaKP0aSW7r4POmj6zKmm5aUniWI05ccOpW+f7Gi/uVpvcIgYRMo4jJRweAERPJXgpURMf/kQlM0CsR4EXtfPy+WzXSBJkeQ1THQCHEWB36IgSegDC10Mk3gjilCBjMW2yV/yezV+KjdxSblKQYh8XT6r5W+PNpQNMdDB82PWmIelcW522tJAB0MjOXf5NqwAYKrCDGNCXgVZ9ujcUacBhE35xuv135DV8hWHvOOYgOI74zm61YDspQ5advNasLw== 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:(366004)(64756008)(66946007)(76116006)(38100700002)(122000001)(66476007)(86362001)(66556008)(9686003)(38070700005)(52536014)(66446008)(6506007)(2906002)(4326008)(83380400001)(316002)(55016003)(82960400001)(33656002)(508600001)(54906003)(71200400001)(186003)(26005)(5660300002)(6916009)(8676002)(19627235002)(8936002)(7696005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xC0fYT7rFJGHOtMbN4GN70Bgr6rtA9V/6YqJ0726sFkp/FxaN9y/xvGjIsEg?= =?us-ascii?Q?6/UxD5yXPA2Cu4OJKmV8nNeuGRMv031ndxSGQnBYEqeTI77ERe+pN8eoSePd?= =?us-ascii?Q?WHngS0uVs6PJVvKg9hUtiHUKEgFr69vL+WQ+2K45uzXHwqLPIk7XlCpNoU9d?= =?us-ascii?Q?4eSieOjj8ATkpL+yvAo9LO/YY9rn6B47Vfz00xNJq1Gg/kO8hf8lzW6NEWmy?= =?us-ascii?Q?o8a4XlVEd94BLyVUtwDb+oDkbI0kKHLYDfgX9Hcq/slOZ+7c4ekX1X0eWZcG?= =?us-ascii?Q?J0Awl0XoL1h4sqafVz2VeCgkYf9sv56ADYTHP3Nz0KkI98GYaRRW2pw6y286?= =?us-ascii?Q?9ZW7YTy/OAAF/3uJ6zX9shxZl1jLh/sP6eqnBgK9BsBSFebvsZNopLB6SPFh?= =?us-ascii?Q?5FsI4Aw+R1DHd6IQHRwA9t5Iv0FxB6nSuKH17H7BK4uu4Jg4RA+WWe2Ogzw+?= =?us-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kMKQ/KjKZMSF+2JTQIy1?= =?us-ascii?Q?ohUdbSSBpWnEhSBqjkRbxYID2n3vGmqC/RU6WbQjD1BOPwxt4L6XhHxR9JEj?= =?us-ascii?Q?+GlJO2D4SWAhWPYqcax2SMgbuKqcpv4KkFVWYBWo+2EMYSdMtMM4peDws/5Z?= =?us-ascii?Q?huz/nDT3WdAMDZtEKZYqvKAY2xXV2VA1s3XBQI4v009TF4TJDFNYk5/xb0ff?= =?us-ascii?Q?EDAF/HNu8RpaeidP3SSKKlPd1cPoNbuaK8XBVVDkOtRYpR0cQxVXC9WjqKY8?= =?us-ascii?Q?PEsm/1riwWZc4E0TTYqeDjw=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: 0b15294f-f87c-45cd-607f-08d9c08b19de X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2021 11:56:31.5850 (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: qWwDLiJpPko1wEIxZemEsE6OOgyZOBuyFfSe5ulkgvKHrtQrKG5p0ssZKNY0wxApoVsjidekyRZGYZtWaaEOfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4886 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 December 15, 2021 6:09 PM, Gerd Hoffmann wrote: > > + PageTables =3D 0; > > + if (FeaturePcdGet (PcdDxeIplBuildPageTables)) { >=20 > Can this ever be false in a x64 build? You're right. This cannot be false in X64 build. I will refactor it in the= next version. >=20 > > +EFI_STATUS > > +FindDxeCore ( > > + IN INTN FvInstance, > > + IN OUT EFI_PEI_FILE_HANDLE *FileHandle > > + ) > > +{ >=20 > > + if (FvInstance !=3D -1) { > > + // > > + // Caller passed in a specific FV to try, so only try that one > > + // > [ ... ] > > + } else { > > + // Assume the FV that contains the SEC (our code) also contains a > compressed FV. >=20 > This branch never runs, FvInstance is explicity set to 1 by the caller. Thanks for reminder. It will be fixed in the next version. >=20 > > +++ b/OvmfPkg/IntelTdx/TdxStartupLib/X64/PageTables.h >=20 > There is OvmfPkg/Include/IndustryStandard/PageTable.h >=20 > > +VOID > > +Split2MPageTo4K ( >=20 > Yet another copy of this. Please don't. I will figure out a Page walker lib so that these duplicated code can be av= oided. Thanks for reminder. Thanks Min