2 ====================================
4 The virtual machine "device" also accepts the ioctls KVM_SET_DEVICE_ATTR,
5 KVM_GET_DEVICE_ATTR, and KVM_HAS_DEVICE_ATTR. The interface uses the same
6 struct kvm_device_attr as other devices, but targets VM-wide settings
9 The groups and attributes per virtual machine, if any, are architecture
12 1. GROUP: KVM_S390_VM_MEM_CTRL
15 1.1. ATTRIBUTE: KVM_S390_VM_MEM_ENABLE_CMMA
17 Returns: -EBUSY if a vcpu is already defined, otherwise 0
19 Enables Collaborative Memory Management Assist (CMMA) for the virtual machine.
21 1.2. ATTRIBUTE: KVM_S390_VM_MEM_CLR_CMMA
25 Clear the CMMA status for all guest pages, so any pages the guest marked
26 as unused are again used any may not be reclaimed by the host.
28 1.3. ATTRIBUTE KVM_S390_VM_MEM_LIMIT_SIZE
29 Parameters: in attr->addr the address for the new limit of guest memory
30 Returns: -EFAULT if the given address is not accessible
31 -EINVAL if the virtual machine is of type UCONTROL
32 -E2BIG if the given guest memory is to big for that machine
33 -EBUSY if a vcpu is already defined
34 -ENOMEM if not enough memory is available for a new shadow guest mapping
37 Allows userspace to query the actual limit and set a new limit for
38 the maximum guest memory size. The limit will be rounded up to
39 2048 MB, 4096 GB, 8192 TB respectively, as this limit is governed by
40 the number of page table levels. In the case that there is no limit we will set
41 the limit to KVM_S390_NO_MEM_LIMIT (U64_MAX).
43 2. GROUP: KVM_S390_VM_CPU_MODEL
46 2.1. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE (r/o)
48 Allows user space to retrieve machine and kvm specific cpu related information:
50 struct kvm_s390_vm_cpu_machine {
51 __u64 cpuid; # CPUID of host
52 __u32 ibc; # IBC level range offered by host
54 __u64 fac_mask[256]; # set of cpu facilities enabled by KVM
55 __u64 fac_list[256]; # set of cpu facilities offered by host
58 Parameters: address of buffer to store the machine related cpu data
59 of type struct kvm_s390_vm_cpu_machine*
60 Returns: -EFAULT if the given address is not accessible from kernel space
61 -ENOMEM if not enough memory is available to process the ioctl
64 2.2. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR (r/w)
66 Allows user space to retrieve or request to change cpu related information for a vcpu:
68 struct kvm_s390_vm_cpu_processor {
69 __u64 cpuid; # CPUID currently (to be) used by this vcpu
70 __u16 ibc; # IBC level currently (to be) used by this vcpu
72 __u64 fac_list[256]; # set of cpu facilities currently (to be) used
76 KVM does not enforce or limit the cpu model data in any form. Take the information
77 retrieved by means of KVM_S390_VM_CPU_MACHINE as hint for reasonable configuration
78 setups. Instruction interceptions triggered by additionally set facility bits that
79 are not handled by KVM need to by imlemented in the VM driver code.
81 Parameters: address of buffer to store/set the processor related cpu
82 data of type struct kvm_s390_vm_cpu_processor*.
83 Returns: -EBUSY in case 1 or more vcpus are already activated (only in write case)
84 -EFAULT if the given address is not accessible from kernel space
85 -ENOMEM if not enough memory is available to process the ioctl
88 3. GROUP: KVM_S390_VM_TOD
91 3.1. ATTRIBUTE: KVM_S390_VM_TOD_HIGH
93 Allows user space to set/get the TOD clock extension (u8).
95 Parameters: address of a buffer in user space to store the data (u8) to
96 Returns: -EFAULT if the given address is not accessible from kernel space
97 -EINVAL if setting the TOD clock extension to != 0 is not supported
99 3.2. ATTRIBUTE: KVM_S390_VM_TOD_LOW
101 Allows user space to set/get bits 0-63 of the TOD clock register as defined in
104 Parameters: address of a buffer in user space to store the data (u64) to
105 Returns: -EFAULT if the given address is not accessible from kernel space
107 4. GROUP: KVM_S390_VM_CRYPTO
110 4.1. ATTRIBUTE: KVM_S390_VM_CRYPTO_ENABLE_AES_KW (w/o)
112 Allows user space to enable aes key wrapping, including generating a new
118 4.2. ATTRIBUTE: KVM_S390_VM_CRYPTO_ENABLE_DEA_KW (w/o)
120 Allows user space to enable dea key wrapping, including generating a new
126 4.3. ATTRIBUTE: KVM_S390_VM_CRYPTO_DISABLE_AES_KW (w/o)
128 Allows user space to disable aes key wrapping, clearing the wrapping key.
133 4.4. ATTRIBUTE: KVM_S390_VM_CRYPTO_DISABLE_DEA_KW (w/o)
135 Allows user space to disable dea key wrapping, clearing the wrapping key.