aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-09-19 12:44:07 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:52:56 -0400
commitf4f510508741680e423524c222f615276ca6222c (patch)
tree6c5212b82659ff7c0e7c9124b3583ea39987bc83
parent28e4639adf0c9f26f6bb56149b7ab547bf33bb95 (diff)
KVM: Convert PIC lock from raw spinlock to ordinary spinlock
The PIC code used to be called from preempt_disable() context, which wasn't very good for PREEMPT_RT. That is no longer the case, so move back from raw_spinlock_t to spinlock_t. Signed-off-by: Avi Kivity <avi@redhat.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r--arch/x86/kvm/i8259.c6
-rw-r--r--arch/x86/kvm/irq.h2
-rw-r--r--arch/x86/kvm/x86.c8
3 files changed, 8 insertions, 8 deletions
diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
index ab1bb8ff9a8d..dd54c5bb2e5e 100644
--- a/arch/x86/kvm/i8259.c
+++ b/arch/x86/kvm/i8259.c
@@ -39,7 +39,7 @@ static void pic_irq_request(struct kvm *kvm, int level);
39static void pic_lock(struct kvm_pic *s) 39static void pic_lock(struct kvm_pic *s)
40 __acquires(&s->lock) 40 __acquires(&s->lock)
41{ 41{
42 raw_spin_lock(&s->lock); 42 spin_lock(&s->lock);
43} 43}
44 44
45static void pic_unlock(struct kvm_pic *s) 45static void pic_unlock(struct kvm_pic *s)
@@ -51,7 +51,7 @@ static void pic_unlock(struct kvm_pic *s)
51 51
52 s->wakeup_needed = false; 52 s->wakeup_needed = false;
53 53
54 raw_spin_unlock(&s->lock); 54 spin_unlock(&s->lock);
55 55
56 if (wakeup) { 56 if (wakeup) {
57 kvm_for_each_vcpu(i, vcpu, s->kvm) { 57 kvm_for_each_vcpu(i, vcpu, s->kvm) {
@@ -569,7 +569,7 @@ struct kvm_pic *kvm_create_pic(struct kvm *kvm)
569 s = kzalloc(sizeof(struct kvm_pic), GFP_KERNEL); 569 s = kzalloc(sizeof(struct kvm_pic), GFP_KERNEL);
570 if (!s) 570 if (!s)
571 return NULL; 571 return NULL;
572 raw_spin_lock_init(&s->lock); 572 spin_lock_init(&s->lock);
573 s->kvm = kvm; 573 s->kvm = kvm;
574 s->pics[0].elcr_mask = 0xf8; 574 s->pics[0].elcr_mask = 0xf8;
575 s->pics[1].elcr_mask = 0xde; 575 s->pics[1].elcr_mask = 0xde;
diff --git a/arch/x86/kvm/irq.h b/arch/x86/kvm/irq.h
index 63c314502993..ba910d149410 100644
--- a/arch/x86/kvm/irq.h
+++ b/arch/x86/kvm/irq.h
@@ -60,7 +60,7 @@ struct kvm_kpic_state {
60}; 60};
61 61
62struct kvm_pic { 62struct kvm_pic {
63 raw_spinlock_t lock; 63 spinlock_t lock;
64 bool wakeup_needed; 64 bool wakeup_needed;
65 unsigned pending_acks; 65 unsigned pending_acks;
66 struct kvm *kvm; 66 struct kvm *kvm;
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 0b021e16f9dd..3adf6921e88e 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3011,18 +3011,18 @@ static int kvm_vm_ioctl_set_irqchip(struct kvm *kvm, struct kvm_irqchip *chip)
3011 r = 0; 3011 r = 0;
3012 switch (chip->chip_id) { 3012 switch (chip->chip_id) {
3013 case KVM_IRQCHIP_PIC_MASTER: 3013 case KVM_IRQCHIP_PIC_MASTER:
3014 raw_spin_lock(&pic_irqchip(kvm)->lock); 3014 spin_lock(&pic_irqchip(kvm)->lock);
3015 memcpy(&pic_irqchip(kvm)->pics[0], 3015 memcpy(&pic_irqchip(kvm)->pics[0],
3016 &chip->chip.pic, 3016 &chip->chip.pic,
3017 sizeof(struct kvm_pic_state)); 3017 sizeof(struct kvm_pic_state));
3018 raw_spin_unlock(&pic_irqchip(kvm)->lock); 3018 spin_unlock(&pic_irqchip(kvm)->lock);
3019 break; 3019 break;
3020 case KVM_IRQCHIP_PIC_SLAVE: 3020 case KVM_IRQCHIP_PIC_SLAVE:
3021 raw_spin_lock(&pic_irqchip(kvm)->lock); 3021 spin_lock(&pic_irqchip(kvm)->lock);
3022 memcpy(&pic_irqchip(kvm)->pics[1], 3022 memcpy(&pic_irqchip(kvm)->pics[1],
3023 &chip->chip.pic, 3023 &chip->chip.pic,
3024 sizeof(struct kvm_pic_state)); 3024 sizeof(struct kvm_pic_state));
3025 raw_spin_unlock(&pic_irqchip(kvm)->lock); 3025 spin_unlock(&pic_irqchip(kvm)->lock);
3026 break; 3026 break;
3027 case KVM_IRQCHIP_IOAPIC: 3027 case KVM_IRQCHIP_IOAPIC:
3028 r = kvm_set_ioapic(kvm, &chip->chip.ioapic); 3028 r = kvm_set_ioapic(kvm, &chip->chip.ioapic);