Re: [PATCH v4 2/9] KVM: TDX: Check if there is valid exit infos based on vp_enter_ret
Binbin Wu <[email protected]>
| Newsgroups | dev.linux.lists.linux-coco,org.kernel.vger.kvm,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
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: [email protected]
> Suggested-by: Sean Christopherson <[email protected]>
> Signed-off-by: Xiaoyao Li <[email protected]>
Reviewed-by: Binbin Wu <[email protected]>