Re: [PATCH 5/5] KVM: LAPIC: add APIC Timer periodic/oneshot mode VMX preemption timer support

2016-10-21 Thread Wanpeng Li
2016-10-21 2:10 GMT+08:00 Radim Krčmář : > 2016-10-20 06:57+0800, Wanpeng Li: >> 2016-10-20 3:28 GMT+08:00 Radim Krčmář : >>> I think it would be better to add a function to advance the periodic >>> timer and use it in kvm_lapic_expired_hv_timer() and in

Re: [PATCH 5/5] KVM: LAPIC: add APIC Timer periodic/oneshot mode VMX preemption timer support

2016-10-21 Thread Wanpeng Li
2016-10-21 2:10 GMT+08:00 Radim Krčmář : > 2016-10-20 06:57+0800, Wanpeng Li: >> 2016-10-20 3:28 GMT+08:00 Radim Krčmář : >>> I think it would be better to add a function to advance the periodic >>> timer and use it in kvm_lapic_expired_hv_timer() and in apic_timer_fn(). >>> >>> The function can

Re: [PATCH 5/5] KVM: LAPIC: add APIC Timer periodic/oneshot mode VMX preemption timer support

2016-10-20 Thread Radim Krčmář
2016-10-20 06:57+0800, Wanpeng Li: > 2016-10-20 3:28 GMT+08:00 Radim Krčmář : >> I think it would be better to add a function to advance the periodic >> timer and use it in kvm_lapic_expired_hv_timer() and in apic_timer_fn(). >> >> The function can be simpler than

Re: [PATCH 5/5] KVM: LAPIC: add APIC Timer periodic/oneshot mode VMX preemption timer support

2016-10-20 Thread Radim Krčmář
2016-10-20 06:57+0800, Wanpeng Li: > 2016-10-20 3:28 GMT+08:00 Radim Krčmář : >> I think it would be better to add a function to advance the periodic >> timer and use it in kvm_lapic_expired_hv_timer() and in apic_timer_fn(). >> >> The function can be simpler than set_target_expiration(), because

Re: [PATCH 5/5] KVM: LAPIC: add APIC Timer periodic/oneshot mode VMX preemption timer support

2016-10-19 Thread Wanpeng Li
2016-10-20 3:28 GMT+08:00 Radim Krčmář : > 2016-10-17 15:45+0800, Wanpeng Li: >> From: Wanpeng Li >> >> Most windows guests still utilize APIC Timer periodic/oneshot mode >> instead of tsc-deadline mode, and the APIC Timer periodic/oneshot >> mode are

Re: [PATCH 5/5] KVM: LAPIC: add APIC Timer periodic/oneshot mode VMX preemption timer support

2016-10-19 Thread Wanpeng Li
2016-10-20 3:28 GMT+08:00 Radim Krčmář : > 2016-10-17 15:45+0800, Wanpeng Li: >> From: Wanpeng Li >> >> Most windows guests still utilize APIC Timer periodic/oneshot mode >> instead of tsc-deadline mode, and the APIC Timer periodic/oneshot >> mode are still emulated by high overhead hrtimer on

Re: [PATCH 5/5] KVM: LAPIC: add APIC Timer periodic/oneshot mode VMX preemption timer support

2016-10-19 Thread Radim Krčmář
2016-10-17 15:45+0800, Wanpeng Li: > From: Wanpeng Li > > Most windows guests still utilize APIC Timer periodic/oneshot mode > instead of tsc-deadline mode, and the APIC Timer periodic/oneshot > mode are still emulated by high overhead hrtimer on host. This patch >

Re: [PATCH 5/5] KVM: LAPIC: add APIC Timer periodic/oneshot mode VMX preemption timer support

2016-10-19 Thread Radim Krčmář
2016-10-17 15:45+0800, Wanpeng Li: > From: Wanpeng Li > > Most windows guests still utilize APIC Timer periodic/oneshot mode > instead of tsc-deadline mode, and the APIC Timer periodic/oneshot > mode are still emulated by high overhead hrtimer on host. This patch > converts the expected expire

Re: [PATCH 5/5] KVM: LAPIC: add APIC Timer periodic/oneshot mode VMX preemption timer support

2016-10-17 Thread Paolo Bonzini
On 17/10/2016 09:45, Wanpeng Li wrote: > + remaining = ktime_sub(apic->lapic_timer.target_expiration, now); > if (ktime_to_ns(remaining) < 0) > remaining = ktime_set(0, 0); > > @@ -1351,13 +1352,28 @@ static void start_sw_period(struct kvm_lapic *apic) > { >

Re: [PATCH 5/5] KVM: LAPIC: add APIC Timer periodic/oneshot mode VMX preemption timer support

2016-10-17 Thread Paolo Bonzini
On 17/10/2016 09:45, Wanpeng Li wrote: > + remaining = ktime_sub(apic->lapic_timer.target_expiration, now); > if (ktime_to_ns(remaining) < 0) > remaining = ktime_set(0, 0); > > @@ -1351,13 +1352,28 @@ static void start_sw_period(struct kvm_lapic *apic) > { >

[PATCH 5/5] KVM: LAPIC: add APIC Timer periodic/oneshot mode VMX preemption timer support

2016-10-17 Thread Wanpeng Li
From: Wanpeng Li Most windows guests still utilize APIC Timer periodic/oneshot mode instead of tsc-deadline mode, and the APIC Timer periodic/oneshot mode are still emulated by high overhead hrtimer on host. This patch converts the expected expire time of the

[PATCH 5/5] KVM: LAPIC: add APIC Timer periodic/oneshot mode VMX preemption timer support

2016-10-17 Thread Wanpeng Li
From: Wanpeng Li Most windows guests still utilize APIC Timer periodic/oneshot mode instead of tsc-deadline mode, and the APIC Timer periodic/oneshot mode are still emulated by high overhead hrtimer on host. This patch converts the expected expire time of the periodic/oneshot mode to guest