guestfs_abort_cb guestfs_add_cdrom guestfs_add_domain guestfs_add_domain_argv guestfs_add_domain_va guestfs_add_drive guestfs_add_drive_opts guestfs_add_drive_opts_argv guestfs_add_drive_opts_va guestfs_add_drive_ro guestfs_add_drive_ro_with_if guestfs_add_drive_with_if guestfs_application guestfs_application_list guestfs_aug_clear guestfs_aug_close guestfs_aug_defnode guestfs_aug_defvar guestfs_aug_get guestfs_aug_init guestfs_aug_insert guestfs_aug_load guestfs_aug_ls guestfs_aug_match guestfs_aug_mv guestfs_aug_rm guestfs_aug_save guestfs_aug_set guestfs_available guestfs_available_all_groups guestfs_base64_in guestfs_base64_out guestfs_blockdev_flushbufs guestfs_blockdev_getbsz guestfs_blockdev_getro guestfs_blockdev_getsize64 guestfs_blockdev_getss guestfs_blockdev_getsz guestfs_blockdev_rereadpt guestfs_blockdev_setbsz guestfs_blockdev_setro guestfs_blockdev_setrw guestfs_case_sensitive_path guestfs_cat guestfs_checksum guestfs_checksum_device guestfs_checksums_out guestfs_chmod guestfs_chown guestfs_close guestfs_close_cb guestfs_command guestfs_command_lines guestfs_config guestfs_copy_size guestfs_cp guestfs_cp_a guestfs_create guestfs_dd guestfs_debug guestfs_debug_cmdline guestfs_debug_upload guestfs_df guestfs_df_h guestfs_dirent guestfs_dirent_list guestfs_dmesg guestfs_download guestfs_download_offset guestfs_drop_caches guestfs_du guestfs_e2fsck_f guestfs_echo_daemon guestfs_egrep guestfs_egrepi guestfs_equal guestfs_error_errno guestfs_error_handler_cb guestfs_exists guestfs_fallocate guestfs_fallocate64 guestfs_fgrep guestfs_fgrepi guestfs_file guestfs_file_architecture guestfs_filesize guestfs_fill guestfs_fill_pattern guestfs_find guestfs_find0 guestfs_findfs_label guestfs_findfs_uuid guestfs_fsck guestfs_get_append guestfs_get_autosync guestfs_getcon guestfs_get_direct guestfs_get_e2label guestfs_get_e2uuid guestfs_get_error_handler guestfs_get_memsize guestfs_get_network guestfs_get_out_of_memory_handler guestfs_get_path guestfs_get_pid guestfs_get_private guestfs_get_qemu guestfs_get_recovery_proc guestfs_get_selinux guestfs_get_state guestfs_get_trace guestfs_get_umask guestfs_get_verbose guestfs_getxattrs guestfs_glob_expand guestfs_grep guestfs_grepi guestfs_grub_install guestfs_head guestfs_head_n guestfs_hexdump guestfs_initrd_cat guestfs_initrd_list guestfs_inotify_add_watch guestfs_inotify_close guestfs_inotify_event guestfs_inotify_event_list guestfs_inotify_files guestfs_inotify_init guestfs_inotify_read guestfs_inotify_rm_watch guestfs_inspect_get_arch guestfs_inspect_get_distro guestfs_inspect_get_filesystems guestfs_inspect_get_hostname guestfs_inspect_get_major_version guestfs_inspect_get_minor_version guestfs_inspect_get_mountpoints guestfs_inspect_get_package_format guestfs_inspect_get_package_management guestfs_inspect_get_product_name guestfs_inspect_get_roots guestfs_inspect_get_type guestfs_inspect_get_windows_systemroot guestfs_inspect_list_applications guestfs_inspect_os guestfs_int_application guestfs_int_application_list guestfs_int_bool guestfs_int_bool_list guestfs_int_dirent guestfs_int_dirent_list guestfs_int_inotify_event guestfs_int_inotify_event_list guestfs_int_int_bool guestfs_int_int_bool_list guestfs_int_lvm_lv guestfs_int_lvm_lv_list guestfs_int_lvm_pv guestfs_int_lvm_pv_list guestfs_int_lvm_vg guestfs_int_lvm_vg_list guestfs_int_partition guestfs_int_partition_list guestfs_int_stat guestfs_int_stat_list guestfs_int_statvfs guestfs_int_statvfs_list guestfs_int_version guestfs_int_version_list guestfs_int_xattr guestfs_int_xattr_list guestfs_is_blockdev guestfs_is_busy guestfs_is_chardev guestfs_is_config guestfs_is_dir guestfs_is_fifo guestfs_is_file guestfs_is_launching guestfs_is_lv guestfs_is_ready guestfs_is_socket guestfs_is_symlink guestfs_kill_subprocess guestfs_last_errno guestfs_last_error guestfs_launch guestfs_launch_done_cb guestfs_lchown guestfs_lgetxattrs guestfs_list_devices guestfs_list_filesystems guestfs_list_partitions guestfs_ll guestfs_ln guestfs_ln_f guestfs_ln_s guestfs_ln_sf guestfs_log_message_cb guestfs_lremovexattr guestfs_ls guestfs_lsetxattr guestfs_lstat guestfs_lstatlist guestfs_luks_add_key guestfs_luks_close guestfs_luks_format guestfs_luks_format_cipher guestfs_luks_kill_slot guestfs_luks_open guestfs_luks_open_ro guestfs_lvcreate guestfs_lvm_canonical_lv_name guestfs_lvm_clear_filter guestfs_lvm_lv guestfs_lvm_lv_list guestfs_lvm_pv guestfs_lvm_pv_list guestfs_lvm_remove_all guestfs_lvm_set_filter guestfs_lvm_vg guestfs_lvm_vg_list guestfs_lvremove guestfs_lvrename guestfs_lvresize guestfs_lvresize_free guestfs_lvs guestfs_lvs_full guestfs_lvuuid guestfs_lxattrlist guestfs_mkdir guestfs_mkdir_mode guestfs_mkdir_p guestfs_mkdtemp guestfs_mke2fs_J guestfs_mke2fs_JL guestfs_mke2fs_JU guestfs_mke2journal guestfs_mke2journal_L guestfs_mke2journal_U guestfs_mkfifo guestfs_mkfs guestfs_mkfs_b guestfs_mkfs_opts guestfs_mkfs_opts_argv guestfs_mkfs_opts_va guestfs_mkmountpoint guestfs_mknod guestfs_mknod_b guestfs_mknod_c guestfs_mkswap guestfs_mkswap_file guestfs_mkswap_L guestfs_mkswap_U guestfs_modprobe guestfs_mount guestfs_mount_loop guestfs_mount_options guestfs_mountpoints guestfs_mount_ro guestfs_mounts guestfs_mount_vfs guestfs_mv guestfs_ntfs_3g_probe guestfs_ntfsresize guestfs_ntfsresize_size guestfs_part_add guestfs_part_del guestfs_part_disk guestfs_part_get_bootable guestfs_part_get_mbr_id guestfs_part_get_parttype guestfs_part_init guestfs_partition guestfs_partition_list guestfs_part_list guestfs_part_set_bootable guestfs_part_set_mbr_id guestfs_part_set_name guestfs_part_to_dev guestfs_perrorf guestfs_ping_daemon guestfs_pread guestfs_pread_device guestfs_progress_cb guestfs_protocol guestfs_pvcreate guestfs_pvremove guestfs_pvresize guestfs_pvresize_size guestfs_pvs guestfs_pvs_full guestfs_pvuuid guestfs_pwrite guestfs_pwrite_device guestfs_readdir guestfs_read_file guestfs_read_lines guestfs_readlink guestfs_readlinklist guestfs_realpath guestfs_removexattr guestfs_resize2fs guestfs_resize2fs_size guestfs_rm guestfs_rmdir guestfs_rmmountpoint guestfs_rm_rf guestfs_safe_asprintf guestfs_safe_calloc guestfs_safe_malloc guestfs_safe_memdup guestfs_safe_realloc guestfs_safe_strdup guestfs_safe_strndup guestfs_scrub_device guestfs_scrub_file guestfs_scrub_freespace guestfs_set_append guestfs_set_autosync guestfs_set_close_callback guestfs_setcon guestfs_set_direct guestfs_set_e2label guestfs_set_e2uuid guestfs_set_error_handler guestfs_set_launch_done_callback guestfs_set_log_message_callback guestfs_set_memsize guestfs_set_network guestfs_set_out_of_memory_handler guestfs_set_path guestfs_set_private guestfs_set_progress_callback guestfs_set_qemu guestfs_set_recovery_proc guestfs_set_selinux guestfs_set_subprocess_quit_callback guestfs_set_trace guestfs_set_verbose guestfs_setxattr guestfs_sfdisk guestfs_sfdisk_disk_geometry guestfs_sfdisk_kernel_geometry guestfs_sfdisk_l guestfs_sfdiskM guestfs_sfdisk_N guestfs_sh guestfs_sh_lines guestfs_sleep guestfs_stat guestfs_stat_list guestfs_statvfs guestfs_statvfs_list guestfs_strings guestfs_strings_e guestfs_subprocess_quit_cb guestfs_swapoff_device guestfs_swapoff_file guestfs_swapoff_label guestfs_swapoff_uuid guestfs_swapon_device guestfs_swapon_file guestfs_swapon_label guestfs_swapon_uuid guestfs_sync guestfs_tail guestfs_tail_n guestfs_tar_in guestfs_tar_out guestfs_tgz_in guestfs_tgz_out guestfs_touch guestfs_truncate guestfs_truncate_size guestfs_tune2fs_l guestfs_txz_in guestfs_txz_out guestfs_umask guestfs_umount guestfs_umount_all guestfs_upload guestfs_upload_offset guestfs_utimens guestfs_version guestfs_version_list guestfs_vfs_label guestfs_vfs_type guestfs_vfs_uuid guestfs_vg_activate guestfs_vg_activate_all guestfs_vgcreate guestfs_vglvuuids guestfs_vgpvuuids guestfs_vgremove guestfs_vgrename guestfs_vgs guestfs_vgscan guestfs_vgs_full guestfs_vguuid guestfs_wait_ready guestfs_wc_c guestfs_wc_l guestfs_wc_w guestfs_write guestfs_write_file guestfs_xattr guestfs_xattr_list guestfs_zegrep guestfs_zegrepi guestfs_zero guestfs_zero_device guestfs_zerofree guestfs_zfgrep guestfs_zfgrepi guestfs_zfile guestfs_zgrep guestfs_zgrepi '>101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
/*
 * asm-s390/kvm_host.h - definition for kernel virtual machines on s390
 *
 * Copyright IBM Corp. 2008
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License (version 2 only)
 * as published by the Free Software Foundation.
 *
 *    Author(s): Carsten Otte <cotte@de.ibm.com>
 */


