[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PATCH v2 10/18] s390x/flic: implement qemu_s390_clear_io_f
From: |
David Hildenbrand |
Subject: |
[qemu-s390x] [PATCH v2 10/18] s390x/flic: implement qemu_s390_clear_io_flic() |
Date: |
Wed, 17 Jan 2018 18:40:39 +0100 |
Now that we have access to the io interrupts, we can implement
clear_io_irq() for TCG.
Signed-off-by: David Hildenbrand <address@hidden>
---
hw/intc/s390_flic.c | 31 +++++++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c
index 928bdc3037..cb216de9ba 100644
--- a/hw/intc/s390_flic.c
+++ b/hw/intc/s390_flic.c
@@ -79,8 +79,35 @@ static void qemu_s390_release_adapter_routes(S390FLICState
*fs,
static int qemu_s390_clear_io_flic(S390FLICState *fs, uint16_t subchannel_id,
uint16_t subchannel_nr)
{
- /* Fixme TCG */
- return -ENOSYS;
+ QEMUS390FLICState *flic = QEMU_S390_FLIC(fs);
+ QEMUS390FlicIO *cur, *next;
+ uint8_t isc;
+
+ g_assert(qemu_mutex_iothread_locked());
+ if (!(flic->pending & FLIC_PENDING_IO)) {
+ return 0;
+ }
+
+ /* check all iscs */
+ for (isc = 0; isc < 8; isc++) {
+ if (QLIST_EMPTY(&flic->io[isc])) {
+ continue;
+ }
+
+ /* search and delete any matching one */
+ QLIST_FOREACH_SAFE(cur, &flic->io[isc], next, next) {
+ if (cur->id == subchannel_id && cur->nr == subchannel_nr) {
+ QLIST_REMOVE(cur, next);
+ g_free(cur);
+ }
+ }
+
+ /* update our indicator bit */
+ if (QLIST_EMPTY(&flic->io[isc])) {
+ flic->pending &= ~ISC_TO_PENDING_IO(isc);
+ }
+ }
+ return 0;
}
static int qemu_s390_modify_ais_mode(S390FLICState *fs, uint8_t isc,
--
2.14.3
- [qemu-s390x] [PATCH v2 01/18] s390x/tcg: deliver multiple interrupts in a row, (continued)
- [qemu-s390x] [PATCH v2 01/18] s390x/tcg: deliver multiple interrupts in a row, David Hildenbrand, 2018/01/17
- [qemu-s390x] [PATCH v2 02/18] s390x/flic: simplify flic initialization, David Hildenbrand, 2018/01/17
- [qemu-s390x] [PATCH v2 03/18] s390x/tcg: simplify lookup of flic, David Hildenbrand, 2018/01/17
- [qemu-s390x] [PATCH v2 04/18] s390x/tcg: simplify machine check handling, David Hildenbrand, 2018/01/17
- [qemu-s390x] [PATCH v2 05/18] s390x/flic: factor out injection of floating interrupts, David Hildenbrand, 2018/01/17
- [qemu-s390x] [PATCH v2 06/18] s390x/flic: no need to call s390_io_interrupt() from flic, David Hildenbrand, 2018/01/17
- [qemu-s390x] [PATCH v2 07/18] s390x/tcg: tolerate wrong wakeups due to floating interrupts, David Hildenbrand, 2018/01/17
- [qemu-s390x] [PATCH v2 09/18] s390x/tcg: implement TEST PENDING INTERRUPTION, David Hildenbrand, 2018/01/17
- [qemu-s390x] [PATCH v2 08/18] s390x/flic: make floating interrupts on TCG actually floating, David Hildenbrand, 2018/01/17
- [qemu-s390x] [PATCH v2 10/18] s390x/flic: implement qemu_s390_clear_io_flic(),
David Hildenbrand <=
- [qemu-s390x] [PATCH v2 12/18] s390x: fix size + content of STSI blocks, David Hildenbrand, 2018/01/17
[qemu-s390x] [PATCH v2 11/18] s390x/flic: optimize CPU wakeup for TCG, David Hildenbrand, 2018/01/17
[qemu-s390x] [PATCH v2 14/18] s390x/tcg: remove SMP warning, David Hildenbrand, 2018/01/17
[qemu-s390x] [PATCH v2 13/18] s390x/tcg: STSI overhaul, David Hildenbrand, 2018/01/17
[qemu-s390x] [PATCH v2 15/18] configure: s390x supports mttcg now, David Hildenbrand, 2018/01/17