Re: [PATCH v2 2/3] KVM: TDX: Fix the exit reason handling

From: Edgecombe, Rick P

Date: Wed Aug 12 2026 - 16:24:31 EST


On Wed, 2026-08-12 at 15:29 +0800, Xiaoyao Li wrote:
> Well, actually the added comment cannot be shared. For the
> EXIT_REASON_EPT_MISCONFIG case, the reason to return a synthesized
> invalid Exit Reason is to differentiate with the case of
> TDVMCALL(ept_violation), where the exit reason is updated to EPT_MISCONFIG.

Ah, yea. You are right.

>
> In fact, we don't need such trick for real EPT_MISCONFIG, because there
> is handling for real EPT_MISCONFIG in tdx_handle_exit()
>
> if (unlikely(vp_enter_ret == EXIT_REASON_EPT_MISCONFIG)) {
> KVM_BUG_ON(1, vcpu->kvm);
> return -EIO;
> }
>
> before the handling of transformed EPT_MISCONFIG from
> TDVMCALL(ept_violation)
>
> switch (exit_reason.basic) {
> ...
> case EXIT_REASON_EPT_MISCONFIG:
> return tdx_emulate_mmio(vcpu);
>
> But it's not urgent to fix it and it's not mandatory to enable Bus Lock
> VM exit on TDX. Let's leave it to the follow-up series.

Ok.