#ifndef ASM_KVM_HOST_H
#define ASM_KVM_HOST_H
#include <linux/hrtimer.h>
#include <linux/interrupt.h>
#include <linux/kvm_host.h>
#include <asm/debug.h>
#include <asm/cpuid.h>

#define KVM_MAX_VCPUS 64
#define KVM_MEMORY_SLOTS 32
/* memory slots that does not exposed to userspace */
#define KVM_PRIVATE_MEM_SLOTS 4

struct sca_entry {
	atomic_t scn;
	__u64	reserved;
	__u64	sda;
	__u64	reserved2[2];
} __attribute__((packed));


struct sca_block {
	__u64	ipte_control;
	__u64	reserved[5];
	__u64	mcn;
	__u64	reserved2;
	struct sca_entry cpu[64];
} __attribute__((packed));

#define KVM_PAGES_PER_HPAGE 256

#define CPUSTAT_HOST       0x80000000
#define CPUSTAT_WAIT       0x10000000
#define CPUSTAT_ECALL_PEND 0x08000000
#define CPUSTAT_STOP_INT   0x04000000
#define CPUSTAT_IO_INT     0x02000000
#define CPUSTAT_EXT_INT    0x01000000
#define CPUSTAT_RUNNING    0x00800000
#define CPUSTAT_RETAINED   0x00400000
#define CPUSTAT_TIMING_SUB 0x00020000
#define CPUSTAT_SIE_SUB    0x00010000
#define CPUSTAT_RRF        0x00008000
#define CPUSTAT_SLSV       0x00004000
#define CPUSTAT_SLSR       0x00002000
#define CPUSTAT_ZARCH      0x00000800
#define CPUSTAT_MCDS       0x00000100
#define CPUSTAT_SM         0x00000080
#define CPUSTAT_G          0x00000008
#define CPUSTAT_J          0x00000002
#define CPUSTAT_P          0x00000001

