xref: /openbmc/qemu/tests/tcg/s390x/sam.S (revision 3db629f03e8caf39526cd0415dac16a6a6484107)
1*c8db90b8SIlya Leoshkevich/* DAT on, home-space mode, 64-bit mode */
2*c8db90b8SIlya Leoshkevich#define DAT_PSWM 0x400c00180000000
3*c8db90b8SIlya Leoshkevich#define VIRTUAL_BASE 0x123456789abcd000
4*c8db90b8SIlya Leoshkevich
5*c8db90b8SIlya Leoshkevich    .org 0x8e
6*c8db90b8SIlya Leoshkevichprogram_interruption_code:
7*c8db90b8SIlya Leoshkevich    .org 0x150
8*c8db90b8SIlya Leoshkevichprogram_old_psw:
9*c8db90b8SIlya Leoshkevich    .org 0x1d0                         /* program new PSW */
10*c8db90b8SIlya Leoshkevich    .quad 0,pgm_handler
11*c8db90b8SIlya Leoshkevich    .org 0x200                         /* lowcore padding */
12*c8db90b8SIlya Leoshkevich
13*c8db90b8SIlya Leoshkevich    .globl _start
14*c8db90b8SIlya Leoshkevich_start:
15*c8db90b8SIlya Leoshkevich    lctlg %c13,%c13,hasce
16*c8db90b8SIlya Leoshkevich    lpswe dat_psw
17*c8db90b8SIlya Leoshkevichstart_dat:
18*c8db90b8SIlya Leoshkevich    sam24
19*c8db90b8SIlya Leoshkevichsam24_suppressed:
20*c8db90b8SIlya Leoshkevich    /* sam24 should fail */
21*c8db90b8SIlya Leoshkevichfail:
22*c8db90b8SIlya Leoshkevich    basr %r12,%r0
23*c8db90b8SIlya Leoshkevich    lpswe failure_psw-.(%r12)
24*c8db90b8SIlya Leoshkevichpgm_handler:
25*c8db90b8SIlya Leoshkevich    chhsi program_interruption_code,6  /* specification exception? */
26*c8db90b8SIlya Leoshkevich    jne fail
27*c8db90b8SIlya Leoshkevich    clc suppressed_psw(16),program_old_psw  /* correct location? */
28*c8db90b8SIlya Leoshkevich    jne fail
29*c8db90b8SIlya Leoshkevich    lpswe success_psw
30*c8db90b8SIlya Leoshkevich
31*c8db90b8SIlya Leoshkevich    .align 8
32*c8db90b8SIlya Leoshkevichdat_psw:
33*c8db90b8SIlya Leoshkevich    .quad DAT_PSWM,VIRTUAL_BASE+start_dat
34*c8db90b8SIlya Leoshkevichsuppressed_psw:
35*c8db90b8SIlya Leoshkevich    .quad DAT_PSWM,VIRTUAL_BASE+sam24_suppressed
36*c8db90b8SIlya Leoshkevichsuccess_psw:
37*c8db90b8SIlya Leoshkevich    .quad 0x2000000000000,0xfff        /* see is_special_wait_psw() */
38*c8db90b8SIlya Leoshkevichfailure_psw:
39*c8db90b8SIlya Leoshkevich    .quad 0x2000000000000,0            /* disabled wait */
40*c8db90b8SIlya Leoshkevichhasce:
41*c8db90b8SIlya Leoshkevich    /* DT = 0b11 (region-first-table), TL = 3 (2k entries) */
42*c8db90b8SIlya Leoshkevich    .quad region_first_table + (3 << 2) + 3
43*c8db90b8SIlya Leoshkevich    .align 0x1000
44*c8db90b8SIlya Leoshkevichregion_first_table:
45*c8db90b8SIlya Leoshkevich    .org region_first_table + ((VIRTUAL_BASE >> 53) & 0x7ff) * 8
46*c8db90b8SIlya Leoshkevich    /* TT = 0b11 (region-first-table), TL = 3 (2k entries) */
47*c8db90b8SIlya Leoshkevich    .quad region_second_table + (3 << 2) + 3
48*c8db90b8SIlya Leoshkevich    .org region_first_table + 0x800 * 8
49*c8db90b8SIlya Leoshkevichregion_second_table:
50*c8db90b8SIlya Leoshkevich    .org region_second_table + ((VIRTUAL_BASE >> 42) & 0x7ff) * 8
51*c8db90b8SIlya Leoshkevich    /* TT = 0b10 (region-second-table), TL = 3 (2k entries) */
52*c8db90b8SIlya Leoshkevich    .quad region_third_table + (2 << 2) + 3
53*c8db90b8SIlya Leoshkevich    .org region_second_table + 0x800 * 8
54*c8db90b8SIlya Leoshkevichregion_third_table:
55*c8db90b8SIlya Leoshkevich    .org region_third_table + ((VIRTUAL_BASE >> 31) & 0x7ff) * 8
56*c8db90b8SIlya Leoshkevich    /* TT = 0b01 (region-third-table), TL = 3 (2k entries) */
57*c8db90b8SIlya Leoshkevich    .quad segment_table + (1 << 2) + 3
58*c8db90b8SIlya Leoshkevich    .org region_third_table + 0x800 * 8
59*c8db90b8SIlya Leoshkevichsegment_table:
60*c8db90b8SIlya Leoshkevich    .org segment_table + ((VIRTUAL_BASE >> 20) & 0x7ff) * 8
61*c8db90b8SIlya Leoshkevich    /* TT = 0b00 (segment-table) */
62*c8db90b8SIlya Leoshkevich    .quad page_table
63*c8db90b8SIlya Leoshkevich    .org segment_table + 0x800 * 8
64*c8db90b8SIlya Leoshkevichpage_table:
65*c8db90b8SIlya Leoshkevich    .org page_table + ((VIRTUAL_BASE >> 12) & 0xff) * 8
66*c8db90b8SIlya Leoshkevich    .quad 0
67*c8db90b8SIlya Leoshkevich    .org page_table + 0x100 * 8
68