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/exec-all.h"
30 #include "exec/cpu_ldst.h"
32 #if !defined(CONFIG_USER_ONLY)
33 #include "sysemu/cpus.h"
34 #include "sysemu/sysemu.h"
35 #include "hw/s390x/ebcdic.h"
36 #include "hw/s390x/s390-virtio-hcall.h"
37 #include "hw/s390x/sclp.h"
38 #include "hw/s390x/s390_flic.h"
39 #include "hw/s390x/ioinst.h"
40 #include "hw/s390x/s390-pci-inst.h"
41 #include "hw/boards.h"
44 /* #define DEBUG_HELPER */
46 #define HELPER_LOG(x...) qemu_log(x)
48 #define HELPER_LOG(x...)
51 /* Raise an exception statically from a TB. */
52 void HELPER(exception
)(CPUS390XState
*env
, uint32_t excp
)
54 CPUState
*cs
= CPU(s390_env_get_cpu(env
));
56 HELPER_LOG("%s: exception %d\n", __func__
, excp
);
57 cs
->exception_index
= excp
;
61 /* Store CPU Timer (also used for EXTRACT CPU TIME) */
62 uint64_t HELPER(stpt
)(CPUS390XState
*env
)
64 #if defined(CONFIG_USER_ONLY)
66 * Fake a descending CPU timer. We could get negative values here,
67 * but we don't care as it is up to the OS when to process that
68 * interrupt and reset to > 0.
70 return UINT64_MAX
- (uint64_t)cpu_get_host_ticks();
72 return time2tod(env
->cputm
- qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL
));
76 #ifndef CONFIG_USER_ONLY
78 /* SCLP service call */
79 uint32_t HELPER(servc
)(CPUS390XState
*env
, uint64_t r1
, uint64_t r2
)
81 qemu_mutex_lock_iothread();
82 int r
= sclp_service_call(env
, r1
, r2
);
83 qemu_mutex_unlock_iothread();
85 s390_program_interrupt(env
, -r
, 4, GETPC());
90 void HELPER(diag
)(CPUS390XState
*env
, uint32_t r1
, uint32_t r3
, uint32_t num
)
97 qemu_mutex_lock_iothread();
98 r
= s390_virtio_hypercall(env
);
99 qemu_mutex_unlock_iothread();
107 qemu_mutex_lock_iothread();
108 handle_diag_308(env
, r1
, r3
, GETPC());
109 qemu_mutex_unlock_iothread();
113 /* time bomb (watchdog) */
114 r
= handle_diag_288(env
, r1
, r3
);
122 s390_program_interrupt(env
, PGM_SPECIFICATION
, ILEN_AUTO
, GETPC());
127 void HELPER(spx
)(CPUS390XState
*env
, uint64_t a1
)
129 CPUState
*cs
= CPU(s390_env_get_cpu(env
));
130 uint32_t prefix
= a1
& 0x7fffe000;
133 HELPER_LOG("prefix: %#x\n", prefix
);
134 tlb_flush_page(cs
, 0);
135 tlb_flush_page(cs
, TARGET_PAGE_SIZE
);
139 uint64_t HELPER(stck
)(CPUS390XState
*env
)
143 time
= env
->tod_offset
+
144 time2tod(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL
) - env
->tod_basetime
);
149 /* Set Clock Comparator */
150 void HELPER(sckc
)(CPUS390XState
*env
, uint64_t time
)
158 /* difference between origins */
159 time
-= env
->tod_offset
;
162 time
= tod2time(time
);
164 timer_mod(env
->tod_timer
, env
->tod_basetime
+ time
);
167 /* Set Tod Programmable Field */
168 void HELPER(sckpf
)(CPUS390XState
*env
, uint64_t r0
)
172 if (val
& 0xffff0000) {
173 s390_program_interrupt(env
, PGM_SPECIFICATION
, 2, GETPC());
178 /* Store Clock Comparator */
179 uint64_t HELPER(stckc
)(CPUS390XState
*env
)
185 void HELPER(spt
)(CPUS390XState
*env
, uint64_t time
)
192 time
= tod2time(time
);
194 env
->cputm
= qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL
) + time
;
196 timer_mod(env
->cpu_timer
, env
->cputm
);
199 /* Store System Information */
200 uint32_t HELPER(stsi
)(CPUS390XState
*env
, uint64_t a0
, uint64_t r0
, uint64_t r1
)
202 const uintptr_t ra
= GETPC();
203 const uint32_t sel1
= r0
& STSI_R0_SEL1_MASK
;
204 const uint32_t sel2
= r1
& STSI_R1_SEL2_MASK
;
205 const MachineState
*ms
= MACHINE(qdev_get_machine());
206 uint16_t total_cpus
= 0, conf_cpus
= 0, reserved_cpus
= 0;
207 S390CPU
*cpu
= s390_env_get_cpu(env
);
211 if ((r0
& STSI_R0_FC_MASK
) > STSI_R0_FC_LEVEL_3
) {
212 /* invalid function code: no other checks are performed */
216 if ((r0
& STSI_R0_RESERVED_MASK
) || (r1
& STSI_R1_RESERVED_MASK
)) {
217 s390_program_interrupt(env
, PGM_SPECIFICATION
, 4, ra
);
220 if ((r0
& STSI_R0_FC_MASK
) == STSI_R0_FC_CURRENT
) {
221 /* query the current level: no further checks are performed */
222 env
->regs
[0] = STSI_R0_FC_LEVEL_3
;
226 if (a0
& ~TARGET_PAGE_MASK
) {
227 s390_program_interrupt(env
, PGM_SPECIFICATION
, 4, ra
);
230 /* count the cpus and split them into configured and reserved ones */
231 for (i
= 0; i
< ms
->possible_cpus
->len
; i
++) {
233 if (ms
->possible_cpus
->cpus
[i
].cpu
) {
241 * In theory, we could report Level 1 / Level 2 as current. However,
242 * the Linux kernel will detect this as running under LPAR and assume
243 * that we have a sclp linemode console (which is always present on
244 * LPAR, but not the default for QEMU), therefore not displaying boot
245 * messages and making booting a Linux kernel under TCG harder.
247 * For now we fake the same SMP configuration on all levels.
249 * TODO: We could later make the level configurable via the machine
250 * and change defaults (linemode console) based on machine type
253 switch (r0
& STSI_R0_FC_MASK
) {
254 case STSI_R0_FC_LEVEL_1
:
255 if ((sel1
== 1) && (sel2
== 1)) {
256 /* Basic Machine Configuration */
259 ebcdic_put(sysib
.sysib_111
.manuf
, "QEMU ", 16);
260 /* same as machine type number in STORE CPU ID, but in EBCDIC */
261 snprintf(type
, ARRAY_SIZE(type
), "%X", cpu
->model
->def
->type
);
262 ebcdic_put(sysib
.sysib_111
.type
, type
, 4);
263 /* model number (not stored in STORE CPU ID for z/Architecure) */
264 ebcdic_put(sysib
.sysib_111
.model
, "QEMU ", 16);
265 ebcdic_put(sysib
.sysib_111
.sequence
, "QEMU ", 16);
266 ebcdic_put(sysib
.sysib_111
.plant
, "QEMU", 4);
267 } else if ((sel1
== 2) && (sel2
== 1)) {
268 /* Basic Machine CPU */
269 ebcdic_put(sysib
.sysib_121
.sequence
, "QEMUQEMUQEMUQEMU", 16);
270 ebcdic_put(sysib
.sysib_121
.plant
, "QEMU", 4);
271 sysib
.sysib_121
.cpu_addr
= cpu_to_be16(env
->core_id
);
272 } else if ((sel1
== 2) && (sel2
== 2)) {
273 /* Basic Machine CPUs */
274 sysib
.sysib_122
.capability
= cpu_to_be32(0x443afc29);
275 sysib
.sysib_122
.total_cpus
= cpu_to_be16(total_cpus
);
276 sysib
.sysib_122
.conf_cpus
= cpu_to_be16(conf_cpus
);
277 sysib
.sysib_122
.reserved_cpus
= cpu_to_be16(reserved_cpus
);
282 case STSI_R0_FC_LEVEL_2
:
283 if ((sel1
== 2) && (sel2
== 1)) {
285 ebcdic_put(sysib
.sysib_221
.sequence
, "QEMUQEMUQEMUQEMU", 16);
286 ebcdic_put(sysib
.sysib_221
.plant
, "QEMU", 4);
287 sysib
.sysib_221
.cpu_addr
= cpu_to_be16(env
->core_id
);
288 } else if ((sel1
== 2) && (sel2
== 2)) {
290 sysib
.sysib_222
.lcpuc
= 0x80; /* dedicated */
291 sysib
.sysib_222
.total_cpus
= cpu_to_be16(total_cpus
);
292 sysib
.sysib_222
.conf_cpus
= cpu_to_be16(conf_cpus
);
293 sysib
.sysib_222
.reserved_cpus
= cpu_to_be16(reserved_cpus
);
294 ebcdic_put(sysib
.sysib_222
.name
, "QEMU ", 8);
295 sysib
.sysib_222
.caf
= cpu_to_be32(1000);
296 sysib
.sysib_222
.dedicated_cpus
= cpu_to_be16(conf_cpus
);
301 case STSI_R0_FC_LEVEL_3
:
302 if ((sel1
== 2) && (sel2
== 2)) {
304 sysib
.sysib_322
.count
= 1;
305 sysib
.sysib_322
.vm
[0].total_cpus
= cpu_to_be16(total_cpus
);
306 sysib
.sysib_322
.vm
[0].conf_cpus
= cpu_to_be16(conf_cpus
);
307 sysib
.sysib_322
.vm
[0].reserved_cpus
= cpu_to_be16(reserved_cpus
);
308 sysib
.sysib_322
.vm
[0].caf
= cpu_to_be32(1000);
309 /* Linux kernel uses this to distinguish us from z/VM */
310 ebcdic_put(sysib
.sysib_322
.vm
[0].cpi
, "KVM/Linux ", 16);
311 sysib
.sysib_322
.vm
[0].ext_name_encoding
= 2; /* UTF-8 */
313 /* If our VM has a name, use the real name */
315 memset(sysib
.sysib_322
.vm
[0].name
, 0x40,
316 sizeof(sysib
.sysib_322
.vm
[0].name
));
317 ebcdic_put(sysib
.sysib_322
.vm
[0].name
, qemu_name
,
318 MIN(sizeof(sysib
.sysib_322
.vm
[0].name
),
320 strncpy((char *)sysib
.sysib_322
.ext_names
[0], qemu_name
,
321 sizeof(sysib
.sysib_322
.ext_names
[0]));
323 ebcdic_put(sysib
.sysib_322
.vm
[0].name
, "TCGguest", 8);
324 strcpy((char *)sysib
.sysib_322
.ext_names
[0], "TCGguest");
328 memcpy(sysib
.sysib_322
.vm
[0].uuid
, &qemu_uuid
,
329 sizeof(sysib
.sysib_322
.vm
[0].uuid
));
337 if (s390_cpu_virt_mem_write(cpu
, a0
, 0, &sysib
, sizeof(sysib
))) {
338 s390_cpu_virt_mem_handle_exc(cpu
, ra
);
345 uint32_t HELPER(sigp
)(CPUS390XState
*env
, uint64_t order_code
, uint32_t r1
,
350 /* TODO: needed to inject interrupts - push further down */
351 qemu_mutex_lock_iothread();
352 cc
= handle_sigp(env
, order_code
& SIGP_ORDER_MASK
, r1
, r3
);
353 qemu_mutex_unlock_iothread();
359 #ifndef CONFIG_USER_ONLY
360 void HELPER(xsch
)(CPUS390XState
*env
, uint64_t r1
)
362 S390CPU
*cpu
= s390_env_get_cpu(env
);
363 qemu_mutex_lock_iothread();
364 ioinst_handle_xsch(cpu
, r1
, GETPC());
365 qemu_mutex_unlock_iothread();
368 void HELPER(csch
)(CPUS390XState
*env
, uint64_t r1
)
370 S390CPU
*cpu
= s390_env_get_cpu(env
);
371 qemu_mutex_lock_iothread();
372 ioinst_handle_csch(cpu
, r1
, GETPC());
373 qemu_mutex_unlock_iothread();
376 void HELPER(hsch
)(CPUS390XState
*env
, uint64_t r1
)
378 S390CPU
*cpu
= s390_env_get_cpu(env
);
379 qemu_mutex_lock_iothread();
380 ioinst_handle_hsch(cpu
, r1
, GETPC());
381 qemu_mutex_unlock_iothread();
384 void HELPER(msch
)(CPUS390XState
*env
, uint64_t r1
, uint64_t inst
)
386 S390CPU
*cpu
= s390_env_get_cpu(env
);
387 qemu_mutex_lock_iothread();
388 ioinst_handle_msch(cpu
, r1
, inst
>> 16, GETPC());
389 qemu_mutex_unlock_iothread();
392 void HELPER(rchp
)(CPUS390XState
*env
, uint64_t r1
)
394 S390CPU
*cpu
= s390_env_get_cpu(env
);
395 qemu_mutex_lock_iothread();
396 ioinst_handle_rchp(cpu
, r1
, GETPC());
397 qemu_mutex_unlock_iothread();
400 void HELPER(rsch
)(CPUS390XState
*env
, uint64_t r1
)
402 S390CPU
*cpu
= s390_env_get_cpu(env
);
403 qemu_mutex_lock_iothread();
404 ioinst_handle_rsch(cpu
, r1
, GETPC());
405 qemu_mutex_unlock_iothread();
408 void HELPER(sal
)(CPUS390XState
*env
, uint64_t r1
)
410 S390CPU
*cpu
= s390_env_get_cpu(env
);
412 qemu_mutex_lock_iothread();
413 ioinst_handle_sal(cpu
, r1
, GETPC());
414 qemu_mutex_unlock_iothread();
417 void HELPER(schm
)(CPUS390XState
*env
, uint64_t r1
, uint64_t r2
, uint64_t inst
)
419 S390CPU
*cpu
= s390_env_get_cpu(env
);
421 qemu_mutex_lock_iothread();
422 ioinst_handle_schm(cpu
, r1
, r2
, inst
>> 16, GETPC());
423 qemu_mutex_unlock_iothread();
426 void HELPER(ssch
)(CPUS390XState
*env
, uint64_t r1
, uint64_t inst
)
428 S390CPU
*cpu
= s390_env_get_cpu(env
);
429 qemu_mutex_lock_iothread();
430 ioinst_handle_ssch(cpu
, r1
, inst
>> 16, GETPC());
431 qemu_mutex_unlock_iothread();
434 void HELPER(stcrw
)(CPUS390XState
*env
, uint64_t inst
)
436 S390CPU
*cpu
= s390_env_get_cpu(env
);
438 qemu_mutex_lock_iothread();
439 ioinst_handle_stcrw(cpu
, inst
>> 16, GETPC());
440 qemu_mutex_unlock_iothread();
443 void HELPER(stsch
)(CPUS390XState
*env
, uint64_t r1
, uint64_t inst
)
445 S390CPU
*cpu
= s390_env_get_cpu(env
);
446 qemu_mutex_lock_iothread();
447 ioinst_handle_stsch(cpu
, r1
, inst
>> 16, GETPC());
448 qemu_mutex_unlock_iothread();
451 uint32_t HELPER(tpi
)(CPUS390XState
*env
, uint64_t addr
)
453 const uintptr_t ra
= GETPC();
454 S390CPU
*cpu
= s390_env_get_cpu(env
);
455 QEMUS390FLICState
*flic
= s390_get_qemu_flic(s390_get_flic());
456 QEMUS390FlicIO
*io
= NULL
;
460 s390_program_interrupt(env
, PGM_SPECIFICATION
, 4, ra
);
463 qemu_mutex_lock_iothread();
464 io
= qemu_s390_flic_dequeue_io(flic
, env
->cregs
[6]);
466 qemu_mutex_unlock_iothread();
476 .id
= cpu_to_be16(io
->id
),
477 .nr
= cpu_to_be16(io
->nr
),
478 .parm
= cpu_to_be32(io
->parm
),
481 if (s390_cpu_virt_mem_write(cpu
, addr
, 0, &intc
, sizeof(intc
))) {
482 /* writing failed, reinject and properly clean up */
483 s390_io_interrupt(io
->id
, io
->nr
, io
->parm
, io
->word
);
484 qemu_mutex_unlock_iothread();
486 s390_cpu_virt_mem_handle_exc(cpu
, ra
);
490 /* no protection applies */
491 lowcore
= cpu_map_lowcore(env
);
492 lowcore
->subchannel_id
= cpu_to_be16(io
->id
);
493 lowcore
->subchannel_nr
= cpu_to_be16(io
->nr
);
494 lowcore
->io_int_parm
= cpu_to_be32(io
->parm
);
495 lowcore
->io_int_word
= cpu_to_be32(io
->word
);
496 cpu_unmap_lowcore(lowcore
);
500 qemu_mutex_unlock_iothread();
504 void HELPER(tsch
)(CPUS390XState
*env
, uint64_t r1
, uint64_t inst
)
506 S390CPU
*cpu
= s390_env_get_cpu(env
);
507 qemu_mutex_lock_iothread();
508 ioinst_handle_tsch(cpu
, r1
, inst
>> 16, GETPC());
509 qemu_mutex_unlock_iothread();
512 void HELPER(chsc
)(CPUS390XState
*env
, uint64_t inst
)
514 S390CPU
*cpu
= s390_env_get_cpu(env
);
515 qemu_mutex_lock_iothread();
516 ioinst_handle_chsc(cpu
, inst
>> 16, GETPC());
517 qemu_mutex_unlock_iothread();
521 #ifndef CONFIG_USER_ONLY
522 void HELPER(per_check_exception
)(CPUS390XState
*env
)
526 if (env
->per_perc_atmid
) {
528 * FIXME: ILEN_AUTO is most probably the right thing to use. ilen
529 * always has to match the instruction referenced in the PSW. E.g.
530 * if a PER interrupt is triggered via EXECUTE, we have to use ilen
531 * of EXECUTE, while per_address contains the target of EXECUTE.
533 ilen
= get_ilen(cpu_ldub_code(env
, env
->per_address
));
534 s390_program_interrupt(env
, PGM_PER
, ilen
, GETPC());
538 /* Check if an address is within the PER starting address and the PER
539 ending address. The address range might loop. */
540 static inline bool get_per_in_range(CPUS390XState
*env
, uint64_t addr
)
542 if (env
->cregs
[10] <= env
->cregs
[11]) {
543 return env
->cregs
[10] <= addr
&& addr
<= env
->cregs
[11];
545 return env
->cregs
[10] <= addr
|| addr
<= env
->cregs
[11];
549 void HELPER(per_branch
)(CPUS390XState
*env
, uint64_t from
, uint64_t to
)
551 if ((env
->cregs
[9] & PER_CR9_EVENT_BRANCH
)) {
552 if (!(env
->cregs
[9] & PER_CR9_CONTROL_BRANCH_ADDRESS
)
553 || get_per_in_range(env
, to
)) {
554 env
->per_address
= from
;
555 env
->per_perc_atmid
= PER_CODE_EVENT_BRANCH
| get_per_atmid(env
);
560 void HELPER(per_ifetch
)(CPUS390XState
*env
, uint64_t addr
)
562 if ((env
->cregs
[9] & PER_CR9_EVENT_IFETCH
) && get_per_in_range(env
, addr
)) {
563 env
->per_address
= addr
;
564 env
->per_perc_atmid
= PER_CODE_EVENT_IFETCH
| get_per_atmid(env
);
566 /* If the instruction has to be nullified, trigger the
567 exception immediately. */
568 if (env
->cregs
[9] & PER_CR9_EVENT_NULLIFICATION
) {
569 CPUState
*cs
= CPU(s390_env_get_cpu(env
));
571 env
->per_perc_atmid
|= PER_CODE_EVENT_NULLIFICATION
;
572 env
->int_pgm_code
= PGM_PER
;
573 env
->int_pgm_ilen
= get_ilen(cpu_ldub_code(env
, addr
));
575 cs
->exception_index
= EXCP_PGM
;
582 static uint8_t stfl_bytes
[2048];
583 static unsigned int used_stfl_bytes
;
585 static void prepare_stfl(void)
587 static bool initialized
;
590 /* racy, but we don't care, the same values are always written */
595 s390_get_feat_block(S390_FEAT_TYPE_STFL
, stfl_bytes
);
596 for (i
= 0; i
< sizeof(stfl_bytes
); i
++) {
598 used_stfl_bytes
= i
+ 1;
604 #ifndef CONFIG_USER_ONLY
605 void HELPER(stfl
)(CPUS390XState
*env
)
609 lowcore
= cpu_map_lowcore(env
);
611 memcpy(&lowcore
->stfl_fac_list
, stfl_bytes
, sizeof(lowcore
->stfl_fac_list
));
612 cpu_unmap_lowcore(lowcore
);
616 uint32_t HELPER(stfle
)(CPUS390XState
*env
, uint64_t addr
)
618 const uintptr_t ra
= GETPC();
619 const int count_bytes
= ((env
->regs
[0] & 0xff) + 1) * 8;
620 const int max_bytes
= ROUND_UP(used_stfl_bytes
, 8);
624 s390_program_interrupt(env
, PGM_SPECIFICATION
, 4, ra
);
628 for (i
= 0; i
< count_bytes
; ++i
) {
629 cpu_stb_data_ra(env
, addr
+ i
, stfl_bytes
[i
], ra
);
632 env
->regs
[0] = deposit64(env
->regs
[0], 0, 8, (max_bytes
/ 8) - 1);
633 return count_bytes
>= max_bytes
? 0 : 3;
636 #ifndef CONFIG_USER_ONLY
638 * Note: we ignore any return code of the functions called for the pci
639 * instructions, as the only time they return !0 is when the stub is
640 * called, and in that case we didn't even offer the zpci facility.
641 * The only exception is SIC, where program checks need to be handled
644 void HELPER(clp
)(CPUS390XState
*env
, uint32_t r2
)
646 S390CPU
*cpu
= s390_env_get_cpu(env
);
648 qemu_mutex_lock_iothread();
649 clp_service_call(cpu
, r2
, GETPC());
650 qemu_mutex_unlock_iothread();
653 void HELPER(pcilg
)(CPUS390XState
*env
, uint32_t r1
, uint32_t r2
)
655 S390CPU
*cpu
= s390_env_get_cpu(env
);
657 qemu_mutex_lock_iothread();
658 pcilg_service_call(cpu
, r1
, r2
, GETPC());
659 qemu_mutex_unlock_iothread();
662 void HELPER(pcistg
)(CPUS390XState
*env
, uint32_t r1
, uint32_t r2
)
664 S390CPU
*cpu
= s390_env_get_cpu(env
);
666 qemu_mutex_lock_iothread();
667 pcistg_service_call(cpu
, r1
, r2
, GETPC());
668 qemu_mutex_unlock_iothread();
671 void HELPER(stpcifc
)(CPUS390XState
*env
, uint32_t r1
, uint64_t fiba
,
674 S390CPU
*cpu
= s390_env_get_cpu(env
);
676 qemu_mutex_lock_iothread();
677 stpcifc_service_call(cpu
, r1
, fiba
, ar
, GETPC());
678 qemu_mutex_unlock_iothread();
681 void HELPER(sic
)(CPUS390XState
*env
, uint64_t r1
, uint64_t r3
)
685 qemu_mutex_lock_iothread();
686 r
= css_do_sic(env
, (r3
>> 27) & 0x7, r1
& 0xffff);
687 qemu_mutex_unlock_iothread();
688 /* css_do_sic() may actually return a PGM_xxx value to inject */
690 s390_program_interrupt(env
, -r
, 4, GETPC());
694 void HELPER(rpcit
)(CPUS390XState
*env
, uint32_t r1
, uint32_t r2
)
696 S390CPU
*cpu
= s390_env_get_cpu(env
);
698 qemu_mutex_lock_iothread();
699 rpcit_service_call(cpu
, r1
, r2
, GETPC());
700 qemu_mutex_unlock_iothread();
703 void HELPER(pcistb
)(CPUS390XState
*env
, uint32_t r1
, uint32_t r3
,
704 uint64_t gaddr
, uint32_t ar
)
706 S390CPU
*cpu
= s390_env_get_cpu(env
);
708 qemu_mutex_lock_iothread();
709 pcistb_service_call(cpu
, r1
, r3
, gaddr
, ar
, GETPC());
710 qemu_mutex_unlock_iothread();
713 void HELPER(mpcifc
)(CPUS390XState
*env
, uint32_t r1
, uint64_t fiba
,
716 S390CPU
*cpu
= s390_env_get_cpu(env
);
718 qemu_mutex_lock_iothread();
719 mpcifc_service_call(cpu
, r1
, fiba
, ar
, GETPC());
720 qemu_mutex_unlock_iothread();