From: Sheng Yang <sheng@linux.intel.com>
To: Avi Kivity <avi@redhat.com>
Cc: Amit Shah <amit.shah@redhat.com>,
kvm@vger.kernel.org, Sheng Yang <sheng@linux.intel.com>
Subject: [PATCH] KVM: IRQ ACK notifier should be used with in-kernel irqchip
Date: Wed, 8 Oct 2008 17:46:30 +0800 [thread overview]
Message-ID: <1223459190-2014-1-git-send-email-sheng@linux.intel.com> (raw)
In-Reply-To: <200810081732.57205.sheng@linux.intel.com>
Also remove unnecessary parameter of unregister irq ack notifier.
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
---
arch/x86/kvm/irq.c | 8 ++++++--
arch/x86/kvm/irq.h | 3 +--
arch/x86/kvm/x86.c | 2 +-
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kvm/irq.c b/arch/x86/kvm/irq.c
index 8c1b9c5..714bcc1 100644
--- a/arch/x86/kvm/irq.c
+++ b/arch/x86/kvm/irq.c
@@ -124,11 +124,15 @@ void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi)
void kvm_register_irq_ack_notifier(struct kvm *kvm,
struct kvm_irq_ack_notifier *kian)
{
+ /* Must be called with in-kernel IRQ chip, otherwise it's nonsense */
+ ASSERT(irqchip_in_kernel(kvm));
+ ASSERT(kian);
hlist_add_head(&kian->link, &kvm->arch.irq_ack_notifier_list);
}
-void kvm_unregister_irq_ack_notifier(struct kvm *kvm,
- struct kvm_irq_ack_notifier *kian)
+void kvm_unregister_irq_ack_notifier(struct kvm_irq_ack_notifier *kian)
{
+ if (!kian)
+ return;
hlist_del(&kian->link);
}
diff --git a/arch/x86/kvm/irq.h b/arch/x86/kvm/irq.h
index 9f157c9..0c47117 100644
--- a/arch/x86/kvm/irq.h
+++ b/arch/x86/kvm/irq.h
@@ -89,8 +89,7 @@ void kvm_set_irq(struct kvm *kvm, int irq, int level);
void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi);
void kvm_register_irq_ack_notifier(struct kvm *kvm,
struct kvm_irq_ack_notifier *kian);
-void kvm_unregister_irq_ack_notifier(struct kvm *kvm,
- struct kvm_irq_ack_notifier *kian);
+void kvm_unregister_irq_ack_notifier(struct kvm_irq_ack_notifier *kian);
void kvm_timer_intr_post(struct kvm_vcpu *vcpu, int vec);
void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu);
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 675fcc1..8a9a029 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -176,7 +176,7 @@ static void kvm_free_assigned_device(struct kvm *kvm,
if (irqchip_in_kernel(kvm) && assigned_dev->irq_requested)
free_irq(assigned_dev->host_irq, (void *)assigned_dev);
- kvm_unregister_irq_ack_notifier(kvm, &assigned_dev->ack_notifier);
+ kvm_unregister_irq_ack_notifier(&assigned_dev->ack_notifier);
if (cancel_work_sync(&assigned_dev->interrupt_work))
/* We had pending work. That means we will have to take
--
1.5.4.5
next prev parent reply other threads:[~2008-10-08 9:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-08 6:39 [PATCH] KVM: Unregister IRQ ACK notifier with in-kernel irqchip Sheng Yang
2008-10-08 7:08 ` Amit Shah
2008-10-08 8:54 ` Sheng Yang
2008-10-08 9:04 ` Sheng Yang
2008-10-08 9:20 ` Amit Shah
2008-10-08 9:32 ` Sheng Yang
2008-10-08 9:46 ` Sheng Yang [this message]
2008-10-08 9:28 ` [PATCH 1/1] KVM: IRQ ACK notifier should be used " Sheng Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1223459190-2014-1-git-send-email-sheng@linux.intel.com \
--to=sheng@linux.intel.com \
--cc=amit.shah@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.