struct kvm_s390_sie_block {
	atomic_t cpuflags;		/* 0x0000 */
	__u32	prefix;			/* 0x0004 */
	__u8	reserved8[32];		/* 0x0008 */
	__u64	cputm;			/* 0x0028 */
	__u64	ckc;			/* 0x0030 */
	__u64	epoch;			/* 0x0038 */
	__u8	reserved40[4];		/* 0x0040 */
#define LCTL_CR0	0x8000
	__u16   lctl;			/* 0x0044 */
	__s16	icpua;			/* 0x0046 */
	__u32	ictl;			/* 0x0048 */
	__u32	eca;			/* 0x004c */
	__u8	icptcode;		/* 0x0050 */
	__u8	reserved51;		/* 0x0051 */
	__u16	ihcpu;			/* 0x0052 */
	__u8	reserved54[2];		/* 0x0054 */
	__u16	ipa;			/* 0x0056 */
	__u32	ipb;			/* 0x0058 */
	__u32	scaoh;			/* 0x005c */
	__u8	reserved60;		/* 0x0060 */
	__u8	ecb;			/* 0x0061 */
	__u8	reserved62[2];		/* 0x0062 */
	__u32	scaol;			/* 0x0064 */
	__u8	reserved68[4];		/* 0x0068 */
	__u32	todpr;			/* 0x006c */
	__u8	reserved70[16];		/* 0x0070 */
	__u64	gmsor;			/* 0x0080 */
	__u64	gmslm;			/* 0x0088 */
	psw_t	gpsw;			/* 0x0090 */
	__u64	gg14;			/* 0x00a0 */
	__u64	gg15;			/* 0x00a8 */
	__u8	reservedb0[30];		/* 0x00b0 */
	__u16   iprcc;			/* 0x00ce */
	__u8	reservedd0[48];		/* 0x00d0 */
	__u64	gcr[16];		/* 0x0100 */
	__u64	gbea;			/* 0x0180 */
	__u8	reserved188[24];	/* 0x0188 */
	__u32	fac;			/* 0x01a0 */
	__u8	reserved1a4[92];	/* 0x01a4 */
} __attribute__((packed));

