Re: [PATCH v4 04/11] KVM: x86/xen: Always route non-singleshot-timer vCPU hypercalls to userspace
From: David Woodhouse
Date: Mon Jul 20 2026 - 13:19:19 EST
On Tue, 2026-06-30 at 15:56 -0700, Sean Christopherson wrote:
> When handling Xen vCPU hypercalls, explicitly route non-singleshot-timer
> commands to userspace, *before* checking if in-kernel emulation of the Xen
> timer is enabled. Punting hypercalls that are never accelerated by KVM
> because some other hypercall happens to be disabled is confusing and
> actively dangerous, e.g. it's easy to miss that the only reason KVM can
> bail early is because the timer-disabled case provides the same semantics
> as the implicit "default" path in the switch-statement.
>
> Opportunistically convert the switch-statement to an if-else-statement to
> avoid having to carry code for an impossible "default" case.
>
> For all intents and purposes, no functional change intended.
>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
Reviewed-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
Attachment:
smime.p7s
Description: S/MIME cryptographic signature