Re: [PATCH v4 3/9] KVM: TDX: Set bits 31:16 to 0 for the synthesized Exit Reason

From: Binbin Wu

Date: Thu Aug 20 2026 - 05:19:32 EST


On 8/19/2026 5:48 PM, Xiaoyao Li wrote:
> Set bits 31:16 to 0 instead of all-1s for KVM's synthesized Exit Reason.
>
> KVM is going to support Bus Lock VM exit for TDX, after which bit 26 of
> the Exit Reason becomes meaningful and indicates that a bus lock happened.
> The existing synthesized Exit Reason, -1u, will cause a false positive in
> that case. Change the synthesized Exit Reason from -1u to U16_MAX, so that
> bits 31:16 are set to 0. This also avoids the potential issues when other
> bits in 31:16 become valid in the future.
>
> As a bonus, the check for synthesized Exit Reason in tdx_failed_vmentry()
> becomes unnecessary. Just drop it.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Xiaoyao Li <xiaoyao.li@xxxxxxxxx>
> Reviewed-by: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>

Reviewed-by: Binbin Wu <binbin.wu@xxxxxxxxxxxxxxx>