2 * S/390 misc helper routines
4 * Copyright (c) 2009 Ulrich Hecht
5 * Copyright (c) 2009 Alexander Graf
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
21 #include "qemu/osdep.h"
22 #include "qemu/main-loop.h"
25 #include "exec/memory.h"
26 #include "qemu/host-utils.h"
27 #include "exec/helper-proto.h"
28 #include "qemu/timer.h"
29 #include "exec/address-spaces.h"
30 #include "exec/exec-all.h"
31 #include "exec/cpu_ldst.h"
33 #if !defined(CONFIG_USER_ONLY)
34 #include "sysemu/cpus.h"
35 #include "sysemu/sysemu.h"
36 #include "hw/s390x/ebcdic.h"
37 #include "hw/s390x/s390-virtio-hcall.h"
38 #include "hw/s390x/sclp.h"
39 #include "hw/s390x/s390_flic.h"
40 #include "hw/s390x/ioinst.h"
41 #include "hw/s390x/s390-pci-inst.h"
42 #include "hw/boards.h"
45 /* #define DEBUG_HELPER */
47 #define HELPER_LOG(x...) qemu_log(x)
49 #define HELPER_LOG(x...)
52 /* Raise an exception statically from a TB. */
53 void HELPER(exception
)(CPUS390XState
*env
, uint32_t excp
)
55 CPUState
*cs
= CPU(s390_env_get_cpu(env
));
57 HELPER_LOG("%s: exception %d\n", __func__
, excp
);
58 cs
->exception_index
= excp
;
62 /* Store CPU Timer (also used for EXTRACT CPU TIME) */
63 uint64_t HELPER(stpt
)(CPUS390XState
*env
)
65 #if defined(CONFIG_USER_ONLY)
67 * Fake a descending CPU timer. We could get negative values here,
68 * but we don't care as it is up to the OS when to process that
69 * interrupt and reset to > 0.
71 return UINT64_MAX
- (uint64_t)cpu_get_host_ticks();
73 return time2tod(env
->cputm
- qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL
));
77 #ifndef CONFIG_USER_ONLY
79 /* SCLP service call */
80 uint32_t HELPER(servc
)(CPUS390XState
*env
, uint64_t r1
, uint64_t r2
)
82 qemu_mutex_lock_iothread();
83 int r
= sclp_service_call(env
, r1
, r2
);
84 qemu_mutex_unlock_iothread();
86 s390_program_interrupt(env
, -r
, 4, GETPC());
91 void HELPER(diag
)(CPUS390XState
*env
, uint32_t r1
, uint32_t r3
, uint32_t num
)
98 qemu_mutex_lock_iothread();
99 r
= s390_virtio_hypercall(env
);
100 qemu_mutex_unlock_iothread();
108 qemu_mutex_lock_iothread();
109 handle_diag_308(env
, r1
, r3
, GETPC());
110 qemu_mutex_unlock_iothread();
114 /* time bomb (watchdog) */
115 r
= handle_diag_288(env
, r1
, r3
);
123 s390_program_interrupt(env
, PGM_SPECIFICATION
, ILEN_AUTO
, GETPC());
128 void HELPER(spx
)(CPUS390XState
*env
, uint64_t a1
)
130 CPUState
*cs
= CPU(s390_env_get_cpu(env
));
131 uint32_t prefix
= a1
& 0x7fffe000;
134 HELPER_LOG("prefix: %#x\n", prefix
);
135 tlb_flush_page(cs
, 0);
136 tlb_flush_page(cs
, TARGET_PAGE_SIZE
);
140 uint64_t HELPER(stck
)(CPUS390XState
*env
)
144 time
= env
->tod_offset
+
145 time2tod(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL
) - env
->tod_basetime
);
150 /* Set Clock Comparator */
151 void HELPER(sckc
)(CPUS390XState
*env
, uint64_t time
)
159 /* difference between origins */
160 time
-= env
->tod_offset
;
163 time
= tod2time(time
);
165 timer_mod(env
->tod_timer
, env
->tod_basetime
+ time
);
168 /* Set Tod Programmable Field */
169 void HELPER(sckpf
)(CPUS390XState
*env
, uint64_t r0
)
173 if (val
& 0xffff0000) {
174 s390_program_interrupt(env
, PGM_SPECIFICATION
, 2, GETPC());
179 /* Store Clock Comparator */
180 uint64_t HELPER(stckc
)(CPUS390XState
*env
)
186 void HELPER(spt
)(CPUS390XState
*env
, uint64_t time
)
193 time
= tod2time(time
);
195 env
->cputm
= qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL
) + time
;
197 timer_mod(env
->cpu_timer
, env
->cputm
);
200 /* Store System Information */
201 uint32_t HELPER(stsi
)(CPUS390XState
*env
, uint64_t a0
, uint64_t r0
, uint64_t r1
)
203 const uintptr_t ra
= GETPC();
204 const uint32_t sel1
= r0
& STSI_R0_SEL1_MASK
;
205 const uint32_t sel2
= r1
& STSI_R1_SEL2_MASK
;
206 const MachineState
*ms
= MACHINE(qdev_get_machine());
207 uint16_t total_cpus
= 0, conf_cpus
= 0, reserved_cpus
= 0;
208 S390CPU
*cpu
= s390_env_get_cpu(env
);
212 if ((r0
& STSI_R0_FC_MASK
) > STSI_R0_FC_LEVEL_3
) {
213 /* invalid function code: no other checks are performed */
217 if ((r0
& STSI_R0_RESERVED_MASK
) || (r1
& STSI_R1_RESERVED_MASK
)) {
218 s390_program_interrupt(env
, PGM_SPECIFICATION
, 4, ra
);
221 if ((r0
& STSI_R0_FC_MASK
) == STSI_R0_FC_CURRENT
) {
222 /* query the current level: no further checks are performed */
223 env
->regs
[0] = STSI_R0_FC_LEVEL_3
;
227 if (a0
& ~TARGET_PAGE_MASK
) {
228 s390_program_interrupt(env
, PGM_SPECIFICATION
, 4, ra
);
231 /* count the cpus and split them into configured and reserved ones */
232 for (i
= 0; i
< ms
->possible_cpus
->len
; i
++) {
234 if (ms
->possible_cpus
->cpus
[i
].cpu
) {
242 * In theory, we could report Level 1 / Level 2 as current. However,
243 * the Linux kernel will detect this as running under LPAR and assume
244 * that we have a sclp linemode console (which is always present on
245 * LPAR, but not the default for QEMU), therefore not displaying boot
246 * messages and making booting a Linux kernel under TCG harder.
248 * For now we fake the same SMP configuration on all levels.
250 * TODO: We could later make the level configurable via the machine
251 * and change defaults (linemode console) based on machine type
254 switch (r0
& STSI_R0_FC_MASK
) {
255 case STSI_R0_FC_LEVEL_1
:
256 if ((sel1
== 1) && (sel2
== 1)) {
257 /* Basic Machine Configuration */
260 ebcdic_put(sysib
.sysib_111
.manuf
, "QEMU ", 16);
261 /* same as machine type number in STORE CPU ID, but in EBCDIC */
262 snprintf(type
, ARRAY_SIZE(type
), "%X", cpu
->model
->def
->type
);
263 ebcdic_put(sysib
.sysib_111
.type
, type
, 4);
264 /* model number (not stored in STORE CPU ID for z/Architecure) */
265 ebcdic_put(sysib
.sysib_111
.model
, "QEMU ", 16);
266 ebcdic_put(sysib
.sysib_111
.sequence
, "QEMU ", 16);
267 ebcdic_put(sysib
.sysib_111
.plant
, "QEMU", 4);
268 } else if ((sel1
== 2) && (sel2
== 1)) {
269 /* Basic Machine CPU */
270 ebcdic_put(sysib
.sysib_121
.sequence
, "QEMUQEMUQEMUQEMU", 16);
271 ebcdic_put(sysib
.sysib_121
.plant
, "QEMU", 4);
272 sysib
.sysib_121
.cpu_addr
= cpu_to_be16(env
->core_id
);
273 } else if ((sel1
== 2) && (sel2
== 2)) {
274 /* Basic Machine CPUs */
275 sysib
.sysib_122
.capability
= cpu_to_be32(0x443afc29);
276 sysib
.sysib_122
.total_cpus
= cpu_to_be16(total_cpus
);
277 sysib
.sysib_122
.conf_cpus
= cpu_to_be16(conf_cpus
);
278 sysib
.sysib_122
.reserved_cpus
= cpu_to_be16(reserved_cpus
);
283 case STSI_R0_FC_LEVEL_2
:
284 if ((sel1
== 2) && (sel2
== 1)) {
286 ebcdic_put(sysib
.sysib_221
.sequence
, "QEMUQEMUQEMUQEMU", 16);
287 ebcdic_put(sysib
.sysib_221
.plant
, "QEMU", 4);
288 sysib
.sysib_221
.cpu_addr
= cpu_to_be16(env
->core_id
);
289 } else if ((sel1
== 2) && (sel2
== 2)) {
291 sysib
.sysib_222
.lcpuc
= 0x80; /* dedicated */
292 sysib
.sysib_222
.total_cpus
= cpu_to_be16(total_cpus
);
293 sysib
.sysib_222
.conf_cpus
= cpu_to_be16(conf_cpus
);
294 sysib
.sysib_222
.reserved_cpus
= cpu_to_be16(reserved_cpus
);
295 ebcdic_put(sysib
.sysib_222
.name
, "QEMU ", 8);
296 sysib
.sysib_222
.caf
= cpu_to_be32(1000);
297 sysib
.sysib_222
.dedicated_cpus
= cpu_to_be16(conf_cpus
);
302 case STSI_R0_FC_LEVEL_3
:
303 if ((sel1
== 2) && (sel2
== 2)) {
305 sysib
.sysib_322
.count
= 1;
306 sysib
.sysib_322
.vm
[0].total_cpus
= cpu_to_be16(total_cpus
);
307 sysib
.sysib_322
.vm
[0].conf_cpus
= cpu_to_be16(conf_cpus
);
308 sysib
.sysib_322
.vm
[0].reserved_cpus
= cpu_to_be16(reserved_cpus
);
309 sysib
.sysib_322
.vm
[0].caf
= cpu_to_be32(1000);
310 /* Linux kernel uses this to distinguish us from z/VM */
311 ebcdic_put(sysib
.sysib_322
.vm
[0].cpi
, "KVM/Linux ", 16);
312 sysib
.sysib_322
.vm
[0].ext_name_encoding
= 2; /* UTF-8 */
314 /* If our VM has a name, use the real name */
316 memset(sysib
.sysib_322
.vm
[0].name
, 0x40,
317 sizeof(sysib
.sysib_322
.vm
[0].name
));
318 ebcdic_put(sysib
.sysib_322
.vm
[0].name
, qemu_name
,
319 MIN(sizeof(sysib
.sysib_322
.vm
[0].name
),
321 strncpy((char *)sysib
.sysib_322
.ext_names
[0], qemu_name
,
322 sizeof(sysib
.sysib_322
.ext_names
[0]));
324 ebcdic_put(sysib
.sysib_322
.vm
[0].name
, "TCGguest", 8);
325 strcpy((char *)sysib
.sysib_322
.ext_names
[0], "TCGguest");
329 memcpy(sysib
.sysib_322
.vm
[0].uuid
, &qemu_uuid
,
330 sizeof(sysib
.sysib_322
.vm
[0].uuid
));
338 if (s390_cpu_virt_mem_write(cpu
, a0
, 0, &sysib
, sizeof(sysib
))) {
339 s390_cpu_virt_mem_handle_exc(cpu
, ra
);
346 uint32_t HELPER(sigp
)(CPUS390XState
*env
, uint64_t order_code
, uint32_t r1
,
351 /* TODO: needed to inject interrupts - push further down */
352 qemu_mutex_lock_iothread();
353 cc
= handle_sigp(env
, order_code
& SIGP_ORDER_MASK
, r1
, r3
);
354 qemu_mutex_unlock_iothread();
360 #ifndef CONFIG_USER_ONLY
361 void HELPER(xsch
)(CPUS390XState
*env
, uint64_t r1
)
363 S390CPU
*cpu
= s390_env_get_cpu(env
);
364 qemu_mutex_lock_iothread();
365 ioinst_handle_xsch(cpu
, r1
, GETPC());
366 qemu_mutex_unlock_iothread();
369 void HELPER(csch
)(CPUS390XState
*env
, uint64_t r1
)
371 S390CPU
*cpu
= s390_env_get_cpu(env
);
372 qemu_mutex_lock_iothread();
373 ioinst_handle_csch(cpu
, r1
, GETPC());
374 qemu_mutex_unlock_iothread();
377 void HELPER(hsch
)(CPUS390XState
*env
, uint64_t r1
)
379 S390CPU
*cpu
= s390_env_get_cpu(env
);
380 qemu_mutex_lock_iothread();
381 ioinst_handle_hsch(cpu
, r1
, GETPC());
382 qemu_mutex_unlock_iothread();
385 void HELPER(msch
)(CPUS390XState
*env
, uint64_t r1
, uint64_t inst
)
387 S390CPU
*cpu
= s390_env_get_cpu(env
);
388 qemu_mutex_lock_iothread();
389 ioinst_handle_msch(cpu
, r1
, inst
>> 16, GETPC());
390 qemu_mutex_unlock_iothread();
393 void HELPER(rchp
)(CPUS390XState
*env
, uint64_t r1
)
395 S390CPU
*cpu
= s390_env_get_cpu(env
);
396 qemu_mutex_lock_iothread();
397 ioinst_handle_rchp(cpu
, r1
, GETPC());
398 qemu_mutex_unlock_iothread();
401 void HELPER(rsch
)(CPUS390XState
*env
, uint64_t r1
)
403 S390CPU
*cpu
= s390_env_get_cpu(env
);
404 qemu_mutex_lock_iothread();
405 ioinst_handle_rsch(cpu
, r1
, GETPC());
406 qemu_mutex_unlock_iothread();
409 void HELPER(sal
)(CPUS390XState
*env
, uint64_t r1
)
411 S390CPU
*cpu
= s390_env_get_cpu(env
);
413 qemu_mutex_lock_iothread();
414 ioinst_handle_sal(cpu
, r1
, GETPC());
415 qemu_mutex_unlock_iothread();
418 void HELPER(schm
)(CPUS390XState
*env
, uint64_t r1
, uint64_t r2
, uint64_t inst
)
420 S390CPU
*cpu
= s390_env_get_cpu(env
);
422 qemu_mutex_lock_iothread();
423 ioinst_handle_schm(cpu
, r1
, r2
, inst
>> 16, GETPC());
424 qemu_mutex_unlock_iothread();
427 void HELPER(ssch
)(CPUS390XState
*env
, uint64_t r1
, uint64_t inst
)
429 S390CPU
*cpu
= s390_env_get_cpu(env
);
430 qemu_mutex_lock_iothread();
431 ioinst_handle_ssch(cpu
, r1
, inst
>> 16, GETPC());
432 qemu_mutex_unlock_iothread();
435 void HELPER(stcrw
)(CPUS390XState
*env
, uint64_t inst
)
437 S390CPU
*cpu
= s390_env_get_cpu(env
);
439 qemu_mutex_lock_iothread();
440 ioinst_handle_stcrw(cpu
, inst
>> 16, GETPC());
441 qemu_mutex_unlock_iothread();
444 void HELPER(stsch
)(CPUS390XState
*env
, uint64_t r1
, uint64_t inst
)
446 S390CPU
*cpu
= s390_env_get_cpu(env
);
447 qemu_mutex_lock_iothread();
448 ioinst_handle_stsch(cpu
, r1
, inst
>> 16, GETPC());
449 qemu_mutex_unlock_iothread();
452 uint32_t HELPER(tpi
)(CPUS390XState
*env
, uint64_t addr
)
454 const uintptr_t ra
= GETPC();
455 S390CPU
*cpu
= s390_env_get_cpu(env
);
456 QEMUS390FLICState
*flic
= s390_get_qemu_flic(s390_get_flic());
457 QEMUS390FlicIO
*io
= NULL
;
461 s390_program_interrupt(env
, PGM_SPECIFICATION
, 4, ra
);
464 qemu_mutex_lock_iothread();
465 io
= qemu_s390_flic_dequeue_io(flic
, env
->cregs
[6]);
467 qemu_mutex_unlock_iothread();
477 .id
= cpu_to_be16(io
->id
),
478 .nr
= cpu_to_be16(io
->nr
),
479 .parm
= cpu_to_be32(io
->parm
),
482 if (s390_cpu_virt_mem_write(cpu
, addr
, 0, &intc
, sizeof(intc
))) {
483 /* writing failed, reinject and properly clean up */
484 s390_io_interrupt(io
->id
, io
->nr
, io
->parm
, io
->word
);
485 qemu_mutex_unlock_iothread();
487 s390_cpu_virt_mem_handle_exc(cpu
, ra
);
491 /* no protection applies */
492 lowcore
= cpu_map_lowcore(env
);
493 lowcore
->subchannel_id
= cpu_to_be16(io
->id
);
494 lowcore
->subchannel_nr
= cpu_to_be16(io
->nr
);
495 lowcore
->io_int_parm
= cpu_to_be32(io
->parm
);
496 lowcore
->io_int_word
= cpu_to_be32(io
->word
);
497 cpu_unmap_lowcore(lowcore
);
501 qemu_mutex_unlock_iothread();
505 void HELPER(tsch
)(CPUS390XState
*env
, uint64_t r1
, uint64_t inst
)
507 S390CPU
*cpu
= s390_env_get_cpu(env
);
508 qemu_mutex_lock_iothread();
509 ioinst_handle_tsch(cpu
, r1
, inst
>> 16, GETPC());
510 qemu_mutex_unlock_iothread();
513 void HELPER(chsc
)(CPUS390XState
*env
, uint64_t inst
)
515 S390CPU
*cpu
= s390_env_get_cpu(env
);
516 qemu_mutex_lock_iothread();
517 ioinst_handle_chsc(cpu
, inst
>> 16, GETPC());
518 qemu_mutex_unlock_iothread();
522 #ifndef CONFIG_USER_ONLY
523 void HELPER(per_check_exception
)(CPUS390XState
*env
)
527 if (env
->per_perc_atmid
) {
529 * FIXME: ILEN_AUTO is most probably the right thing to use. ilen
530 * always has to match the instruction referenced in the PSW. E.g.
531 * if a PER interrupt is triggered via EXECUTE, we have to use ilen
532 * of EXECUTE, while per_address contains the target of EXECUTE.
534 ilen
= get_ilen(cpu_ldub_code(env
, env
->per_address
));
535 s390_program_interrupt(env
, PGM_PER
, ilen
, GETPC());
539 /* Check if an address is within the PER starting address and the PER
540 ending address. The address range might loop. */
541 static inline bool get_per_in_range(CPUS390XState
*env
, uint64_t addr
)
543 if (env
->cregs
[10] <= env
->cregs
[11]) {
544 return env
->cregs
[10] <= addr
&& addr
<= env
->cregs
[11];
546 return env
->cregs
[10] <= addr
|| addr
<= env
->cregs
[11];
550 void HELPER(per_branch
)(CPUS390XState
*env
, uint64_t from
, uint64_t to
)
552 if ((env
->cregs
[9] & PER_CR9_EVENT_BRANCH
)) {
553 if (!(env
->cregs
[9] & PER_CR9_CONTROL_BRANCH_ADDRESS
)
554 || get_per_in_range(env
, to
)) {
555 env
->per_address
= from
;
556 env
->per_perc_atmid
= PER_CODE_EVENT_BRANCH
| get_per_atmid(env
);
561 void HELPER(per_ifetch
)(CPUS390XState
*env
, uint64_t addr
)
563 if ((env
->cregs
[9] & PER_CR9_EVENT_IFETCH
) && get_per_in_range(env
, addr
)) {
564 env
->per_address
= addr
;
565 env
->per_perc_atmid
= PER_CODE_EVENT_IFETCH
| get_per_atmid(env
);
567 /* If the instruction has to be nullified, trigger the
568 exception immediately. */
569 if (env
->cregs
[9] & PER_CR9_EVENT_NULLIFICATION
) {
570 CPUState
*cs
= CPU(s390_env_get_cpu(env
));
572 env
->per_perc_atmid
|= PER_CODE_EVENT_NULLIFICATION
;
573 env
->int_pgm_code
= PGM_PER
;
574 env
->int_pgm_ilen
= get_ilen(cpu_ldub_code(env
, addr
));
576 cs
->exception_index
= EXCP_PGM
;
583 static uint8_t stfl_bytes
[2048];
584 static unsigned int used_stfl_bytes
;
586 static void prepare_stfl(void)
588 static bool initialized
;
591 /* racy, but we don't care, the same values are always written */
596 s390_get_feat_block(S390_FEAT_TYPE_STFL
, stfl_bytes
);
597 for (i
= 0; i
< sizeof(stfl_bytes
); i
++) {
599 used_stfl_bytes
= i
+ 1;
605 #ifndef CONFIG_USER_ONLY
606 void HELPER(stfl
)(CPUS390XState
*env
)
610 lowcore
= cpu_map_lowcore(env
);
612 memcpy(&lowcore
->stfl_fac_list
, stfl_bytes
, sizeof(lowcore
->stfl_fac_list
));
613 cpu_unmap_lowcore(lowcore
);
617 uint32_t HELPER(stfle
)(CPUS390XState
*env
, uint64_t addr
)
619 const uintptr_t ra
= GETPC();
620 const int count_bytes
= ((env
->regs
[0] & 0xff) + 1) * 8;
621 const int max_bytes
= ROUND_UP(used_stfl_bytes
, 8);
625 s390_program_interrupt(env
, PGM_SPECIFICATION
, 4, ra
);
629 for (i
= 0; i
< count_bytes
; ++i
) {
630 cpu_stb_data_ra(env
, addr
+ i
, stfl_bytes
[i
], ra
);
633 env
->regs
[0] = deposit64(env
->regs
[0], 0, 8, (max_bytes
/ 8) - 1);
634 return count_bytes
>= max_bytes
? 0 : 3;
637 #ifndef CONFIG_USER_ONLY
639 * Note: we ignore any return code of the functions called for the pci
640 * instructions, as the only time they return !0 is when the stub is
641 * called, and in that case we didn't even offer the zpci facility.
642 * The only exception is SIC, where program checks need to be handled
645 void HELPER(clp
)(CPUS390XState
*env
, uint32_t r2
)
647 S390CPU
*cpu
= s390_env_get_cpu(env
);
649 qemu_mutex_lock_iothread();
650 clp_service_call(cpu
, r2
, GETPC());
651 qemu_mutex_unlock_iothread();
654 void HELPER(pcilg
)(CPUS390XState
*env
, uint32_t r1
, uint32_t r2
)
656 S390CPU
*cpu
= s390_env_get_cpu(env
);
658 qemu_mutex_lock_iothread();
659 pcilg_service_call(cpu
, r1
, r2
, GETPC());
660 qemu_mutex_unlock_iothread();
663 void HELPER(pcistg
)(CPUS390XState
*env
, uint32_t r1
, uint32_t r2
)
665 S390CPU
*cpu
= s390_env_get_cpu(env
);
667 qemu_mutex_lock_iothread();
668 pcistg_service_call(cpu
, r1
, r2
, GETPC());
669 qemu_mutex_unlock_iothread();
672 void HELPER(stpcifc
)(CPUS390XState
*env
, uint32_t r1
, uint64_t fiba
,
675 S390CPU
*cpu
= s390_env_get_cpu(env
);
677 qemu_mutex_lock_iothread();
678 stpcifc_service_call(cpu
, r1
, fiba
, ar
, GETPC());
679 qemu_mutex_unlock_iothread();
682 void HELPER(sic
)(CPUS390XState
*env
, uint64_t r1
, uint64_t r3
)
686 qemu_mutex_lock_iothread();
687 r
= css_do_sic(env
, (r3
>> 27) & 0x7, r1
& 0xffff);
688 qemu_mutex_unlock_iothread();
689 /* css_do_sic() may actually return a PGM_xxx value to inject */
691 s390_program_interrupt(env
, -r
, 4, GETPC());
695 void HELPER(rpcit
)(CPUS390XState
*env
, uint32_t r1
, uint32_t r2
)
697 S390CPU
*cpu
= s390_env_get_cpu(env
);
699 qemu_mutex_lock_iothread();
700 rpcit_service_call(cpu
, r1
, r2
, GETPC());
701 qemu_mutex_unlock_iothread();
704 void HELPER(pcistb
)(CPUS390XState
*env
, uint32_t r1
, uint32_t r3
,
705 uint64_t gaddr
, uint32_t ar
)
707 S390CPU
*cpu
= s390_env_get_cpu(env
);
709 qemu_mutex_lock_iothread();
710 pcistb_service_call(cpu
, r1
, r3
, gaddr
, ar
, GETPC());
711 qemu_mutex_unlock_iothread();
714 void HELPER(mpcifc
)(CPUS390XState
*env
, uint32_t r1
, uint64_t fiba
,
717 S390CPU
*cpu
= s390_env_get_cpu(env
);
719 qemu_mutex_lock_iothread();
720 mpcifc_service_call(cpu
, r1
, fiba
, ar
, GETPC());
721 qemu_mutex_unlock_iothread();