xref: /qemu/tests/tcg/s390x/stosm-early.S (revision a1465c8b)
1*a1465c8bSIlya Leoshkevich/*
2*a1465c8bSIlya Leoshkevich * Test early exception recognition using STOSM.
3*a1465c8bSIlya Leoshkevich *
4*a1465c8bSIlya Leoshkevich * SPDX-License-Identifier: GPL-2.0-or-later
5*a1465c8bSIlya Leoshkevich */
6*a1465c8bSIlya Leoshkevich    .org 0x8d
7*a1465c8bSIlya Leoshkevichilc:
8*a1465c8bSIlya Leoshkevich    .org 0x8e
9*a1465c8bSIlya Leoshkevichprogram_interruption_code:
10*a1465c8bSIlya Leoshkevich    .org 0x150
11*a1465c8bSIlya Leoshkevichprogram_old_psw:
12*a1465c8bSIlya Leoshkevich    .org 0x1D0                         /* program new PSW */
13*a1465c8bSIlya Leoshkevich    .quad 0,pgm
14*a1465c8bSIlya Leoshkevich    .org 0x200                         /* lowcore padding */
15*a1465c8bSIlya Leoshkevich
16*a1465c8bSIlya Leoshkevich    .globl _start
17*a1465c8bSIlya Leoshkevich_start:
18*a1465c8bSIlya Leoshkevich    stosm ssm_op,0x10                            /* bit 3 set */
19*a1465c8bSIlya Leoshkevichexpected_pswa:
20*a1465c8bSIlya Leoshkevich    j failure
21*a1465c8bSIlya Leoshkevich
22*a1465c8bSIlya Leoshkevichpgm:
23*a1465c8bSIlya Leoshkevich    chhsi program_interruption_code,0x6          /* specification exception? */
24*a1465c8bSIlya Leoshkevich    jne failure
25*a1465c8bSIlya Leoshkevich    cli ilc,4                                    /* ilc for STOSM? */
26*a1465c8bSIlya Leoshkevich    jne failure
27*a1465c8bSIlya Leoshkevich    clc program_old_psw(16),expected_old_psw     /* correct old PSW? */
28*a1465c8bSIlya Leoshkevich    jne failure
29*a1465c8bSIlya Leoshkevich    lpswe success_psw
30*a1465c8bSIlya Leoshkevichfailure:
31*a1465c8bSIlya Leoshkevich    lpswe failure_psw
32*a1465c8bSIlya Leoshkevich
33*a1465c8bSIlya Leoshkevichssm_op:
34*a1465c8bSIlya Leoshkevich    .byte 0
35*a1465c8bSIlya Leoshkevich    .align 8
36*a1465c8bSIlya Leoshkevichexpected_old_psw:
37*a1465c8bSIlya Leoshkevich    .quad 0x1000000180000000,expected_pswa       /* bit 3 set */
38*a1465c8bSIlya Leoshkevichsuccess_psw:
39*a1465c8bSIlya Leoshkevich    .quad 0x2000000000000,0xfff        /* see is_special_wait_psw() */
40*a1465c8bSIlya Leoshkevichfailure_psw:
41*a1465c8bSIlya Leoshkevich    .quad 0x2000000000000,0            /* disabled wait */
42