From: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
Jan Kiszka <jan.kiszka@siemens.com>,
qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>,
qemu-ppc@nongnu.org, David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PATCH] xics: added end-of-interrupt (EOI) handlers
Date: Tue, 10 Jul 2012 23:46:12 +1000 [thread overview]
Message-ID: <1341927973-5615-5-git-send-email-aik@ozlabs.ru> (raw)
In-Reply-To: <1341927973-5615-1-git-send-email-aik@ozlabs.ru>
Normally when the host driver gets called via interrupt, it disables IRQ
first, then handles it and enables back. In the case of PCI pass through,
the actual handling is done by the guest so the host driver needs to know
when to enable IRQ back.
The patch introduces add/remove callback API and EOI initialization for
the XICS interrupt controller.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
hw/xics.c | 18 ++++++++++++++++++
hw/xics.h | 5 +++++
2 files changed, 23 insertions(+)
diff --git a/hw/xics.c b/hw/xics.c
index 668a0d6..de7833e 100644
--- a/hw/xics.c
+++ b/hw/xics.c
@@ -170,6 +170,7 @@ struct ics_irq_state {
int sent:1;
int rejected:1;
int masked_pending:1;
+ NotifierList eoi_notifier;
};
struct ics_state {
@@ -309,6 +310,8 @@ static void ics_eoi(struct ics_state *ics, int nr)
if (irq->type == XICS_LSI) {
irq->sent = 0;
}
+
+ notifier_list_notify(&irq->eoi_notifier, NULL);
}
/*
@@ -536,6 +539,7 @@ struct icp_state *xics_system_init(int nr_irqs)
for (i = 0; i < nr_irqs; i++) {
ics->irqs[i].priority = 0xff;
ics->irqs[i].saved_priority = 0xff;
+ notifier_list_init(&ics->irqs[i].eoi_notifier);
}
ics->qirqs = qemu_allocate_irqs(ics_set_irq, ics, nr_irqs);
@@ -552,3 +556,17 @@ struct icp_state *xics_system_init(int nr_irqs)
return icp;
}
+
+void xics_add_eoi_notifier(Notifier *notify, uint32_t srcno)
+{
+ struct ics_state *ics = spapr->icp->ics;
+ struct ics_irq_state *irq = &ics->irqs[srcno - ics->offset];
+
+ notifier_list_add(&irq->eoi_notifier, notify);
+}
+
+void xics_remove_eoi_notifier(Notifier *notify)
+{
+ notifier_remove(notify);
+}
+
diff --git a/hw/xics.h b/hw/xics.h
index 2080159..762243c 100644
--- a/hw/xics.h
+++ b/hw/xics.h
@@ -27,6 +27,8 @@
#if !defined(__XICS_H__)
#define __XICS_H__
+#include "notify.h"
+
#define XICS_IPI 0x2
struct icp_state;
@@ -41,4 +43,7 @@ qemu_irq xics_assign_irq(struct icp_state *icp, int irq,
struct icp_state *xics_system_init(int nr_irqs);
+void xics_add_eoi_notifier(Notifier *notify, uint32_t srcno);
+void xics_remove_eoi_notifier(Notifier *notify);
+
#endif /* __XICS_H__ */
--
1.7.10
next prev parent reply other threads:[~2012-07-10 13:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <no>
2012-07-10 13:46 ` [Qemu-devel] [PATCH] pseries iommu: h_put_tce split to support more IOMMUs Alexey Kardashevskiy
2012-07-10 13:46 ` [Qemu-devel] [PATCH] pseries pci: removed cached qemu_irq from PCI host bus Alexey Kardashevskiy
2012-07-10 13:46 ` [Qemu-devel] [PATCH] pseries: added allocator for a block of IRQs Alexey Kardashevskiy
2012-07-10 13:46 ` [Qemu-devel] [PATCH] pseries pci: enable debugging with disabled emulated PCI bus Alexey Kardashevskiy
2012-07-10 13:46 ` Alexey Kardashevskiy [this message]
2012-07-13 8:04 ` [Qemu-devel] [PATCH] xics: added end-of-interrupt (EOI) handlers Alexey Kardashevskiy
2012-07-10 13:46 ` [Qemu-devel] [PATCH] pseries dma: DMA window params added to PHB and DT population changed Alexey Kardashevskiy
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=1341927973-5615-5-git-send-email-aik@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=agraf@suse.de \
--cc=david@gibson.dropbear.id.au \
--cc=jan.kiszka@siemens.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).