1*** BIG FAT WARNING *** 2The kvm module is currently in EXPERIMENTAL state for s390. This means that 3the interface to the module is not yet considered to remain stable. Thus, be 4prepared that we keep breaking your userspace application and guest 5compatibility over and over again until we feel happy with the result. Make sure 6your guest kernel, your host kernel, and your userspace launcher are in a 7consistent state. 8 9This Documentation describes the unique ioctl calls to /dev/kvm, the resulting 10kvm-vm file descriptors, and the kvm-vcpu file descriptors that differ from x86. 11 121. ioctl calls to /dev/kvm 13KVM does support the following ioctls on s390 that are common with other 14architectures and do behave the same: 15KVM_GET_API_VERSION 16KVM_CREATE_VM (*) see note 17KVM_CHECK_EXTENSION 18KVM_GET_VCPU_MMAP_SIZE 19 20Notes: 21* KVM_CREATE_VM may fail on s390, if the calling process has multiple 22threads and has not called KVM_S390_ENABLE_SIE before. 23 24In addition, on s390 the following architecture specific ioctls are supported: 25ioctl: KVM_S390_ENABLE_SIE 26args: none 27see also: include/linux/kvm.h 28This call causes the kernel to switch on PGSTE in the user page table. This 29operation is needed in order to run a virtual machine, and it requires the 30calling process to be single-threaded. Note that the first call to KVM_CREATE_VM 31will implicitly try to switch on PGSTE if the user process has not called 32KVM_S390_ENABLE_SIE before. User processes that want to launch multiple threads 33before creating a virtual machine have to call KVM_S390_ENABLE_SIE, or will 34observe an error calling KVM_CREATE_VM. Switching on PGSTE is a one-time 35operation, is not reversible, and will persist over the entire lifetime of 36the calling process. It does not have any user-visible effect other than a small 37performance penalty. 38 392. ioctl calls to the kvm-vm file descriptor 40KVM does support the following ioctls on s390 that are common with other 41architectures and do behave the same: 42KVM_CREATE_VCPU 43KVM_SET_USER_MEMORY_REGION (*) see note 44KVM_GET_DIRTY_LOG (**) see note 45 46Notes: 47* kvm does only allow exactly one memory slot on s390, which has to start 48 at guest absolute address zero and at a user address that is aligned on any 49 page boundary. This hardware "limitation" allows us to have a few unique 50 optimizations. The memory slot doesn't have to be filled 51 with memory actually, it may contain sparse holes. That said, with different 52 user memory layout this does still allow a large flexibility when 53 doing the guest memory setup. 54** KVM_GET_DIRTY_LOG doesn't work properly yet. The user will receive an empty 55log. This ioctl call is only needed for guest migration, and we intend to 56implement this one in the future. 57 58In addition, on s390 the following architecture specific ioctls for the kvm-vm 59file descriptor are supported: 60ioctl: KVM_S390_INTERRUPT 61args: struct kvm_s390_interrupt * 62see also: include/linux/kvm.h 63This ioctl is used to submit a floating interrupt for a virtual machine. 64Floating interrupts may be delivered to any virtual cpu in the configuration. 65Only some interrupt types defined in include/linux/kvm.h make sense when 66submitted as floating interrupts. The following interrupts are not considered 67to be useful as floating interrupts, and a call to inject them will result in 68-EINVAL error code: program interrupts and interprocessor signals. Valid 69floating interrupts are: 70KVM_S390_INT_VIRTIO 71KVM_S390_INT_SERVICE 72 733. ioctl calls to the kvm-vcpu file descriptor 74KVM does support the following ioctls on s390 that are common with other 75architectures and do behave the same: 76KVM_RUN 77KVM_GET_REGS 78KVM_SET_REGS 79KVM_GET_SREGS 80KVM_SET_SREGS 81KVM_GET_FPU 82KVM_SET_FPU 83 84In addition, on s390 the following architecture specific ioctls for the 85kvm-vcpu file descriptor are supported: 86ioctl: KVM_S390_INTERRUPT 87args: struct kvm_s390_interrupt * 88see also: include/linux/kvm.h 89This ioctl is used to submit an interrupt for a specific virtual cpu. 90Only some interrupt types defined in include/linux/kvm.h make sense when 91submitted for a specific cpu. The following interrupts are not considered 92to be useful, and a call to inject them will result in -EINVAL error code: 93service processor calls and virtio interrupts. Valid interrupt types are: 94KVM_S390_PROGRAM_INT 95KVM_S390_SIGP_STOP 96KVM_S390_RESTART 97KVM_S390_SIGP_SET_PREFIX 98KVM_S390_INT_EMERGENCY 99 100ioctl: KVM_S390_STORE_STATUS 101args: unsigned long 102see also: include/linux/kvm.h 103This ioctl stores the state of the cpu at the guest real address given as 104argument, unless one of the following values defined in include/linux/kvm.h 105is given as argument: 106KVM_S390_STORE_STATUS_NOADDR - the CPU stores its status to the save area in 107absolute lowcore as defined by the principles of operation 108KVM_S390_STORE_STATUS_PREFIXED - the CPU stores its status to the save area in 109its prefix page just like the dump tool that comes with zipl. This is useful 110to create a system dump for use with lkcdutils or crash. 111 112ioctl: KVM_S390_SET_INITIAL_PSW 113args: struct kvm_s390_psw * 114see also: include/linux/kvm.h 115This ioctl can be used to set the processor status word (psw) of a stopped cpu 116prior to running it with KVM_RUN. Note that this call is not required to modify 117the psw during sie intercepts that fall back to userspace because struct kvm_run 118does contain the psw, and this value is evaluated during reentry of KVM_RUN 119after the intercept exit was recognized. 120 121ioctl: KVM_S390_INITIAL_RESET 122args: none 123see also: include/linux/kvm.h 124This ioctl can be used to perform an initial cpu reset as defined by the 125principles of operation. The target cpu has to be in stopped state. 126