xref: /openbmc/qemu/tests/tcg/s390x/lpswe-early.S (revision d0bf492f)
1/*
2 * Test early exception recognition using LPSWE.
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6    .org 0x8d
7ilc:
8    .org 0x8e
9program_interruption_code:
10    .org 0x150
11program_old_psw:
12    .org 0x1D0                         /* program new PSW */
13    .quad 0,pgm
14    .org 0x200                         /* lowcore padding */
15
16    .globl _start
17_start:
18    lpswe bad_psw
19    j failure
20
21pgm:
22    chhsi program_interruption_code,0x6          /* specification exception? */
23    jne failure
24    cli ilc,0                                    /* ilc zero? */
25    jne failure
26    clc program_old_psw(16),bad_psw              /* correct old PSW? */
27    jne failure
28    lpswe success_psw
29failure:
30    lpswe failure_psw
31
32    .align 8
33bad_psw:
34    .quad 0x8000000000000000,0xfedcba9876543210  /* bit 0 set */
35success_psw:
36    .quad 0x2000000000000,0xfff        /* see is_special_wait_psw() */
37failure_psw:
38    .quad 0x2000000000000,0            /* disabled wait */
39