Path: blob/master/tools/testing/selftests/kvm/include/s390/sie.h
49255 views
/* SPDX-License-Identifier: GPL-2.0 */1/*2* Definition for kernel virtual machines on s390.3*4* Adapted copy of struct definition kvm_s390_sie_block from5* arch/s390/include/asm/kvm_host.h for use in userspace selftest programs.6*7* Copyright IBM Corp. 2008, 20248*9* Authors:10* Christoph Schlameuss <[email protected]>11* Carsten Otte <[email protected]>12*/1314#ifndef SELFTEST_KVM_SIE_H15#define SELFTEST_KVM_SIE_H1617#include <linux/types.h>1819struct kvm_s390_sie_block {20#define CPUSTAT_STOPPED 0x8000000021#define CPUSTAT_WAIT 0x1000000022#define CPUSTAT_ECALL_PEND 0x0800000023#define CPUSTAT_STOP_INT 0x0400000024#define CPUSTAT_IO_INT 0x0200000025#define CPUSTAT_EXT_INT 0x0100000026#define CPUSTAT_RUNNING 0x0080000027#define CPUSTAT_RETAINED 0x0040000028#define CPUSTAT_TIMING_SUB 0x0002000029#define CPUSTAT_SIE_SUB 0x0001000030#define CPUSTAT_RRF 0x0000800031#define CPUSTAT_SLSV 0x0000400032#define CPUSTAT_SLSR 0x0000200033#define CPUSTAT_ZARCH 0x0000080034#define CPUSTAT_MCDS 0x0000010035#define CPUSTAT_KSS 0x0000020036#define CPUSTAT_SM 0x0000008037#define CPUSTAT_IBS 0x0000004038#define CPUSTAT_GED2 0x0000001039#define CPUSTAT_G 0x0000000840#define CPUSTAT_GED 0x0000000441#define CPUSTAT_J 0x0000000242#define CPUSTAT_P 0x0000000143__u32 cpuflags; /* 0x0000 */44__u32: 1; /* 0x0004 */45__u32 prefix : 18;46__u32: 1;47__u32 ibc : 12;48__u8 reserved08[4]; /* 0x0008 */49#define PROG_IN_SIE BIT(0)50__u32 prog0c; /* 0x000c */51union {52__u8 reserved10[16]; /* 0x0010 */53struct {54__u64 pv_handle_cpu;55__u64 pv_handle_config;56};57};58#define PROG_BLOCK_SIE BIT(0)59#define PROG_REQUEST BIT(1)60__u32 prog20; /* 0x0020 */61__u8 reserved24[4]; /* 0x0024 */62__u64 cputm; /* 0x0028 */63__u64 ckc; /* 0x0030 */64__u64 epoch; /* 0x0038 */65__u32 svcc; /* 0x0040 */66#define LCTL_CR0 0x800067#define LCTL_CR6 0x020068#define LCTL_CR9 0x004069#define LCTL_CR10 0x002070#define LCTL_CR11 0x001071#define LCTL_CR14 0x000272__u16 lctl; /* 0x0044 */73__s16 icpua; /* 0x0046 */74#define ICTL_OPEREXC 0x8000000075#define ICTL_PINT 0x2000000076#define ICTL_LPSW 0x0040000077#define ICTL_STCTL 0x0004000078#define ICTL_ISKE 0x0000400079#define ICTL_SSKE 0x0000200080#define ICTL_RRBE 0x0000100081#define ICTL_TPROT 0x0000020082__u32 ictl; /* 0x0048 */83#define ECA_CEI 0x8000000084#define ECA_IB 0x4000000085#define ECA_SIGPI 0x1000000086#define ECA_MVPGI 0x0100000087#define ECA_AIV 0x0020000088#define ECA_VX 0x0002000089#define ECA_PROTEXCI 0x0000200090#define ECA_APIE 0x0000000891#define ECA_SII 0x0000000192__u32 eca; /* 0x004c */93#define ICPT_INST 0x0494#define ICPT_PROGI 0x0895#define ICPT_INSTPROGI 0x0C96#define ICPT_EXTREQ 0x1097#define ICPT_EXTINT 0x1498#define ICPT_IOREQ 0x1899#define ICPT_WAIT 0x1c100#define ICPT_VALIDITY 0x20101#define ICPT_STOP 0x28102#define ICPT_OPEREXC 0x2C103#define ICPT_PARTEXEC 0x38104#define ICPT_IOINST 0x40105#define ICPT_KSS 0x5c106#define ICPT_MCHKREQ 0x60107#define ICPT_INT_ENABLE 0x64108#define ICPT_PV_INSTR 0x68109#define ICPT_PV_NOTIFY 0x6c110#define ICPT_PV_PREF 0x70111__u8 icptcode; /* 0x0050 */112__u8 icptstatus; /* 0x0051 */113__u16 ihcpu; /* 0x0052 */114__u8 reserved54; /* 0x0054 */115#define IICTL_CODE_NONE 0x00116#define IICTL_CODE_MCHK 0x01117#define IICTL_CODE_EXT 0x02118#define IICTL_CODE_IO 0x03119#define IICTL_CODE_RESTART 0x04120#define IICTL_CODE_SPECIFICATION 0x10121#define IICTL_CODE_OPERAND 0x11122__u8 iictl; /* 0x0055 */123__u16 ipa; /* 0x0056 */124__u32 ipb; /* 0x0058 */125__u32 scaoh; /* 0x005c */126#define FPF_BPBC 0x20127__u8 fpf; /* 0x0060 */128#define ECB_GS 0x40129#define ECB_TE 0x10130#define ECB_SPECI 0x08131#define ECB_SRSI 0x04132#define ECB_HOSTPROTINT 0x02133#define ECB_PTF 0x01134__u8 ecb; /* 0x0061 */135#define ECB2_CMMA 0x80136#define ECB2_IEP 0x20137#define ECB2_PFMFI 0x08138#define ECB2_ESCA 0x04139#define ECB2_ZPCI_LSI 0x02140__u8 ecb2; /* 0x0062 */141#define ECB3_AISI 0x20142#define ECB3_AISII 0x10143#define ECB3_DEA 0x08144#define ECB3_AES 0x04145#define ECB3_RI 0x01146__u8 ecb3; /* 0x0063 */147#define ESCA_SCAOL_MASK ~0x3fU148__u32 scaol; /* 0x0064 */149__u8 sdf; /* 0x0068 */150__u8 epdx; /* 0x0069 */151__u8 cpnc; /* 0x006a */152__u8 reserved6b; /* 0x006b */153__u32 todpr; /* 0x006c */154#define GISA_FORMAT1 0x00000001155__u32 gd; /* 0x0070 */156__u8 reserved74[12]; /* 0x0074 */157__u64 mso; /* 0x0080 */158__u64 msl; /* 0x0088 */159__u64 psw_mask; /* 0x0090 */160__u64 psw_addr; /* 0x0098 */161__u64 gg14; /* 0x00a0 */162__u64 gg15; /* 0x00a8 */163__u8 reservedb0[8]; /* 0x00b0 */164#define HPID_KVM 0x4165#define HPID_VSIE 0x5166__u8 hpid; /* 0x00b8 */167__u8 reservedb9[7]; /* 0x00b9 */168union {169struct {170__u32 eiparams; /* 0x00c0 */171__u16 extcpuaddr; /* 0x00c4 */172__u16 eic; /* 0x00c6 */173};174__u64 mcic; /* 0x00c0 */175} __packed;176__u32 reservedc8; /* 0x00c8 */177union {178struct {179__u16 pgmilc; /* 0x00cc */180__u16 iprcc; /* 0x00ce */181};182__u32 edc; /* 0x00cc */183} __packed;184union {185struct {186__u32 dxc; /* 0x00d0 */187__u16 mcn; /* 0x00d4 */188__u8 perc; /* 0x00d6 */189__u8 peratmid; /* 0x00d7 */190};191__u64 faddr; /* 0x00d0 */192} __packed;193__u64 peraddr; /* 0x00d8 */194__u8 eai; /* 0x00e0 */195__u8 peraid; /* 0x00e1 */196__u8 oai; /* 0x00e2 */197__u8 armid; /* 0x00e3 */198__u8 reservede4[4]; /* 0x00e4 */199union {200__u64 tecmc; /* 0x00e8 */201struct {202__u16 subchannel_id; /* 0x00e8 */203__u16 subchannel_nr; /* 0x00ea */204__u32 io_int_parm; /* 0x00ec */205__u32 io_int_word; /* 0x00f0 */206};207} __packed;208__u8 reservedf4[8]; /* 0x00f4 */209#define CRYCB_FORMAT_MASK 0x00000003210#define CRYCB_FORMAT0 0x00000000211#define CRYCB_FORMAT1 0x00000001212#define CRYCB_FORMAT2 0x00000003213__u32 crycbd; /* 0x00fc */214__u64 gcr[16]; /* 0x0100 */215union {216__u64 gbea; /* 0x0180 */217__u64 sidad;218};219__u8 reserved188[8]; /* 0x0188 */220__u64 sdnxo; /* 0x0190 */221__u8 reserved198[8]; /* 0x0198 */222__u32 fac; /* 0x01a0 */223__u8 reserved1a4[20]; /* 0x01a4 */224__u64 cbrlo; /* 0x01b8 */225__u8 reserved1c0[8]; /* 0x01c0 */226#define ECD_HOSTREGMGMT 0x20000000227#define ECD_MEF 0x08000000228#define ECD_ETOKENF 0x02000000229#define ECD_ECC 0x00200000230__u32 ecd; /* 0x01c8 */231__u8 reserved1cc[18]; /* 0x01cc */232__u64 pp; /* 0x01de */233__u8 reserved1e6[2]; /* 0x01e6 */234__u64 itdba; /* 0x01e8 */235__u64 riccbd; /* 0x01f0 */236__u64 gvrd; /* 0x01f8 */237} __packed __aligned(512);238239#endif /* SELFTEST_KVM_SIE_H */240241242