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>