Merge tag 'vfio-v4.6-rc1' of git://github.com/awilliam/linux-vfio
[linux-2.6-block.git] / Documentation / virtual / kvm / devices / vm.txt
CommitLineData
f2061656
DD
1Generic vm interface
2====================================
3
4The virtual machine "device" also accepts the ioctls KVM_SET_DEVICE_ATTR,
5KVM_GET_DEVICE_ATTR, and KVM_HAS_DEVICE_ATTR. The interface uses the same
6struct kvm_device_attr as other devices, but targets VM-wide settings
7and controls.
8
9The groups and attributes per virtual machine, if any, are architecture
10specific.
4f718eab
DD
11
121. GROUP: KVM_S390_VM_MEM_CTRL
13Architectures: s390
14
365dc163 151.1. ATTRIBUTE: KVM_S390_VM_MEM_ENABLE_CMMA
4f718eab 16Parameters: none
365dc163 17Returns: -EBUSY if a vcpu is already defined, otherwise 0
4f718eab 18
365dc163 19Enables Collaborative Memory Management Assist (CMMA) for the virtual machine.
4f718eab 20
365dc163
DD
211.2. ATTRIBUTE: KVM_S390_VM_MEM_CLR_CMMA
22Parameters: none
4f718eab
DD
23Returns: 0
24
25Clear the CMMA status for all guest pages, so any pages the guest marked
26as unused are again used any may not be reclaimed by the host.
8c0a7ce6
DD
27
281.3. ATTRIBUTE KVM_S390_VM_MEM_LIMIT_SIZE
29Parameters: in attr->addr the address for the new limit of guest memory
30Returns: -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
37Allows userspace to query the actual limit and set a new limit for
38the maximum guest memory size. The limit will be rounded up to
392048 MB, 4096 GB, 8192 TB respectively, as this limit is governed by
a3a92c31
DD
40the number of page table levels. In the case that there is no limit we will set
41the limit to KVM_S390_NO_MEM_LIMIT (U64_MAX).
658b6eda
MM
42
432. GROUP: KVM_S390_VM_CPU_MODEL
44Architectures: s390
45
462.1. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE (r/o)
47
48Allows user space to retrieve machine and kvm specific cpu related information:
49
50struct kvm_s390_vm_cpu_machine {
51 __u64 cpuid; # CPUID of host
52 __u32 ibc; # IBC level range offered by host
53 __u8 pad[4];
54 __u64 fac_mask[256]; # set of cpu facilities enabled by KVM
55 __u64 fac_list[256]; # set of cpu facilities offered by host
56}
57
58Parameters: address of buffer to store the machine related cpu data
59 of type struct kvm_s390_vm_cpu_machine*
60Returns: -EFAULT if the given address is not accessible from kernel space
61 -ENOMEM if not enough memory is available to process the ioctl
62 0 in case of success
63
642.2. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR (r/w)
65
66Allows user space to retrieve or request to change cpu related information for a vcpu:
67
68struct 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
71 __u8 pad[6];
72 __u64 fac_list[256]; # set of cpu facilities currently (to be) used
73 # by this vcpu
74}
75
76KVM does not enforce or limit the cpu model data in any form. Take the information
77retrieved by means of KVM_S390_VM_CPU_MACHINE as hint for reasonable configuration
5d4f6f3d 78setups. Instruction interceptions triggered by additionally set facility bits that
658b6eda
MM
79are not handled by KVM need to by imlemented in the VM driver code.
80
81Parameters: address of buffer to store/set the processor related cpu
82 data of type struct kvm_s390_vm_cpu_processor*.
83Returns: -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
86 0 in case of success
aad3c1d9
DH
87
883. GROUP: KVM_S390_VM_TOD
89Architectures: s390
90
913.1. ATTRIBUTE: KVM_S390_VM_TOD_HIGH
92
93Allows user space to set/get the TOD clock extension (u8).
94
95Parameters: address of a buffer in user space to store the data (u8) to
96Returns: -EFAULT if the given address is not accessible from kernel space
97 -EINVAL if setting the TOD clock extension to != 0 is not supported
98
993.2. ATTRIBUTE: KVM_S390_VM_TOD_LOW
100
101Allows user space to set/get bits 0-63 of the TOD clock register as defined in
102the POP (u64).
103
104Parameters: address of a buffer in user space to store the data (u64) to
105Returns: -EFAULT if the given address is not accessible from kernel space
eaf2b656
DH
106
1074. GROUP: KVM_S390_VM_CRYPTO
108Architectures: s390
109
1104.1. ATTRIBUTE: KVM_S390_VM_CRYPTO_ENABLE_AES_KW (w/o)
111
112Allows user space to enable aes key wrapping, including generating a new
113wrapping key.
114
115Parameters: none
116Returns: 0
117
1184.2. ATTRIBUTE: KVM_S390_VM_CRYPTO_ENABLE_DEA_KW (w/o)
119
120Allows user space to enable dea key wrapping, including generating a new
121wrapping key.
122
123Parameters: none
124Returns: 0
125
1264.3. ATTRIBUTE: KVM_S390_VM_CRYPTO_DISABLE_AES_KW (w/o)
127
128Allows user space to disable aes key wrapping, clearing the wrapping key.
129
130Parameters: none
131Returns: 0
132
1334.4. ATTRIBUTE: KVM_S390_VM_CRYPTO_DISABLE_DEA_KW (w/o)
134
135Allows user space to disable dea key wrapping, clearing the wrapping key.
136
137Parameters: none
138Returns: 0