Re: [PATCH v4 2/9] KVM: TDX: Check if there is valid exit infos based on vp_enter_ret
From: Binbin Wu
Date: Thu Aug 20 2026 - 05:16:44 EST
On 8/19/2026 5:48 PM, Xiaoyao Li wrote:
> Check if there is valid exit info based on vp_enter_ret instead of relying
> on the clobbered Exit Reason, in tdx_get_exit_info().
>
> Current KVM uses "Exit Reason is not equal to the synthesized invalid
> Exit Reason, -1u," as the condition to identify there is a real TD Exit
> and valid exit infos. However, there is one issue with this approach:
> KVM updates the Exit Reason to the synthesized invalid Exit Reason for
> real EPT MISCONFIG as well. This is a false positive for real EPT
> MISCONFIG, which has valid exit infos.
Nit:
Is it better to add the info the real EPT MISCONFIG is not expected for
TDX case, so that readers can know the severity of the bug?
> > Though the issue can be addressed by changing the handling for real EPT
> MISCONFIG to not update the Exit Reason to the synthesized one, relying
> on the clobbered Exit Reason itself is brittle. Instead, check
> vp_enter_ret directly to identify if it is a valid Exit Reason.
>
> Fixes: da407fe45908 ("KVM: TDX: Handle EPT violation/misconfig exit")
> Cc: stable@xxxxxxxxxxxxxxx
> Suggested-by: Sean Christopherson <seanjc@xxxxxxxxxx>
> Signed-off-by: Xiaoyao Li <xiaoyao.li@xxxxxxxxx>
Reviewed-by: Binbin Wu <binbin.wu@xxxxxxxxxxxxxxx>