xref: /openbmc/qemu/tests/tcg/s390x/lpsw.S (revision 4c6f44644d08f6f712474288d61deba601421988)
1*a1465c8bSIlya Leoshkevich/*
2*a1465c8bSIlya Leoshkevich * Test the LPSW instruction.
3*a1465c8bSIlya Leoshkevich *
4*a1465c8bSIlya Leoshkevich * SPDX-License-Identifier: GPL-2.0-or-later
5*a1465c8bSIlya Leoshkevich */
6*a1465c8bSIlya Leoshkevich    .org 0x140
7*a1465c8bSIlya Leoshkevichsvc_old_psw:
8*a1465c8bSIlya Leoshkevich    .org 0x1c0                         /* supervisor call new PSW */
9*a1465c8bSIlya Leoshkevich    .quad 0x80000000,svc               /* 31-bit mode */
10*a1465c8bSIlya Leoshkevich    .org 0x200                         /* lowcore padding */
11*a1465c8bSIlya Leoshkevich
12*a1465c8bSIlya Leoshkevich    .globl _start
13*a1465c8bSIlya Leoshkevich_start:
14*a1465c8bSIlya Leoshkevich    lpsw short_psw
15*a1465c8bSIlya Leoshkevichlpsw_target:
16*a1465c8bSIlya Leoshkevich    svc 0
17*a1465c8bSIlya Leoshkevichexpected_pswa:
18*a1465c8bSIlya Leoshkevich    j failure
19*a1465c8bSIlya Leoshkevich
20*a1465c8bSIlya Leoshkevichsvc:
21*a1465c8bSIlya Leoshkevich    clc svc_old_psw(16),expected_psw   /* correct full PSW? */
22*a1465c8bSIlya Leoshkevich    jne failure
23*a1465c8bSIlya Leoshkevich    lpswe success_psw
24*a1465c8bSIlya Leoshkevichfailure:
25*a1465c8bSIlya Leoshkevich    lpswe failure_psw
26*a1465c8bSIlya Leoshkevich
27*a1465c8bSIlya Leoshkevich    .align 8
28*a1465c8bSIlya Leoshkevichshort_psw:
29*a1465c8bSIlya Leoshkevich    .long 0x90001,0x80000000+lpsw_target         /* problem state,
30*a1465c8bSIlya Leoshkevich                                                    64-bit mode */
31*a1465c8bSIlya Leoshkevichexpected_psw:
32*a1465c8bSIlya Leoshkevich    .quad 0x1000180000000,expected_pswa          /* corresponds to short_psw */
33*a1465c8bSIlya Leoshkevichsuccess_psw:
34*a1465c8bSIlya Leoshkevich    .quad 0x2000000000000,0xfff        /* see is_special_wait_psw() */
35*a1465c8bSIlya Leoshkevichfailure_psw:
36*a1465c8bSIlya Leoshkevich    .quad 0x2000000000000,0            /* disabled wait */
37