struct kvm_vcpu_stat {
	u32 exit_userspace;
	u32 exit_null;
	u32 exit_external_request;
	u32 exit_external_interrupt;
	u32 exit_stop_request;
	u32 exit_validity;
	u32 exit_instruction;
	u32 instruction_lctl;
	u32 instruction_lctlg;
	u32 exit_program_interruption;
	u32 exit_instr_and_program;
	u32 deliver_emergency_signal;
	u32 deliver_service_signal;
	u32 deliver_virtio_interrupt;
	u32 deliver_stop_signal;
	u32 deliver_prefix_signal;
	u32 deliver_restart_signal;
	u32 deliver_program_int;
	u32 exit_wait_state;
	u32 instruction_stidp;
	u32 instruction_spx;
	u32 instruction_stpx;
	u32 instruction_stap;
	u32 instruction_storage_key;
	u32 instruction_stsch;
	u32 instruction_chsc;
	u32 instruction_stsi;
	u32 instruction_stfl;
	u32 instruction_sigp_sense;
	u32 instruction_sigp_emergency;
	u32 instruction_sigp_stop;
	u32 instruction_sigp_arch;
	u32 instruction_sigp_prefix;
	u32 instruction_sigp_restart;
	u32 diagnose_44;
};

struct kvm_s390_io_info {
	__u16        subchannel_id;            /* 0x0b8 */
	__u16        subchannel_nr;            /* 0x0ba */
	__u32        io_int_parm;              /* 0x0bc */
	__u32        io_int_word;              /* 0x0c0 */
};

struct kvm_s390_ext_info {
	__u32 ext_params;
	__u64 ext_params2;
};