2 * I/O instructions for S/390
4 * Copyright 2012, 2015 IBM Corp.
5 * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
7 * This work is licensed under the terms of the GNU GPL, version 2 or (at
8 * your option) any later version. See the COPYING file in the top-level
12 #include "qemu/osdep.h"
15 #include "s390x-internal.h"
16 #include "hw/s390x/ioinst.h"
18 #include "hw/s390x/s390-pci-bus.h"
19 #include "hw/s390x/pv.h"
21 /* All I/O instructions but chsc use the s format */
22 static uint64_t get_address_from_regs(CPUS390XState
*env
, uint32_t ipb
,
26 * Addresses for protected guests are all offsets into the
27 * satellite block which holds the IO control structures. Those
28 * control structures are always starting at offset 0 and are
29 * always aligned and accessible. So we can return 0 here which
30 * will pass the following address checks.
36 return decode_basedisp_s(env
, ipb
, ar
);
39 int ioinst_disassemble_sch_ident(uint32_t value
, int *m
, int *cssid
, int *ssid
,
42 if (!IOINST_SCHID_ONE(value
)) {
45 if (!IOINST_SCHID_M(value
)) {
46 if (IOINST_SCHID_CSSID(value
)) {
52 *cssid
= IOINST_SCHID_CSSID(value
);
55 *ssid
= IOINST_SCHID_SSID(value
);
56 *schid
= IOINST_SCHID_NR(value
);
60 void ioinst_handle_xsch(S390CPU
*cpu
, uint64_t reg1
, uintptr_t ra
)
62 int cssid
, ssid
, schid
, m
;
65 if (ioinst_disassemble_sch_ident(reg1
, &m
, &cssid
, &ssid
, &schid
)) {
66 s390_program_interrupt(&cpu
->env
, PGM_OPERAND
, ra
);
69 trace_ioinst_sch_id("xsch", cssid
, ssid
, schid
);
70 sch
= css_find_subch(m
, cssid
, ssid
, schid
);
71 if (!sch
|| !css_subch_visible(sch
)) {
75 setcc(cpu
, css_do_xsch(sch
));
78 void ioinst_handle_csch(S390CPU
*cpu
, uint64_t reg1
, uintptr_t ra
)
80 int cssid
, ssid
, schid
, m
;
83 if (ioinst_disassemble_sch_ident(reg1
, &m
, &cssid
, &ssid
, &schid
)) {
84 s390_program_interrupt(&cpu
->env
, PGM_OPERAND
, ra
);
87 trace_ioinst_sch_id("csch", cssid
, ssid
, schid
);
88 sch
= css_find_subch(m
, cssid
, ssid
, schid
);
89 if (!sch
|| !css_subch_visible(sch
)) {
93 setcc(cpu
, css_do_csch(sch
));
96 void ioinst_handle_hsch(S390CPU
*cpu
, uint64_t reg1
, uintptr_t ra
)
98 int cssid
, ssid
, schid
, m
;
101 if (ioinst_disassemble_sch_ident(reg1
, &m
, &cssid
, &ssid
, &schid
)) {
102 s390_program_interrupt(&cpu
->env
, PGM_OPERAND
, ra
);
105 trace_ioinst_sch_id("hsch", cssid
, ssid
, schid
);
106 sch
= css_find_subch(m
, cssid
, ssid
, schid
);
107 if (!sch
|| !css_subch_visible(sch
)) {
111 setcc(cpu
, css_do_hsch(sch
));
114 static int ioinst_schib_valid(SCHIB
*schib
)
116 if ((be16_to_cpu(schib
->pmcw
.flags
) & PMCW_FLAGS_MASK_INVALID
) ||
117 (be32_to_cpu(schib
->pmcw
.chars
) & PMCW_CHARS_MASK_INVALID
)) {
120 /* Disallow extended measurements for now. */
121 if (be32_to_cpu(schib
->pmcw
.chars
) & PMCW_CHARS_MASK_XMWME
) {
124 /* for MB format 1 bits 26-31 of word 11 must be 0 */
125 /* MBA uses words 10 and 11, it means align on 2**6 */
126 if ((be32_to_cpu(schib
->pmcw
.chars
) & PMCW_CHARS_MASK_MBFC
) &&
127 (be64_to_cpu(schib
->mba
) & 0x03fUL
)) {
133 void ioinst_handle_msch(S390CPU
*cpu
, uint64_t reg1
, uint32_t ipb
, uintptr_t ra
)
135 int cssid
, ssid
, schid
, m
;
139 CPUS390XState
*env
= &cpu
->env
;
142 addr
= get_address_from_regs(env
, ipb
, &ar
);
144 s390_program_interrupt(env
, PGM_SPECIFICATION
, ra
);
148 s390_cpu_pv_mem_read(cpu
, addr
, &schib
, sizeof(schib
));
149 } else if (s390_cpu_virt_mem_read(cpu
, addr
, ar
, &schib
, sizeof(schib
))) {
150 s390_cpu_virt_mem_handle_exc(cpu
, ra
);
153 if (ioinst_disassemble_sch_ident(reg1
, &m
, &cssid
, &ssid
, &schid
) ||
154 !ioinst_schib_valid(&schib
)) {
155 s390_program_interrupt(env
, PGM_OPERAND
, ra
);
158 trace_ioinst_sch_id("msch", cssid
, ssid
, schid
);
159 sch
= css_find_subch(m
, cssid
, ssid
, schid
);
160 if (!sch
|| !css_subch_visible(sch
)) {
164 setcc(cpu
, css_do_msch(sch
, &schib
));
167 static void copy_orb_from_guest(ORB
*dest
, const ORB
*src
)
169 dest
->intparm
= be32_to_cpu(src
->intparm
);
170 dest
->ctrl0
= be16_to_cpu(src
->ctrl0
);
171 dest
->lpm
= src
->lpm
;
172 dest
->ctrl1
= src
->ctrl1
;
173 dest
->cpa
= be32_to_cpu(src
->cpa
);
176 static int ioinst_orb_valid(ORB
*orb
)
178 if ((orb
->ctrl0
& ORB_CTRL0_MASK_INVALID
) ||
179 (orb
->ctrl1
& ORB_CTRL1_MASK_INVALID
)) {
182 /* We don't support MIDA. */
183 if (orb
->ctrl1
& ORB_CTRL1_MASK_MIDAW
) {
186 if ((orb
->cpa
& HIGH_ORDER_BIT
) != 0) {
192 void ioinst_handle_ssch(S390CPU
*cpu
, uint64_t reg1
, uint32_t ipb
, uintptr_t ra
)
194 int cssid
, ssid
, schid
, m
;
198 CPUS390XState
*env
= &cpu
->env
;
201 addr
= get_address_from_regs(env
, ipb
, &ar
);
203 s390_program_interrupt(env
, PGM_SPECIFICATION
, ra
);
207 s390_cpu_pv_mem_read(cpu
, addr
, &orig_orb
, sizeof(orb
));
208 } else if (s390_cpu_virt_mem_read(cpu
, addr
, ar
, &orig_orb
, sizeof(orb
))) {
209 s390_cpu_virt_mem_handle_exc(cpu
, ra
);
212 copy_orb_from_guest(&orb
, &orig_orb
);
213 if (ioinst_disassemble_sch_ident(reg1
, &m
, &cssid
, &ssid
, &schid
) ||
214 !ioinst_orb_valid(&orb
)) {
215 s390_program_interrupt(env
, PGM_OPERAND
, ra
);
218 trace_ioinst_sch_id("ssch", cssid
, ssid
, schid
);
219 sch
= css_find_subch(m
, cssid
, ssid
, schid
);
220 if (!sch
|| !css_subch_visible(sch
)) {
224 setcc(cpu
, css_do_ssch(sch
, &orb
));
227 void ioinst_handle_stcrw(S390CPU
*cpu
, uint32_t ipb
, uintptr_t ra
)
232 CPUS390XState
*env
= &cpu
->env
;
235 addr
= get_address_from_regs(env
, ipb
, &ar
);
237 s390_program_interrupt(env
, PGM_SPECIFICATION
, ra
);
241 cc
= css_do_stcrw(&crw
);
242 /* 0 - crw stored, 1 - zeroes stored */
245 s390_cpu_pv_mem_write(cpu
, addr
, &crw
, sizeof(crw
));
248 if (s390_cpu_virt_mem_write(cpu
, addr
, ar
, &crw
, sizeof(crw
)) == 0) {
252 /* Write failed: requeue CRW since STCRW is suppressing */
253 css_undo_stcrw(&crw
);
255 s390_cpu_virt_mem_handle_exc(cpu
, ra
);
260 void ioinst_handle_stsch(S390CPU
*cpu
, uint64_t reg1
, uint32_t ipb
,
263 int cssid
, ssid
, schid
, m
;
268 CPUS390XState
*env
= &cpu
->env
;
271 addr
= get_address_from_regs(env
, ipb
, &ar
);
273 s390_program_interrupt(env
, PGM_SPECIFICATION
, ra
);
277 if (ioinst_disassemble_sch_ident(reg1
, &m
, &cssid
, &ssid
, &schid
)) {
279 * The Ultravisor checks schid bit 16 to be one and bits 0-12
280 * to be 0 and injects a operand exception itself.
282 * Hence we should never end up here.
284 g_assert(!s390_is_pv());
286 * As operand exceptions have a lower priority than access exceptions,
287 * we check whether the memory area is writable (injecting the
288 * access exception if it is not) first.
290 if (!s390_cpu_virt_mem_check_write(cpu
, addr
, ar
, sizeof(schib
))) {
291 s390_program_interrupt(env
, PGM_OPERAND
, ra
);
293 s390_cpu_virt_mem_handle_exc(cpu
, ra
);
297 trace_ioinst_sch_id("stsch", cssid
, ssid
, schid
);
298 sch
= css_find_subch(m
, cssid
, ssid
, schid
);
300 if (css_subch_visible(sch
)) {
301 cc
= css_do_stsch(sch
, &schib
);
303 /* Indicate no more subchannels in this css/ss */
307 if (css_schid_final(m
, cssid
, ssid
, schid
)) {
308 cc
= 3; /* No more subchannels in this css/ss */
310 /* Store an empty schib. */
311 memset(&schib
, 0, sizeof(schib
));
317 s390_cpu_pv_mem_write(cpu
, addr
, &schib
, sizeof(schib
));
318 } else if (s390_cpu_virt_mem_write(cpu
, addr
, ar
, &schib
,
319 sizeof(schib
)) != 0) {
320 s390_cpu_virt_mem_handle_exc(cpu
, ra
);
324 /* Access exceptions have a higher priority than cc3 */
326 s390_cpu_virt_mem_check_write(cpu
, addr
, ar
, sizeof(schib
)) != 0) {
327 s390_cpu_virt_mem_handle_exc(cpu
, ra
);
334 int ioinst_handle_tsch(S390CPU
*cpu
, uint64_t reg1
, uint32_t ipb
, uintptr_t ra
)
336 CPUS390XState
*env
= &cpu
->env
;
337 int cssid
, ssid
, schid
, m
;
344 if (ioinst_disassemble_sch_ident(reg1
, &m
, &cssid
, &ssid
, &schid
)) {
345 s390_program_interrupt(env
, PGM_OPERAND
, ra
);
348 trace_ioinst_sch_id("tsch", cssid
, ssid
, schid
);
349 addr
= get_address_from_regs(env
, ipb
, &ar
);
351 s390_program_interrupt(env
, PGM_SPECIFICATION
, ra
);
355 sch
= css_find_subch(m
, cssid
, ssid
, schid
);
356 if (sch
&& css_subch_visible(sch
)) {
357 cc
= css_do_tsch_get_irb(sch
, &irb
, &irb_len
);
361 /* 0 - status pending, 1 - not status pending, 3 - not operational */
364 s390_cpu_pv_mem_write(cpu
, addr
, &irb
, irb_len
);
365 } else if (s390_cpu_virt_mem_write(cpu
, addr
, ar
, &irb
, irb_len
) != 0) {
366 s390_cpu_virt_mem_handle_exc(cpu
, ra
);
369 css_do_tsch_update_subch(sch
);
371 irb_len
= sizeof(irb
) - sizeof(irb
.emw
);
372 /* Access exceptions have a higher priority than cc3 */
374 s390_cpu_virt_mem_check_write(cpu
, addr
, ar
, irb_len
) != 0) {
375 s390_cpu_virt_mem_handle_exc(cpu
, ra
);
384 typedef struct ChscReq
{
390 } QEMU_PACKED ChscReq
;
392 typedef struct ChscResp
{
397 } QEMU_PACKED ChscResp
;
399 #define CHSC_MIN_RESP_LEN 0x0008
401 #define CHSC_SCPD 0x0002
402 #define CHSC_SCSC 0x0010
403 #define CHSC_SDA 0x0031
404 #define CHSC_SEI 0x000e
406 #define CHSC_SCPD_0_M 0x20000000
407 #define CHSC_SCPD_0_C 0x10000000
408 #define CHSC_SCPD_0_FMT 0x0f000000
409 #define CHSC_SCPD_0_CSSID 0x00ff0000
410 #define CHSC_SCPD_0_RFMT 0x00000f00
411 #define CHSC_SCPD_0_RES 0xc000f000
412 #define CHSC_SCPD_1_RES 0xffffff00
413 #define CHSC_SCPD_01_CHPID 0x000000ff
414 static void ioinst_handle_chsc_scpd(ChscReq
*req
, ChscResp
*res
)
416 uint16_t len
= be16_to_cpu(req
->len
);
417 uint32_t param0
= be32_to_cpu(req
->param0
);
418 uint32_t param1
= be32_to_cpu(req
->param1
);
422 uint8_t f_chpid
, l_chpid
;
426 rfmt
= (param0
& CHSC_SCPD_0_RFMT
) >> 8;
427 if ((rfmt
== 0) || (rfmt
== 1)) {
428 rfmt
= !!(param0
& CHSC_SCPD_0_C
);
430 if ((len
!= 0x0010) || (param0
& CHSC_SCPD_0_RES
) ||
431 (param1
& CHSC_SCPD_1_RES
) || req
->param2
) {
435 if (param0
& CHSC_SCPD_0_FMT
) {
439 cssid
= (param0
& CHSC_SCPD_0_CSSID
) >> 16;
440 m
= param0
& CHSC_SCPD_0_M
;
442 if (!m
|| !css_present(cssid
)) {
447 f_chpid
= param0
& CHSC_SCPD_01_CHPID
;
448 l_chpid
= param1
& CHSC_SCPD_01_CHPID
;
449 if (l_chpid
< f_chpid
) {
453 /* css_collect_chp_desc() is endian-aware */
454 desc_size
= css_collect_chp_desc(m
, cssid
, f_chpid
, l_chpid
, rfmt
,
456 res
->code
= cpu_to_be16(0x0001);
457 res
->len
= cpu_to_be16(8 + desc_size
);
458 res
->param
= cpu_to_be32(rfmt
);
462 res
->code
= cpu_to_be16(resp_code
);
463 res
->len
= cpu_to_be16(CHSC_MIN_RESP_LEN
);
464 res
->param
= cpu_to_be32(rfmt
);
467 #define CHSC_SCSC_0_M 0x20000000
468 #define CHSC_SCSC_0_FMT 0x000f0000
469 #define CHSC_SCSC_0_CSSID 0x0000ff00
470 #define CHSC_SCSC_0_RES 0xdff000ff
471 static void ioinst_handle_chsc_scsc(ChscReq
*req
, ChscResp
*res
)
473 uint16_t len
= be16_to_cpu(req
->len
);
474 uint32_t param0
= be32_to_cpu(req
->param0
);
477 uint32_t general_chars
[510];
478 uint32_t chsc_chars
[508];
485 if (param0
& CHSC_SCSC_0_FMT
) {
489 cssid
= (param0
& CHSC_SCSC_0_CSSID
) >> 8;
491 if (!(param0
& CHSC_SCSC_0_M
) || !css_present(cssid
)) {
496 if ((param0
& CHSC_SCSC_0_RES
) || req
->param1
|| req
->param2
) {
500 res
->code
= cpu_to_be16(0x0001);
501 res
->len
= cpu_to_be16(4080);
504 memset(general_chars
, 0, sizeof(general_chars
));
505 memset(chsc_chars
, 0, sizeof(chsc_chars
));
507 general_chars
[0] = cpu_to_be32(0x03000000);
508 general_chars
[1] = cpu_to_be32(0x00079000);
509 general_chars
[3] = cpu_to_be32(0x00080000);
511 chsc_chars
[0] = cpu_to_be32(0x40000000);
512 chsc_chars
[3] = cpu_to_be32(0x00040000);
514 memcpy(res
->data
, general_chars
, sizeof(general_chars
));
515 memcpy(res
->data
+ sizeof(general_chars
), chsc_chars
, sizeof(chsc_chars
));
519 res
->code
= cpu_to_be16(resp_code
);
520 res
->len
= cpu_to_be16(CHSC_MIN_RESP_LEN
);
524 #define CHSC_SDA_0_FMT 0x0f000000
525 #define CHSC_SDA_0_OC 0x0000ffff
526 #define CHSC_SDA_0_RES 0xf0ff0000
527 #define CHSC_SDA_OC_MCSSE 0x0
528 #define CHSC_SDA_OC_MSS 0x2
529 static void ioinst_handle_chsc_sda(ChscReq
*req
, ChscResp
*res
)
531 uint16_t resp_code
= 0x0001;
532 uint16_t len
= be16_to_cpu(req
->len
);
533 uint32_t param0
= be32_to_cpu(req
->param0
);
537 if ((len
!= 0x0400) || (param0
& CHSC_SDA_0_RES
)) {
542 if (param0
& CHSC_SDA_0_FMT
) {
547 oc
= param0
& CHSC_SDA_0_OC
;
549 case CHSC_SDA_OC_MCSSE
:
550 ret
= css_enable_mcsse();
551 if (ret
== -EINVAL
) {
556 case CHSC_SDA_OC_MSS
:
557 ret
= css_enable_mss();
558 if (ret
== -EINVAL
) {
569 res
->code
= cpu_to_be16(resp_code
);
570 res
->len
= cpu_to_be16(CHSC_MIN_RESP_LEN
);
574 static int chsc_sei_nt0_get_event(void *res
)
580 static int chsc_sei_nt0_have_event(void)
586 static int chsc_sei_nt2_get_event(void *res
)
588 if (s390_has_feat(S390_FEAT_ZPCI
)) {
589 return pci_chsc_sei_nt2_get_event(res
);
594 static int chsc_sei_nt2_have_event(void)
596 if (s390_has_feat(S390_FEAT_ZPCI
)) {
597 return pci_chsc_sei_nt2_have_event();
602 #define CHSC_SEI_NT0 (1ULL << 63)
603 #define CHSC_SEI_NT2 (1ULL << 61)
604 static void ioinst_handle_chsc_sei(ChscReq
*req
, ChscResp
*res
)
606 uint64_t selection_mask
= ldq_p(&req
->param1
);
607 uint8_t *res_flags
= (uint8_t *)res
->data
;
611 /* regarding architecture nt0 can not be masked */
612 have_event
= !chsc_sei_nt0_get_event(res
);
613 have_more
= chsc_sei_nt0_have_event();
615 if (selection_mask
& CHSC_SEI_NT2
) {
617 have_event
= !chsc_sei_nt2_get_event(res
);
621 have_more
= chsc_sei_nt2_have_event();
626 res
->code
= cpu_to_be16(0x0001);
628 (*res_flags
) |= 0x80;
630 (*res_flags
) &= ~0x80;
631 css_clear_sei_pending();
634 res
->code
= cpu_to_be16(0x0005);
635 res
->len
= cpu_to_be16(CHSC_MIN_RESP_LEN
);
639 static void ioinst_handle_chsc_unimplemented(ChscResp
*res
)
641 res
->len
= cpu_to_be16(CHSC_MIN_RESP_LEN
);
642 res
->code
= cpu_to_be16(0x0004);
646 void ioinst_handle_chsc(S390CPU
*cpu
, uint32_t ipb
, uintptr_t ra
)
654 CPUS390XState
*env
= &cpu
->env
;
655 uint8_t buf
[TARGET_PAGE_SIZE
];
657 trace_ioinst("chsc");
658 reg
= (ipb
>> 20) & 0x00f;
660 addr
= env
->regs
[reg
];
664 s390_program_interrupt(env
, PGM_SPECIFICATION
, ra
);
668 * Reading sizeof(ChscReq) bytes is currently enough for all of our
669 * present CHSC sub-handlers ... if we ever need more, we should take
670 * care of req->len here first.
673 s390_cpu_pv_mem_read(cpu
, addr
, buf
, sizeof(ChscReq
));
674 } else if (s390_cpu_virt_mem_read(cpu
, addr
, reg
, buf
, sizeof(ChscReq
))) {
675 s390_cpu_virt_mem_handle_exc(cpu
, ra
);
678 req
= (ChscReq
*)buf
;
679 len
= be16_to_cpu(req
->len
);
680 /* Length field valid? */
681 if ((len
< 16) || (len
> 4088) || (len
& 7)) {
682 s390_program_interrupt(env
, PGM_OPERAND
, ra
);
685 memset((char *)req
+ len
, 0, TARGET_PAGE_SIZE
- len
);
686 res
= (void *)((char *)req
+ len
);
687 command
= be16_to_cpu(req
->command
);
688 trace_ioinst_chsc_cmd(command
, len
);
691 ioinst_handle_chsc_scsc(req
, res
);
694 ioinst_handle_chsc_scpd(req
, res
);
697 ioinst_handle_chsc_sda(req
, res
);
700 ioinst_handle_chsc_sei(req
, res
);
703 ioinst_handle_chsc_unimplemented(res
);
708 s390_cpu_pv_mem_write(cpu
, addr
+ len
, res
, be16_to_cpu(res
->len
));
709 setcc(cpu
, 0); /* Command execution complete */
711 if (!s390_cpu_virt_mem_write(cpu
, addr
+ len
, reg
, res
,
712 be16_to_cpu(res
->len
))) {
713 setcc(cpu
, 0); /* Command execution complete */
715 s390_cpu_virt_mem_handle_exc(cpu
, ra
);
720 #define SCHM_REG1_RES(_reg) (_reg & 0x000000000ffffffc)
721 #define SCHM_REG1_MBK(_reg) ((_reg & 0x00000000f0000000) >> 28)
722 #define SCHM_REG1_UPD(_reg) ((_reg & 0x0000000000000002) >> 1)
723 #define SCHM_REG1_DCT(_reg) (_reg & 0x0000000000000001)
725 void ioinst_handle_schm(S390CPU
*cpu
, uint64_t reg1
, uint64_t reg2
,
726 uint32_t ipb
, uintptr_t ra
)
731 CPUS390XState
*env
= &cpu
->env
;
733 trace_ioinst("schm");
735 if (SCHM_REG1_RES(reg1
)) {
736 s390_program_interrupt(env
, PGM_OPERAND
, ra
);
740 mbk
= SCHM_REG1_MBK(reg1
);
741 update
= SCHM_REG1_UPD(reg1
);
742 dct
= SCHM_REG1_DCT(reg1
);
744 if (update
&& (reg2
& 0x000000000000001f)) {
745 s390_program_interrupt(env
, PGM_OPERAND
, ra
);
749 css_do_schm(mbk
, update
, dct
, update
? reg2
: 0);
752 void ioinst_handle_rsch(S390CPU
*cpu
, uint64_t reg1
, uintptr_t ra
)
754 int cssid
, ssid
, schid
, m
;
757 if (ioinst_disassemble_sch_ident(reg1
, &m
, &cssid
, &ssid
, &schid
)) {
758 s390_program_interrupt(&cpu
->env
, PGM_OPERAND
, ra
);
761 trace_ioinst_sch_id("rsch", cssid
, ssid
, schid
);
762 sch
= css_find_subch(m
, cssid
, ssid
, schid
);
763 if (!sch
|| !css_subch_visible(sch
)) {
767 setcc(cpu
, css_do_rsch(sch
));
770 #define RCHP_REG1_RES(_reg) (_reg & 0x00000000ff00ff00)
771 #define RCHP_REG1_CSSID(_reg) ((_reg & 0x0000000000ff0000) >> 16)
772 #define RCHP_REG1_CHPID(_reg) (_reg & 0x00000000000000ff)
773 void ioinst_handle_rchp(S390CPU
*cpu
, uint64_t reg1
, uintptr_t ra
)
779 CPUS390XState
*env
= &cpu
->env
;
781 if (RCHP_REG1_RES(reg1
)) {
782 s390_program_interrupt(env
, PGM_OPERAND
, ra
);
786 cssid
= RCHP_REG1_CSSID(reg1
);
787 chpid
= RCHP_REG1_CHPID(reg1
);
789 trace_ioinst_chp_id("rchp", cssid
, chpid
);
791 ret
= css_do_rchp(cssid
, chpid
);
804 /* Invalid channel subsystem. */
805 s390_program_interrupt(env
, PGM_OPERAND
, ra
);
811 #define SAL_REG1_INVALID(_reg) (_reg & 0x0000000080000000)
812 void ioinst_handle_sal(S390CPU
*cpu
, uint64_t reg1
, uintptr_t ra
)
814 /* We do not provide address limit checking, so let's suppress it. */
815 if (SAL_REG1_INVALID(reg1
) || reg1
& 0x000000000000ffff) {
816 s390_program_interrupt(&cpu
->env
, PGM_OPERAND
, ra
);