s390_flic.c (6e0d8175d63afba248f7da09047d0fcedd1e953d) s390_flic.c (631b59664c9d8472d64c9c9c14b709dd40f07b16)
1/*
2 * QEMU S390x floating interrupt controller (flic)
3 *
4 * Copyright 2014 IBM Corp.
5 * Author(s): Jens Freimann <jfrei@linux.vnet.ibm.com>
6 * Cornelia Huck <cornelia.huck@de.ibm.com>
7 *
8 * This work is licensed under the terms of the GNU GPL, version 2 or (at

--- 147 unchanged lines hidden (view full) ---

156}
157
158static void qemu_s390_flic_notify(uint32_t type)
159{
160 CPUState *cs;
161
162 /*
163 * We have to make all CPUs see CPU_INTERRUPT_HARD, so they might
1/*
2 * QEMU S390x floating interrupt controller (flic)
3 *
4 * Copyright 2014 IBM Corp.
5 * Author(s): Jens Freimann <jfrei@linux.vnet.ibm.com>
6 * Cornelia Huck <cornelia.huck@de.ibm.com>
7 *
8 * This work is licensed under the terms of the GNU GPL, version 2 or (at

--- 147 unchanged lines hidden (view full) ---

156}
157
158static void qemu_s390_flic_notify(uint32_t type)
159{
160 CPUState *cs;
161
162 /*
163 * We have to make all CPUs see CPU_INTERRUPT_HARD, so they might
164 * consider it. TODO: don't kick/wakeup all VCPUs but try to be
165 * smarter (using the interrupt type).
164 * consider it. We will kick all running CPUs and only relevant
165 * sleeping ones.
166 */
167 CPU_FOREACH(cs) {
166 */
167 CPU_FOREACH(cs) {
168 S390CPU *cpu = S390_CPU(cs);
169
170 cs->interrupt_request |= CPU_INTERRUPT_HARD;
171
172 /* ignore CPUs that are not sleeping */
173 if (s390_cpu_get_state(cpu) != CPU_STATE_OPERATING &&
174 s390_cpu_get_state(cpu) != CPU_STATE_LOAD) {
175 continue;
176 }
177
178 /* we always kick running CPUs for now, this is tricky */
179 if (cs->halted) {
180 /* don't check for subclasses, CPUs double check when waking up */
181 if (type & FLIC_PENDING_SERVICE) {
182 if (!(cpu->env.psw.mask & PSW_MASK_EXT)) {
183 continue;
184 }
185 } else if (type & FLIC_PENDING_IO) {
186 if (!(cpu->env.psw.mask & PSW_MASK_IO)) {
187 continue;
188 }
189 } else if (type & FLIC_PENDING_MCHK_CR) {
190 if (!(cpu->env.psw.mask & PSW_MASK_MCHECK)) {
191 continue;
192 }
193 }
194 }
168 cpu_interrupt(cs, CPU_INTERRUPT_HARD);
169 }
170}
171
172uint32_t qemu_s390_flic_dequeue_service(QEMUS390FLICState *flic)
173{
174 uint32_t tmp;
175

--- 278 unchanged lines hidden ---
195 cpu_interrupt(cs, CPU_INTERRUPT_HARD);
196 }
197}
198
199uint32_t qemu_s390_flic_dequeue_service(QEMUS390FLICState *flic)
200{
201 uint32_t tmp;
202

--- 278 unchanged lines hidden ---