lkml.org 
[lkml]   [2022]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/2] KVM: x86/xen: Stop Xen timer before changing IRQ
On Tue, Aug 09, 2022, Paolo Bonzini wrote:
> On 8/9/22 16:16, David Woodhouse wrote:
> > I find the new version a bit harder to follow, with its init-then-stop-
> > then-start logic:
> >
> > case KVM_XEN_VCPU_ATTR_TYPE_TIMER:
> > if (data->u.timer.port &&
> > data->u.timer.priority != KVM_IRQ_ROUTING_XEN_EVTCHN_PRIO_2LEVEL) {
> > r = -EINVAL;
> > break;
> > }
> >
> > if (!vcpu->arch.xen.timer.function)
> > kvm_xen_init_timer(vcpu);
> >
> > /* Stop the timer (if it's running) before changing the vector */
> > kvm_xen_stop_timer(vcpu);
> > vcpu->arch.xen.timer_virq = data->u.timer.port;
>
>
> I think this is fine, if anything the kvm_xen_stop_timer() call could be
> placed in an "else" but I'm leaning towards applying this version of the
> patch.

I wanted to separate the "init" from the "stop+start", e.g. if there were a more
appropriate place for invoking kvm_xen_init_timer() I would have suggested moving
the call outside of KVM_XEN_VCPU_ATTR_TYPE_TIMER entirely.

\
 
 \ /
  Last update: 2022-08-09 16:41    [W:0.064 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site