From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web09.1607.1645576465528988193 for ; Tue, 22 Feb 2022 16:34:25 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=j0huHrTR; spf=pass (domain: intel.com, ip: 192.55.52.88, 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=1645576465; x=1677112465; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=8PvDw+g+3/2WJjENMnXVrZn/nOfDbOycuD1rj6b6AkU=; b=j0huHrTRABIDvM77I5Ecz+Y4MTRLpxZV53jRwEnA6UEFf50xhDngH7gZ drN0aSKIqDVQksZJrMbsKve0gXCMrk3Tkz0oXByOBX1Mx/6jDVi+5aBYu IyWwUp+/cOOiBXW+XSRMuGcRFaFPN76opVzp2Hz2f+YxQt+ZX/7/jmIvE NiA5qvelLk+Okq0E/oHcgTWVFdLoOPjS98TocvKac8pzOrAABZQGnAANs mikztDDWVyU/Q1EnIfyUYyR8dU7p/iETfozhPE/M8vf03eVXFudAii8d2 VAGUOoYGsx2S3BR7bFAOW4grpQ3ZxH4DTcCp8axg+JY4R+2Ot3VCJVDqQ A==; X-IronPort-AV: E=McAfee;i="6200,9189,10266"; a="276460875" X-IronPort-AV: E=Sophos;i="5.88,389,1635231600"; d="scan'208";a="276460875" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2022 16:34:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,389,1635231600"; d="scan'208";a="780015696" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga005.fm.intel.com with ESMTP; 22 Feb 2022 16:34:24 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 22 Feb 2022 16:34:23 -0800 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 22 Feb 2022 16:34:23 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Tue, 22 Feb 2022 16:34:23 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.109) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Tue, 22 Feb 2022 16:34:23 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jEFrnQhGM2fm3hMgSvgdEKpMolYCHPn/47hMe+0hCFibpY1c6FhtQ/XZEoYXQnz85Dk8GcFWCn5rG+XcuYsk7ycOlnc/wvenjyWXm4ujkf8eoszw8iFJBswCVfO5xvsHfEhXlW0pxz85DkA9JfKHSypnZIxgKJy9ioIzemNX8D3wPiTvDIshwDfuUf9JGL02ogBA/O319pWNQxfAj5BNOCOlTKpHkqUMJ4s/bg7UhqJeq9pFssPJxugbgjISy+D2pbkZoJGKBo7gN7r3YwomnyH5CChDdSB5OVuenhd0A/r0X5U59gOBQiALxLODQewy1RPHcqNIozlWi/Az8FiszQ== 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=t9G57UrA9eyTu3F3CdwL7BDZJ15xQ6+zLSo3ZeA0JZA=; b=SHZ3MqlF+T4kpExhG5DfvzuJn/yYIM52SMFzThfKgOg1lpaBCZhJlarvufJV1Qx//qwL4z/zJyhjm6+zEiuHUhiwrKRUpylAIJlgE8p4tz9FmNxdcneOHEu3XFi4MurYu1qW4Igxu4K+udmeU3Sh9MJeec7uROlP/zEZ/6QicsA+LzP63KCN1QB9x4XETEtoXHo5L+X7Y8At6yjA/p2+qtp5OPVfKOD8HS/bClUOIDHnxE68uC2fm6yWGtvK87/YQFWOObv2r4IM2TAAgB9z9SruwIhUiqRKM4Zo5tlUuQnb0mbIhnXI05E7GpMFTWm2WHXeFe0JyepALujiYbfGwA== 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 MW3PR11MB4585.namprd11.prod.outlook.com (2603:10b6:303:52::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.24; Wed, 23 Feb 2022 00:34:22 +0000 Received: from PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::98f5:edb6:aee6:6886]) by PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::98f5:edb6:aee6:6886%8]) with mapi id 15.20.4995.026; Wed, 23 Feb 2022 00:34:22 +0000 From: "Min Xu" To: Gerd Hoffmann CC: "devel@edk2.groups.io" , Ard Biesheuvel , "Justen, Jordan L" , Brijesh Singh , "Aktas, Erdem" , James Bottomley , "Yao, Jiewen" , Tom Lendacky Subject: Re: [PATCH V6 26/42] OvmfPkg: Add null instance of PlatformInitLib Thread-Topic: [PATCH V6 26/42] OvmfPkg: Add null instance of PlatformInitLib Thread-Index: AQHYJYgEDgGBXRVuTkCZYIxKGGLJzKyfj/iAgAC3U3A= Date: Wed, 23 Feb 2022 00:34:21 +0000 Message-ID: References: <20220222131009.oh3p5cfjupzvjkdp@sirius.home.kraxel.org> In-Reply-To: <20220222131009.oh3p5cfjupzvjkdp@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: 03bd86b9-0e8f-4d55-4e65-08d9f6643c70 x-ms-traffictypediagnostic: MW3PR11MB4585:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LE4mpz794+xh8nmvglntZr0/8vownG8MbAAbso4miCEOS2orymXGvYA6wcN1jcSi1Sm37ySop9RwSsJF/h0uweCYpg/ays7gFzLjiV8RH5jKCycj97rmGvfr2Cbd4ygietVNYHOAXWuX5ixwhlHTCRGuLCXe7Wff3d92209GoyBi5vVoOesvvTZNoBxUWGWdtszslo3Wfc9UsvaI1oMkL8l6M4vrvXEyV8haH40CZdB9r5pSdl6ZM+iU0ytrCx4ARFq4UZSGoo2ajehtNtGlrh3q/H/3xV55LnHJ3TSHNC5tQh9NvNXp5cxA6sGogFtFXUEe/S1n/4CubhdStyTsdQJX4jCq1UffHOMdMnRbA78F5dJQNPnHvZebq+xSm85J6rDUYAQm1rvy0DERPjMVDgljiefi35gskrMhAKYbqRvRY0DM2hc1tfdUvR9jOtjvL2OO8kGZhZLOOtosBlU6gxAMqeoC0M4UyEeS4kIdMjX9yYoSdNUWFZqKa2GdAYdAt4B5fgUnoC+PAoY+kOpuu3r8kX0MsPKwim7e+/k6MlkUiUv5u9FxKyy4QuHTNBj/zq3KUMMiesB9PHdztI7CtSPdKMS+QqdUjmz1UE83PCNheDdZq0yAZiil2hYzXTpfhCbB1TpSlXu3KjCju7hJmYr8XZejCs1MT+/YJKyJHgNAtaz/fMAw/6fHezL7clOPRZdyOPmq1jtQuwe7XQUGinwIiluMQ+IiNFhtLOt59+LQPXq3ku2unipoxXow9GWMUDvottTgLMwykLFKruE0fkqJiyCs1XGqItQSq5EpRbs= 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:(13230001)(366004)(26005)(186003)(7696005)(6506007)(76116006)(66446008)(8676002)(64756008)(54906003)(66556008)(9686003)(966005)(316002)(71200400001)(66476007)(508600001)(66946007)(84970400001)(86362001)(82960400001)(6916009)(122000001)(2906002)(83380400001)(38070700005)(4326008)(38100700002)(5660300002)(55016003)(8936002)(33656002)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8qEyoxWG1xaHqjJCUxp1rbhshreeEFOge7KYrUDIkW6VwZ2MjtWnUo+82quB?= =?us-ascii?Q?gMupYAB4a0atKBBvZaba8kiuLsiYOkHhtX2b5Q1GoiObtxOq2wgG1/eSQl9I?= =?us-ascii?Q?/Bmf5zI5Wbb3myaHBw8foTu6HHRRPsT/WDoQ72kA/d2BRhUuraAw/OhxsOdt?= =?us-ascii?Q?l6c88axx0zWAOXW0pAr1kFtYhpsxACBYNll7Rpiw46WEl69Jm/5+BdvnGZ7H?= =?us-ascii?Q?nmjr/tais/D9jN8RZnttNLI7vGjyvIyZiind9D5vGJ6xyNNLkNr7aepOw1y1?= =?us-ascii?Q?MMyAHBv5djAgt6rQsSJAZVlWhkDGUa6XCNRt5Qt0QpOMAfekcmmfWr9M8eKd?= =?us-ascii?Q?y4SI9sXZNdS7zcX//FqXoacyvjacQAxESQxXd8wCsG90V/cEZ2WForssRwsn?= =?us-ascii?Q?nzID2egiRlRIyEbrnUzO2ydhAdFOuDr+SKWBTwrO+vjekHkXCXGAWERz4heo?= =?us-ascii?Q?atT5EDZV6n+mse5jKff0J+i8EiklWS3Y8P5V23sNizzoI1vER5nDPbDiivFA?= =?us-ascii?Q?Cku4yvDlw0kudCE5HIrwagFJRp8Y9YkcFe1kprX/Gyq2X1eza6P6MfleREtL?= =?us-ascii?Q?zoaollrTu9CXLDMMabwd0A8OfVyG6Ga7O7C02/nP2ay+nnC+iF4Hizf94X/F?= =?us-ascii?Q?FDjOLQxtwONgO48Hq0KbnMUvWThlCbam/cmsJSpjxk93aaKKmC8ti/alY/is?= =?us-ascii?Q?DUiSjyfYyatB8frea//w0qR07EtoMhHRkmvJ0SfCwOtoGVZ5Jv4lTw7niaQg?= =?us-ascii?Q?G+ngzsYECv4tdkrokyi6lupGBi/IU9Ow7X0RNNmXB7dUJUlqV0zW2GWpC9BI?= =?us-ascii?Q?Yvm3I8kNNnc6k/XpIJ89B9PH/wagLIuv9X4WJ7amDC9BkOxOWX8soGva1Y7+?= =?us-ascii?Q?GXm3Vw8/BSQOtXm9ggw8yizDH8joom3h1jVja0uehvhh4yQCIiUGyX0yD0bD?= =?us-ascii?Q?Wy56An5SNOaerUdGqz2oM2NTCZC+vO9/UeLHDxuU+aqEMhve1KDAeMZptzNa?= =?us-ascii?Q?km5rD0jAIpKhXAs41PFYU0IhazwLd3GuRF+m4PZfOkKy+WP/MMWt50xML5w2?= =?us-ascii?Q?a3K8Qs0WkF73llP/ZbvXupuZHMshHMZbkK/gCGSJEKZGsTLjBsB8WpAN7A8r?= =?us-ascii?Q?WKYT+u8XQGPZDs87zyytxEbN4IdGPa17lS0q88x2VbCbWuuNLfA8uFoTY3XS?= =?us-ascii?Q?L87e61hkN3RhE2tX+graySFxT6Zetom+OV5pfJV7KfcElvBrb0WxGmSfnwnQ?= =?us-ascii?Q?wCDQNhexNjqHlSsm1L3UjN77rL1VhXgMMDbfZAMPlCvz3LPU59ePvhMxY3V2?= =?us-ascii?Q?8jo53WfYnkmJtggOeUA2pSzbBlOc4ZYqmt7uFuraGo3ZEeEIa0QeyW0eI1ib?= =?us-ascii?Q?SU9um68y3D6WnuMelai0azJC8UTqFBQqpURNqpGP7qejXCxFOVnTJcQN4gKJ?= =?us-ascii?Q?r757JwMOUwxqEDLpkCJ6kg1BOfgAv12LKCh8k8nmg/shikm9rGiGXFejj3Wd?= =?us-ascii?Q?CGbpOkl/SUB9a9KSrG3K1OnpbqYEyaYL9rHJvfxU902vxiT0gCZxBdJvwmNo?= =?us-ascii?Q?UCqoBnxrVR/6xvDIB72lFt1tZt5sqDXfWpA7m4a7Z8ub9b+2TlV3tNFTHGWq?= =?us-ascii?Q?bV/fAwvyYPTMYC76BiuWT6M=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: 03bd86b9-0e8f-4d55-4e65-08d9f6643c70 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Feb 2022 00:34:22.0010 (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: uybAZ1lfqgeGG2viUIZcWLC+9v3pp/PERq6ErhLeHEzptXrGY1MB344h33DTdYIfxfgBis8Pi3W9wcnBqjC17A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4585 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 February 22, 2022 9:10 PM, Gerd Hoffmann wrote: > > > > Add null instance of PlatformInitLib. >=20 > What is this library needed for? >=20 In #25 (OvmfPkg: Update PlatformInitLib to process Tdx hoblist) ProcessTdxH= obList is added in PlatformInitLib to process the Tdx HobList. This functio= n is called in OvmfPkg/Sec/SecMain.c (#28 OvmfPkg: Update Sec to support Td= x). ProcessTdxHobList is called by OvmfPkg/IntelTdx/Sec/SecMain.c as well. = See https://edk2.groups.io/g/devel/message/86120 OvmfPkg/Sec/SecMain.c is used by OvmfXen.dsc/AmdSevX64.dsc/BhyveX64.dsc/Clo= udHvX64.dsc/MicrovmX64.dsc. So PlatformInitLibNull is needed by these platf= orms. There is another option which can reduce the changes in dscs. 1. Define a macro (for example: TDX_GUEST_SUPPORTED) in OvmfPkgX64.dsc MSFT:*_*_*_CC_FLAGS =3D /D TDX_GUEST_SUPPORTED INTEL:*_*_*_CC_FLAGS =3D /D TDX_GUEST_SUPPORTED GCC:*_*_*_CC_FLAGS =3D -D TDX_GUEST_SUPPORTED 2. TDX_GUEST_SUPPORTED wrap the tdx specific code in SecMain.c #if defined (TDX_GUEST_SUPPORTED) if (TdIsEnabled ()) { if (ProcessTdxHobList () !=3D EFI_SUCCESS) { CpuDeadLoop (); } } #endif What's your thought? Thanks Min