From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web09.50062.1654007499473969845 for ; Tue, 31 May 2022 07:31:40 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=CjJGrJy+; spf=pass (domain: intel.com, ip: 192.55.52.93, 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=1654007500; x=1685543500; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+nmSAenD5S2IkF4kI5yo5sSso/yA75Uc6eMCTGoT41g=; b=CjJGrJy+mrrVylyUX3Py/41aAER1ASrz2qhlAL+pNr29Z5Pc9LBBk82t lK4TH2FfkTA4/q6gEctu9raEzQ9+73/4fTp14BKgb/jN9CI2t4Z/W9YuE zlWCanw3LJp/wluKofD/v+bl18YSayREni/sYfAnWyhQoWlojPbz83YCZ demVtA8XK0juVr4g+71jWMewcSWYwTA/lSh9Ao6F7Gq10djfrxhBRC0MG xEtRO5W17glMJ8tAvA/ul3PrMgJQqa2/S0IquOc3BdiKk1its6uR5+wu3 jEm0lz+iJr6fYC69YCdJ4oZwAAV8yEd2E1OT/t6omnZ5D98ztKp9gecZO w==; X-IronPort-AV: E=McAfee;i="6400,9594,10364"; a="272837682" X-IronPort-AV: E=Sophos;i="5.91,265,1647327600"; d="scan'208";a="272837682" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 07:31:37 -0700 X-IronPort-AV: E=Sophos;i="5.91,265,1647327600"; d="scan'208";a="605697653" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.29.6]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 07:31:32 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Erdem Aktas , Gerd Hoffmann , James Bottomley , Jiewen Yao , Tom Lendacky Subject: [PATCH 1/2] OvmfPkg: Fix TDVMCALL error in ApRunLoop.nasm Date: Tue, 31 May 2022 22:31:16 +0800 Message-Id: <7afc1c0752f09c2c53ff5b2c78c3e064838f3778.1654007213.git.min.m.xu@intel.com> X-Mailer: git-send-email 2.29.2.windows.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit According to GHCI Spec Table 2-1, in TDVMCALL R10 should be cleared to 0 in input operands, and be checked for the return result. https://cdrdv2.intel.com/v1/dl/getContent/726790 Cc: Erdem Aktas Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Signed-off-by: Min Xu --- OvmfPkg/TdxDxe/X64/ApRunLoop.nasm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm b/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm index 52fb3b4944bf..0bef89c48552 100644 --- a/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm +++ b/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm @@ -42,10 +42,11 @@ AsmRelocateApMailBoxLoopStart: mov rax, TDVMCALL mov rcx, TDVMCALL_EXPOSE_REGS_MASK + xor r10, r10 mov r11, EXIT_REASON_CPUID mov r12, 0xb tdcall - test rax, rax + test r10, r10 jnz Panic mov r8, r15 -- 2.29.2.windows.2