Re: [PATCH v3 2/4] KVM: TDX: Set bits 31:16 to 0 for the synthesized Exit Reason
From: Edgecombe, Rick P
Date: Wed Aug 12 2026 - 17:59:16 EST
On Wed, 2026-08-12 at 16:02 +0800, 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. Drop it.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Xiaoyao Li <xiaoyao.li@xxxxxxxxx>
> ---
Reviewed-by: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>