Re: [PATCH v4 05/11] KVM: x86/xen: Consolidate checks on Xen vCPU ID for singleshot timer hypercalls
From: Philippe Mathieu-Daudé
Date: Wed Jul 01 2026 - 11:14:23 EST
On 1/7/26 00:56, Sean Christopherson wrote:
Hoist the checks on the Xen vCPU ID when handling set_singleshot_timer and
stop_singleshot_timer hypercalls out of their individual if-statements,
so that both checks on the ID are in common code. kvm_xen_hcall_vcpu_op()
is already doubly committed to handling only singleshot timer hypercalls,
and even if that were to change in the future, the function could simply
be renamed and turned into a helper specifically for timer hypercalls.
Opportunistically add a comment to explain why the check exists; the code
looks rather nonsensical without the knowledge that @vcpu_id is a common
param for all per-vCPU hypercalls.
No functional change intended.
Reviewed-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
---
arch/x86/kvm/xen.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxxxxxxxx>