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.web08.6815.1653378835347529581 for ; Tue, 24 May 2022 00:53:55 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=J9HIBjoz; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: isaku.yamahata@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653378835; x=1684914835; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=HN+BGTWzxaRe8wSlS/B09ku+9hF0Krio9uAZP4gDDRA=; b=J9HIBjozOsOi/EPxteG0uQ5d0WDufAVIlDjNT0AY0GuEjpaocO8xyQvy zYITpODAYCWIuGE+iZ4jnxjUjwYGRJs3ycEzdHNIYe/sVMXZC6AbywVLb uTqN5lS7YNNHNDaPP0qTci5zjrE+ctlczWwYGouSLqshmOcQ+ABiLCwA9 xXixruuEwmUvbOi7cimD4fonpkiWomyhEBSSgjmHgoGaDpUgDDc//ffun /j2KQCvL2Zn9BUBVWjtRweZgZnltzMq0S5aovRGY9dcSOUNY0/An/rcIy DKnaZyiFAX7k7Z6IJL/gzr6t8EpHdJ9Pvky4c4d0yAFSwQ9MwISvZ65/u g==; 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" 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" 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@intel.com To: devel@edk2.groups.io Cc: isaku.yamahata@intel.com, Min Xu Subject: [PATCH] OvmfPkg: TdxDxe: Fix AsmRelocateApMailBoxLoop Date: Tue, 24 May 2022 00:53:46 -0700 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 --- 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]=0D ; OS sends a wakeup command for a given APIC ID, firmware is supposed = to reset=0D ; the command field back to zero as acknowledgement.=0D - mov qword [rbx + WakeupVectorOffset], 0=0D + mov qword [rbx + CommandOffset], 0=0D jmp rax=0D MailBoxSleep:=0D jmp $=0D --=20 2.25.1