From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web09.7132.1653383677513511341 for ; Tue, 24 May 2022 02:14:38 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Xcg9HODe; spf=pass (domain: intel.com, ip: 192.55.52.43, 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=1653383677; x=1684919677; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=Jeb0M3uPfrODnyjuVl4WC7sFXhGZYA5ZUpc+j3BAG+k=; b=Xcg9HODevI2/BEM/hogZoCp6XkQoFEYqk1LP72m23hrSoDFy1rByRtDN ttofaw0+TI9U//201z2C6a+ZS/BnMtkZJP5HXuJqvpnr4oF/fn8oEC1Xm 2INfm08nYr7+ZPrapc3RXch8764HSQAUFcvHFTF5p1NVumtJYA2owmtEQ 1PywvjO2/fN8sMEMovgTTfq8KG6wHXWciQ+AmXpIRn7SGXeecr3cYx7oa vmz9GcOrCAWuSVTY0g4t/lQ1JbSBEfbttd43LBcvWkjD69Je4J1khczFi cZckTKRqq7AB2pSMCOt8+KXkfmN9hJpFC9Thv+OszlLgxWTaU3dpX5t0L Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10356"; a="359872728" X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="359872728" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 02:14:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="577810967" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by fmsmga007.fm.intel.com with ESMTP; 24 May 2022 02:14:37 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 24 May 2022 02:14:36 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 24 May 2022 02:14:36 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 24 May 2022 02:14:36 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.172) 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.27; Tue, 24 May 2022 02:14:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P7KRVg4J6k37FEiwVB2JFF8UsGJBFSveetz4ivJwhLBIXL9gK+77Bp2WhuMQ0hCkUVoko3v26RzYzVPdXm2j0nMGtgOBh7lZ6h5ZlsaCJEI4mSS2S3F2S0XIPlG4F1/Kr/s+awOTsjns6wWZgVs3VpOyID3RuMdbXQ3y6TYq7SItWgfRx9VaJLkWw/ovHs5jEbm4mKwrU8nnAVMVg1ll9Km/Y874Ol1Q39br3SfzLnyFLfTgAr4TbDkGossftLzyYJCQarfp3h+LQRNvmd//6gtwM0uBGFZ0xhXcg253ph3ujn3WFOUeXq1vJi66hi9RpMBjlTSi1Jsx7fSzrF8mNA== 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=ocWRKur4sdE7nC8xHFfuxyPMwD8IK5Pwhy+fy8AwoyQ=; b=brczIntpl94LOOSDGUxx41WzLLMqCmKTgcw+UlItTd84nllfNQA7gRYXboTjeqreII0lyVXuIjz2sp2up6Pg/4BBgLeiRXVl5W5uyM1cHE/NtQ50iuXuIS4gbA3mSfZRotBoT+UmnuVnyPnh9JyC4jOvr4EEJhfI3Woc3FFzhpQ78wZxBBgSnABExO2H2BNLfJPhO/cAwqg6zgiqiJgpWTrbuT8oNXVEhq533CKo5WYx0s+lz21hI/uE54rAtKhJ54ZUTZU3MCdlJFq2mzNYQDcpfxGXgwGfX0lkdHy2YCjygT+aS9rU7AQ1Gqb5rlkUbZb4ewJ4fonreaaWY1VRUQ== 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 BN6PR11MB1474.namprd11.prod.outlook.com (2603:10b6:405:c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.17; Tue, 24 May 2022 09:14:28 +0000 Received: from PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::1844:3fca:639e:7c56]) by PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::1844:3fca:639e:7c56%8]) with mapi id 15.20.5293.013; Tue, 24 May 2022 09:14:28 +0000 From: "Min Xu" To: "Yamahata, Isaku" , "devel@edk2.groups.io" Subject: Re: [PATCH] OvmfPkg: TdxDxe: Fix AsmRelocateApMailBoxLoop Thread-Topic: [PATCH] OvmfPkg: TdxDxe: Fix AsmRelocateApMailBoxLoop Thread-Index: AQHYb0NwID/Uw8XwGEe4mm3w6FUjSK0tvleQ Date: Tue, 24 May 2022 09:14:28 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.500.17 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: 25bf9048-1bc7-4260-2ed2-08da3d65ce4d x-ms-traffictypediagnostic: BN6PR11MB1474:EE_ 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: +RU4uHAjbq+6H8BSFXdDhb8cdSYZbgImezF2V5qfHpAFJ/j9v6cGLiNW4aKktTvlM+rRlkR9dt/5CB5PPbhXWOZimhz0oBl87bYLHKzBGbWElr6tUaXJlTDmrh8cHl9DHi7chuEjKPEGe03vzVz4+J7StD3Ge1H21TCNscP47knt2w7qePBH8nB4R1eGAc0u1xfaoAhPyhYuPOxJesHYc5xSSSnW+Y31EIdJQvyQ+CYAbVXYQsigavHHzmoMY7yG7TU/WucdFYlyxyh50nkA7q70MIcArM91JvhB0jKQcTgI1xXa65P/rFpssQ7WmSiOazVCX059y8TFFl+kU2P6gHwOl0/3fraGcpiKQ8K/NbtFxSOI6scRJwyH0MLDk/tL/cSWN7a2BETMz2g0mz74Vd19Sm/GOlDCXO862ridz7oghpD4FQZEVsP+7BPpnSCTxEDUdyI9T/E6TeabNmA+kKskpyedTN5rjQ8aq6nvdjFZZ4QGTsdhdVPVdKSvuOkqjJDRNGn1wRZMFwmScM/xgXv0v1rcI3nBxe03sd3wig5rZ3CWwzv/MpVyiN2eF8DncOK0PXRmFoOG4YueQQWUw8srU5AFvjK8sdn0D2WFdPgc5dBL7uDtoCFHoy5aOSHq1mpoWL3WoEKvWAYF5J5aGBdXaJwPcarwEDj/iifpROsy13oJyxwOamw/09gW5CSYiN7UGgFT8qdecWx1F3x6ZA== 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)(6029001)(366004)(66556008)(55016003)(5660300002)(66946007)(8676002)(76116006)(66476007)(66446008)(64756008)(83380400001)(110136005)(71200400001)(19627235002)(8936002)(316002)(52536014)(508600001)(33656002)(2906002)(45954011)(186003)(7696005)(6506007)(38070700005)(82960400001)(122000001)(53546011)(9686003)(86362001)(26005)(38100700002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?i9NgWTM9FWxAGYY4pwUFV09xiKRQIwSaUxql3M6vFRLhzlmiobsZuAMzDTgB?= =?us-ascii?Q?cKZWueWIO0cTZ7uH0yFwv3lUzcKdhiCkI44Zf/ZyG/CiMxBTEwpRnq9L2r/b?= =?us-ascii?Q?E8a4HsAUBFmuqxZG0bGtwjb0iqcSVl0sFSx3zFAuMTt5F/yLuOTT8m+AR81E?= =?us-ascii?Q?rEV7AK1T6AAxfqZLbjtalvdoMd7l1v7/76zB/X3cqON8WnfUcQG43qpmGPBO?= =?us-ascii?Q?LRUBBaVJBS0hIWo5EDyp+Z0NDr4tRowd0flleWQZx34IXxzYLF/Gq3SFCArJ?= =?us-ascii?Q?tKOZ401oXgV4zYMZekERkrpgn3LBgiKNTxY0BfJGVdoXGZTC8V5YB3HMnKgT?= =?us-ascii?Q?Ngt+61FLjPOFiERMjI+qkPHe/En4bR5H5z5csBjOyQsaAYV+YjCP9/bShRca?= =?us-ascii?Q?Qe1OXJgWchjWguBEQncRpClUjEr1CTV68JJrXWdRYwR9wHOgtgO0v/06YEqK?= =?us-ascii?Q?QdvUltFGL/Hov11G82QQkSOgp5NMAFfN8ycdi18sm7S6xMr+CBdzasb5TC01?= =?us-ascii?Q?pfHzaj+1Lg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hf9?= =?us-ascii?Q?hQ8pYPRagdg6jUXLA6rw7VIoZjI5Vn2nY0Cc95ALmyZsXEuRdgQZWuzw1ecr?= =?us-ascii?Q?NSvuDhjr7nZIVyXkVvqhLIOoF/MuS164JnytL0IqXDX+XZgn9Y8U8caoX8rr?= =?us-ascii?Q?eJR0QCNaUOAWnrAPRl4hiABK3KSt/nBLIfiCfnOVSRqvhAjRut+pAiWcK5no?= =?us-ascii?Q?hc5ShNd4+WQiY1rxUhWvc+fxVLG2HR4MCXWbq7fbXwfuDZ09LQJrM1yHytHL?= =?us-ascii?Q?XR6jp4enbdEtK9eVbPs33iEsp58WFy4KGHzTypyVpwIg3rGB1QY67xbrtENF?= =?us-ascii?Q?YnuofipG1w=3D=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: 25bf9048-1bc7-4260-2ed2-08da3d65ce4d X-MS-Exchange-CrossTenant-originalarrivaltime: 24 May 2022 09:14:28.7877 (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: 0H+JvNQssPZih/+nq5BtBBMGSeb9ohGHyMRLIt54d3BcH2AARzGYKLf2p9xxFlcx0CU37r4W29SEzI/873upew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1474 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 May 24, 2022 3:54 PM, Yamahata, Isaku wrote: >=20 > In TDX, Application Processor busy-loops on Mailbox for OS to issue > MpProtectedModeWakeupCommandWakeup command to UEFI. As the AP > acking to it, it clears the command member according to ACPI spec 6.4, > 5.2.12.19 Multiprocessor Wakeup Structure: "The application processor > need clear the command to Noop(0) as the acknowledgement that the > command is received." > However, AsmRelocateApMailBoxLoop wrongly clears WakeupVector. > Correctly clear command instead of WakeupVector. >=20 > Without this patch, TD guest kernel fails to boot APs. >=20 > Fixes: fae5c1464d ("OvmfPkg: Add TdxDxe driver") > Cc: Min Xu > Signed-off-by: Isaku Yamahata > --- > OvmfPkg/TdxDxe/X64/ApRunLoop.nasm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm > b/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm > index 49bd04415c..a859375fb8 100644 > --- a/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm > +++ b/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm > @@ -69,7 +69,7 @@ MailBoxWakeUp: > mov rax, [rbx + WakeupVectorOffset] ; OS sends a wakeup c= ommand > for a given APIC ID, firmware is supposed to reset ; the command fiel= d back > to zero as acknowledgement.- mov qword [rbx + WakeupVectorOffse= t], > 0+ mov qword [rbx + CommandOffset], 0 jmp rax MailBo= xSleep: > jmp $-- > 2.25.1 Thanks Isaku.=20 Reviewed-by: Min Xu