All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PATCH 1/3] xics: added end-of-interrupt (EOI) handlers
Date: Mon, 23 Jul 2012 15:32:45 +1000	[thread overview]
Message-ID: <1343021567-3701-2-git-send-email-aik@ozlabs.ru> (raw)
In-Reply-To: <1343021567-3701-1-git-send-email-aik@ozlabs.ru>

The patch adds EOI handler to process h_eoi RTAS call correctly
for PCI legacy interrupts.

This functionality is going to be used in VFIO later.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 hw/xics.c |   13 +++++++++++++
 hw/xics.h |    4 ++++
 2 files changed, 17 insertions(+)

diff --git a/hw/xics.c b/hw/xics.c
index 668a0d6..d36d62c 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,12 @@ 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);
+}
+
diff --git a/hw/xics.h b/hw/xics.h
index 2080159..ca75fac 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,6 @@ 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);
+
 #endif /* __XICS_H__ */
-- 
1.7.10.4

  reply	other threads:[~2012-07-23  5:33 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-10  5:51 [Qemu-devel] [PATCH 0/2] RFC: powerpc-vfio: adding support Alexey Kardashevskiy
2012-07-10  5:51 ` [Qemu-devel] [PATCH 1/2] pseries pci: spapr_finalize_pci_setup introduced Alexey Kardashevskiy
2012-07-10  5:51 ` [Qemu-devel] [PATCH 2/2] vfio-powerpc: added VFIO support Alexey Kardashevskiy
2012-07-10 16:55   ` Alex Williamson
2012-07-10 21:32     ` Benjamin Herrenschmidt
2012-07-10 21:48       ` Alex Williamson
2012-07-10 21:53         ` Benjamin Herrenschmidt
2012-07-11  2:54     ` Alexey Kardashevskiy
2012-07-11  3:10       ` Benjamin Herrenschmidt
2012-07-12  3:11       ` Alex Williamson
2012-07-12  8:47         ` Alexey Kardashevskiy
2012-07-10 22:26   ` Scott Wood
2012-07-10 23:55     ` Alexey Kardashevskiy
2012-07-11  0:04       ` Benjamin Herrenschmidt
2012-07-11  0:17         ` Alexey Kardashevskiy
2012-07-11  0:26           ` Benjamin Herrenschmidt
2012-07-10 16:57 ` [Qemu-devel] [PATCH 0/2] RFC: powerpc-vfio: adding support Alex Williamson
2012-07-11  2:25   ` Alexey Kardashevskiy
2012-07-12  2:54     ` Alex Williamson
2012-07-12  4:16       ` Alexey Kardashevskiy
2012-07-12  4:31         ` Alex Williamson
2012-07-12  4:38           ` Alexey Kardashevskiy
2012-07-12  4:43             ` Alex Williamson
2012-07-12  4:58               ` Alexey Kardashevskiy
2012-07-12  5:29                 ` Alex Williamson
2012-07-12  5:47                   ` Alexey Kardashevskiy
2012-07-16  3:51                     ` Alexey Kardashevskiy
2012-07-23  5:32                   ` [Qemu-devel] [PATCH 0/3] vfio-pci: reworking end-of-interrupt Alexey Kardashevskiy
2012-07-23  5:32                     ` Alexey Kardashevskiy [this message]
2012-07-23  5:32                     ` [Qemu-devel] [PATCH 2/3] ioapic: removed obsolete ioapic_remove_gsi_eoi_notifier Alexey Kardashevskiy
2012-07-23  5:32                     ` [Qemu-devel] [PATCH 3/3] vfio-pci: rework of EOI Alexey Kardashevskiy
2012-07-12  8:52 ` [Qemu-devel] [PATCH] RFC: vfio-powerpc: added VFIO support (v2) Alexey Kardashevskiy
2012-07-12 20:54   ` [Qemu-devel] [Qemu-ppc] " Blue Swirl
2012-07-12 21:37     ` Alex Williamson
2012-07-13  5:24     ` Alexey Kardashevskiy
2012-07-13 14:33       ` Blue Swirl
2012-07-12 22:35   ` Scott Wood
2012-07-13  5:31     ` Alexey Kardashevskiy
2012-07-13  3:47   ` [Qemu-devel] " Alex Williamson
2012-07-13  5:03     ` Alexey Kardashevskiy
2012-07-13  7:26 ` [Qemu-devel] [PATCH] RFC: vfio-powerpc: added VFIO support (v3) Alexey Kardashevskiy
2012-07-13 14:38   ` Blue Swirl
2012-07-13 15:07   ` Alex Williamson
2012-07-14  2:34     ` Alexey Kardashevskiy
2012-07-16 14:21       ` Alex Williamson
2012-07-16 21:17         ` Alex Williamson
2012-07-17  7:53         ` Alexey Kardashevskiy
2012-07-17 14:11           ` Alex Williamson
2012-07-18 11:09 ` [Qemu-devel] [PATCH] vfio-powerpc: added VFIO support (v4) Alexey Kardashevskiy
2012-07-18 14:14   ` Alex Williamson
2012-07-19  4:01     ` Alexey Kardashevskiy
2012-07-19  4:04 ` [Qemu-devel] [PATCH] vfio-powerpc: added VFIO support (v5) 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=1343021567-3701-2-git-send-email-aik@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=alex.williamson@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --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 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.