| 1 | Generic vm interface |
| 2 | ==================================== |
| 3 | |
| 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 |
| 7 | and controls. |
| 8 | |
| 9 | The groups and attributes per virtual machine, if any, are architecture |
| 10 | specific. |
| 11 | |
| 12 | 1. GROUP: KVM_S390_VM_MEM_CTRL |
| 13 | Architectures: s390 |
| 14 | |
| 15 | 1.1. ATTRIBUTE: KVM_S390_VM_MEM_ENABLE_CMMA |
| 16 | Parameters: none |
| 17 | Returns: -EBUSY if a vcpu is already defined, otherwise 0 |
| 18 | |
| 19 | Enables Collaborative Memory Management Assist (CMMA) for the virtual machine. |
| 20 | |
| 21 | 1.2. ATTRIBUTE: KVM_S390_VM_MEM_CLR_CMMA |
| 22 | Parameters: none |
| 23 | Returns: 0 |
| 24 | |
| 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. |
| 27 | |
| 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 |
| 35 | 0 otherwise |
| 36 | |
| 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. |
| 41 | |
| 42 | 2. GROUP: KVM_S390_VM_CPU_MODEL |
| 43 | Architectures: s390 |
| 44 | |
| 45 | 2.1. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE (r/o) |
| 46 | |
| 47 | Allows user space to retrieve machine and kvm specific cpu related information: |
| 48 | |
| 49 | struct kvm_s390_vm_cpu_machine { |
| 50 | __u64 cpuid; # CPUID of host |
| 51 | __u32 ibc; # IBC level range offered by host |
| 52 | __u8 pad[4]; |
| 53 | __u64 fac_mask[256]; # set of cpu facilities enabled by KVM |
| 54 | __u64 fac_list[256]; # set of cpu facilities offered by host |
| 55 | } |
| 56 | |
| 57 | Parameters: address of buffer to store the machine related cpu data |
| 58 | of type struct kvm_s390_vm_cpu_machine* |
| 59 | Returns: -EFAULT if the given address is not accessible from kernel space |
| 60 | -ENOMEM if not enough memory is available to process the ioctl |
| 61 | 0 in case of success |
| 62 | |
| 63 | 2.2. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR (r/w) |
| 64 | |
| 65 | Allows user space to retrieve or request to change cpu related information for a vcpu: |
| 66 | |
| 67 | struct kvm_s390_vm_cpu_processor { |
| 68 | __u64 cpuid; # CPUID currently (to be) used by this vcpu |
| 69 | __u16 ibc; # IBC level currently (to be) used by this vcpu |
| 70 | __u8 pad[6]; |
| 71 | __u64 fac_list[256]; # set of cpu facilities currently (to be) used |
| 72 | # by this vcpu |
| 73 | } |
| 74 | |
| 75 | KVM does not enforce or limit the cpu model data in any form. Take the information |
| 76 | retrieved by means of KVM_S390_VM_CPU_MACHINE as hint for reasonable configuration |
| 77 | setups. Instruction interceptions triggered by additionally set facilitiy bits that |
| 78 | are not handled by KVM need to by imlemented in the VM driver code. |
| 79 | |
| 80 | Parameters: address of buffer to store/set the processor related cpu |
| 81 | data of type struct kvm_s390_vm_cpu_processor*. |
| 82 | Returns: -EBUSY in case 1 or more vcpus are already activated (only in write case) |
| 83 | -EFAULT if the given address is not accessible from kernel space |
| 84 | -ENOMEM if not enough memory is available to process the ioctl |
| 85 | 0 in case of success |