[Devel] [PATCH RHEL7 COMMIT] ms/KVM: i8254: add kvm_pit_reset_reinject
Konstantin Khorenko
khorenko at virtuozzo.com
Fri Dec 9 05:23:24 PST 2016
The commit is pushed to "branch-rh7-3.10.0-327.36.1.vz7.20.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.36.1.vz7.20.14
------>
commit aaf5cfc9385cecf85abf2ebfa7cf55a99aec920e
Author: Radim KrÄmáŠ<rkrcmar at redhat.com>
Date: Fri Dec 9 17:23:23 2016 +0400
ms/KVM: i8254: add kvm_pit_reset_reinject
pit_state.pending and pit_state.irq_ack are always reset at the same
time. Create a function for them.
Signed-off-by: Radim KrÄmáŠ<rkrcmar at redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
ms commit fd700a00dc2e821be92b0b56fd5d8ebf8c63f9ba
("KVM: i8254: add kvm_pit_reset_reinject")
Fixes https://jira.sw.ru/browse/PSBM-56972
Signed-off-by: Evgeny Yakovlev <eyakovlev at virtuozzo.com>
---
arch/x86/kvm/i8254.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
index b1bdc4f..4dedeb0 100644
--- a/arch/x86/kvm/i8254.c
+++ b/arch/x86/kvm/i8254.c
@@ -320,6 +320,12 @@ static enum hrtimer_restart pit_timer_fn(struct hrtimer *data)
return HRTIMER_NORESTART;
}
+static inline void kvm_pit_reset_reinject(struct kvm_pit *pit)
+{
+ atomic_set(&pit->pit_state.pending, 0);
+ pit->pit_state.irq_ack = 1;
+}
+
static void create_pit_timer(struct kvm *kvm, u32 val, int is_period)
{
struct kvm_kpit_state *ps = &kvm->arch.vpit->pit_state;
@@ -341,8 +347,7 @@ static void create_pit_timer(struct kvm *kvm, u32 val, int is_period)
ps->timer.function = pit_timer_fn;
ps->kvm = ps->pit->kvm;
- atomic_set(&ps->pending, 0);
- ps->irq_ack = 1;
+ kvm_pit_reset_reinject(ps->pit);
/*
* Do not allow the guest to program periodic timers with small
@@ -637,18 +642,15 @@ void kvm_pit_reset(struct kvm_pit *pit)
}
mutex_unlock(&pit->pit_state.lock);
- atomic_set(&pit->pit_state.pending, 0);
- pit->pit_state.irq_ack = 1;
+ kvm_pit_reset_reinject(pit);
}
static void pit_mask_notifer(struct kvm_irq_mask_notifier *kimn, bool mask)
{
struct kvm_pit *pit = container_of(kimn, struct kvm_pit, mask_notifier);
- if (!mask) {
- atomic_set(&pit->pit_state.pending, 0);
- pit->pit_state.irq_ack = 1;
- }
+ if (!mask)
+ kvm_pit_reset_reinject(pit);
}
static const struct kvm_io_device_ops pit_dev_ops = {
More information about the Devel
mailing list