xref: /kvm-unit-tests/s390x/snippets/asm/pv-diag-288.S (revision 1d0f08f40d53daa39566842ec46a112db5f7e524)
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Diagnose 0x288 snippet used for PV interception testing.
4 *
5 * Copyright (c) 2021 IBM Corp
6 *
7 * Authors:
8 *  Janosch Frank <frankja@linux.ibm.com>
9 */
10#include <asm/asm-offsets.h>
11#include "macros.S"
12.section .text
13
14/* Clean and pre-load registers that are used for diag 288 */
15xgr	%r0, %r0
16xgr	%r1, %r1
17xgr	%r3, %r3
18lghi	%r0, 1
19lghi	%r1, 2
20lghi	%r2, 3
21
22/* Let's jump to the pgm exit label on a PGM */
23SET_PSW_NEW_ADDR 4, exit_pgm, GEN_LC_PGM_NEW_PSW
24
25/* Execute the diag288 */
26diag	%r0, %r2, 0x288
27
28/* Force exit if we don't get a PGM */
29diag	0, 0, 0x44
30
31/* Communicate the PGM code via diag9c(easiest) */
32exit_pgm:
33lh	%r1, GEN_LC_PGM_INT_CODE
34diag	%r1, 0, 0x9c
35