From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id C17A8AC0D24 for ; Wed, 8 Nov 2023 11:39:57 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=+JLyfwbPOpQSt7quxyLd+8hW8Lm/QiuSkpncvTx49QQ=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1699443596; v=1; b=ng1khufDtSFaeW6vOspJj2KchMhrzfUb0g3E1TdNDJ9+usx9K147Her4E/ZSDFprvBV7nAUf cr8hXeR7L1/TyFiHDO1Vl3ufIkmk89uZSyxcXJxwdOslpNnxOH/3IHr4FzeCU8vR0wd+uWdAzqL fWEt+1NO3xpAUKK6SiWFqiz8= X-Received: by 127.0.0.2 with SMTP id 0JRRYY7687511xkiVVLlLnW5; Wed, 08 Nov 2023 03:39:56 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web10.11525.1699443595939056670 for ; Wed, 08 Nov 2023 03:39:55 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10887"; a="388603331" X-IronPort-AV: E=Sophos;i="6.03,286,1694761200"; d="scan'208";a="388603331" X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2023 03:39:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10887"; a="797979635" X-IronPort-AV: E=Sophos;i="6.03,286,1694761200"; d="scan'208";a="797979635" X-Received: from cepingsx-mobl1.ccr.corp.intel.com ([10.239.49.140]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2023 03:39:52 -0800 From: "sunceping" To: devel@edk2.groups.io Cc: Ceping Sun , Liming Gao , Michael D Kinney , Erdem Aktas , James Bottomley , Min Xu , Tom Lendacky , Michael Roth , Gerd Hoffmann , Jiewen Yao Subject: [edk2-devel] [PATCH V4 1/3] MdePkg/BaseLib: Update TdVmcall to always output the value in R11 Date: Wed, 8 Nov 2023 19:38:25 +0800 Message-Id: <20231108113827.3917-2-cepingx.sun@intel.com> In-Reply-To: <20231108113827.3917-1-cepingx.sun@intel.com> References: <20231108113827.3917-1-cepingx.sun@intel.com> MIME-Version: 1.0 Precedence: Bulk 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,cepingx.sun@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: KGzCptqHaOuqg7Vo1sSFWUuBx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=ng1khufD; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io From: Ceping Sun REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4572 According to section 3.2 of the [GHCI] spec, if the return status of MapGPA is "TDG.VP.VMCALL_RETRY", TD must retry this operation for the pages in the region starting at the GPA specified in R11. Currently, TDVF has not handled the retry results and always clears the R11 on unsuccessful return status. For this, the TdVmcall needs to output the value of R11 on unsuccessful return status to handle the retry results of MapGPA. Reference: [GHCI]: TDX Guest-Host-Communication Interface v1.0 https://cdrdv2.intel.com/v1/dl/getContent/726790 Cc: Liming Gao Cc: Michael D Kinney Cc: Erdem Aktas Cc: James Bottomley Cc: Min Xu Cc: Tom Lendacky Cc: Michael Roth Acked-by: Gerd Hoffmann Reviewed-by: Jiewen Yao Signed-off-by: Ceping Sun --- MdePkg/Library/BaseLib/X64/TdVmcall.nasm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MdePkg/Library/BaseLib/X64/TdVmcall.nasm b/MdePkg/Library/BaseLib/X64/TdVmcall.nasm index 5ecc10b17193..8dd9bfcbfa14 100644 --- a/MdePkg/Library/BaseLib/X64/TdVmcall.nasm +++ b/MdePkg/Library/BaseLib/X64/TdVmcall.nasm @@ -133,9 +133,7 @@ ASM_PFX(TdVmCall): test r9, r9 jz .no_return_data - ; On success, propagate TDVMCALL output value to output param - test rax, rax - jnz .no_return_data + ; Propagate TDVMCALL output value to output param mov [r9], r11 .no_return_data: tdcall_regs_postamble -- 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110909): https://edk2.groups.io/g/devel/message/110909 Mute This Topic: https://groups.io/mt/102461782/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-