|
@@ -1463,23 +1463,6 @@ static void start_sw_tscdeadline(struct kvm_lapic *apic)
|
|
local_irq_restore(flags);
|
|
local_irq_restore(flags);
|
|
}
|
|
}
|
|
|
|
|
|
-static void start_sw_period(struct kvm_lapic *apic)
|
|
|
|
-{
|
|
|
|
- if (!apic->lapic_timer.period)
|
|
|
|
- return;
|
|
|
|
-
|
|
|
|
- if (apic_lvtt_oneshot(apic) &&
|
|
|
|
- ktime_after(ktime_get(),
|
|
|
|
- apic->lapic_timer.target_expiration)) {
|
|
|
|
- apic_timer_expired(apic);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- hrtimer_start(&apic->lapic_timer.timer,
|
|
|
|
- apic->lapic_timer.target_expiration,
|
|
|
|
- HRTIMER_MODE_ABS_PINNED);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static void update_target_expiration(struct kvm_lapic *apic, uint32_t old_divisor)
|
|
static void update_target_expiration(struct kvm_lapic *apic, uint32_t old_divisor)
|
|
{
|
|
{
|
|
ktime_t now, remaining;
|
|
ktime_t now, remaining;
|
|
@@ -1546,6 +1529,26 @@ static void advance_periodic_target_expiration(struct kvm_lapic *apic)
|
|
apic->lapic_timer.period);
|
|
apic->lapic_timer.period);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void start_sw_period(struct kvm_lapic *apic)
|
|
|
|
+{
|
|
|
|
+ if (!apic->lapic_timer.period)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ if (ktime_after(ktime_get(),
|
|
|
|
+ apic->lapic_timer.target_expiration)) {
|
|
|
|
+ apic_timer_expired(apic);
|
|
|
|
+
|
|
|
|
+ if (apic_lvtt_oneshot(apic))
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ advance_periodic_target_expiration(apic);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ hrtimer_start(&apic->lapic_timer.timer,
|
|
|
|
+ apic->lapic_timer.target_expiration,
|
|
|
|
+ HRTIMER_MODE_ABS_PINNED);
|
|
|
|
+}
|
|
|
|
+
|
|
bool kvm_lapic_hv_timer_in_use(struct kvm_vcpu *vcpu)
|
|
bool kvm_lapic_hv_timer_in_use(struct kvm_vcpu *vcpu)
|
|
{
|
|
{
|
|
if (!lapic_in_kernel(vcpu))
|
|
if (!lapic_in_kernel(vcpu))
|