Re: [PATCH 04/21] KVM: x86/xen: Initialize hrtimer in kvm_xen_init_vcpu()
From: Sean Christopherson
Date: Wed Oct 30 2024 - 14:05:36 EST
On Mon, Oct 28, 2024, Nam Cao wrote:
> The hrtimer is initialized in the KVM_XEN_VCPU_SET_ATTR ioctl. That caused
> problem in the past, because the hrtimer can be initialized multiple times,
> which was fixed by commit af735db31285 ("KVM: x86/xen: Initialize Xen timer
> only once"). This commit avoids initializing the timer multiple times by
> checking the field 'function' of struct hrtimer to determine if it has
> already been initialized.
>
> Instead of "abusing" the 'function' field, move the hrtimer initialization
> into kvm_xen_init_vcpu() so that it will only be initialized once.
>
> Signed-off-by: Nam Cao <namcao@xxxxxxxxxxxxx>
With or without the helper dropped, which can easily go on top at our leisure:
Acked-by: Sean Christopherson <seanjc@xxxxxxxxxx>