From nobody Mon Apr 29 05:26:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+89982+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89982+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1653402373; cv=none; d=zohomail.com; s=zohoarc; b=Eq37GQKzN8zOwiMx6OyWdY6PkpJS0ZrrrC2N69HuWScIjC5A5yrTFmBiiulfgj3g7V+I1OOliuLBg+PyS2jjh2oLyI0ltI4fw4IgTaALxIHIaaajov+brN58ppY2QQkdfQMbiOkFpzeNM3axIAb2xfQyWwRIluUbjNV3Y19DCsY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653402373; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=q1TIz12Kks5GerZP4iRD31lW6OSBYZPMys+EI/Z+aOw=; b=NPcpzHT/hhinG71ImxVKvvlOhRhj+I3x7Sipo6REMd177ybcK6wW9OkpYvWfuNyA9IOYwdHJjkxKhEaJWsG2LpgzhFABo5Eu7rR7mB3gTs3Nabo/GSqjeR8yHkWiRm2iNM7bD0rgOEh6nvPqTUuvG6jv305CcTIIGl3jVN1R3ho= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89982+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1653402373180540.6063578970817; Tue, 24 May 2022 07:26:13 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id zrXPYY1788612xPGPUuHpVBf; Tue, 24 May 2022 07:26:12 -0700 X-Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web08.6815.1653378835347529581 for ; Tue, 24 May 2022 00:53:55 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10356"; a="359855589" X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="359855589" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 00:53:54 -0700 X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="601096638" X-Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 00:53:54 -0700 From: "Isaku Yamahata" To: devel@edk2.groups.io Cc: isaku.yamahata@intel.com, Min Xu Subject: [edk2-devel] [PATCH] OvmfPkg: TdxDxe: Fix AsmRelocateApMailBoxLoop Date: Tue, 24 May 2022 00:53:46 -0700 Message-Id: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,isaku.yamahata@intel.com X-Gm-Message-State: pPPa9UJmTpl1yfxZupeCA9qxx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1653402372; bh=YpTspVOtVpVcwqfckO9hcA9mS4jc8e4jLAxIULE9eFw=; h=Cc:Date:From:Reply-To:Subject:To; b=fNMybmZLsIayIDpn4YJXID9V/ykEBkRsQhJe0l1BZznCOUZnrap9RloLt3dbeNTGEwY Dl97FRgY+NVsSuirAREFRfV77C235GiqX0lhlNqgSXhVLFrXxA4aeytDNSTxgqmvovOzj inHZ8go+xhUelFHvCnGvMNUONVbncNRv7M0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1653402375461100002 Content-Type: text/plain; charset="utf-8" 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. Without this patch, TD guest kernel fails to boot APs. Fixes: fae5c1464d ("OvmfPkg: Add TdxDxe driver") Cc: Min Xu Signed-off-by: Isaku Yamahata Reviewed-by: Jiewen Yao@intel.com Reviewed-by: Min Xu --- OvmfPkg/TdxDxe/X64/ApRunLoop.nasm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm b/OvmfPkg/TdxDxe/X64/ApRunLo= op.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 command for a given APIC ID, firmware is supposed = to reset ; the command field back to zero as acknowledgement. - mov qword [rbx + WakeupVectorOffset], 0 + mov qword [rbx + CommandOffset], 0 jmp rax MailBoxSleep: jmp $ --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#89982): https://edk2.groups.io/g/devel/message/89982 Mute This Topic: https://groups.io/mt/91307432/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-