Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) .. SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) ====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) Generic vm interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) ====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) The virtual machine "device" also accepts the ioctls KVM_SET_DEVICE_ATTR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) KVM_GET_DEVICE_ATTR, and KVM_HAS_DEVICE_ATTR. The interface uses the same
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) struct kvm_device_attr as other devices, but targets VM-wide settings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) and controls.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) The groups and attributes per virtual machine, if any, are architecture
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) specific.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 1. GROUP: KVM_S390_VM_MEM_CTRL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) ==============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) :Architectures: s390
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 1.1. ATTRIBUTE: KVM_S390_VM_MEM_ENABLE_CMMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) -------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) :Parameters: none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) :Returns: -EBUSY if a vcpu is already defined, otherwise 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) Enables Collaborative Memory Management Assist (CMMA) for the virtual machine.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 1.2. ATTRIBUTE: KVM_S390_VM_MEM_CLR_CMMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) ----------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) :Parameters: none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) :Returns: -EINVAL if CMMA was not enabled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	  0 otherwise
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) Clear the CMMA status for all guest pages, so any pages the guest marked
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) as unused are again used any may not be reclaimed by the host.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 1.3. ATTRIBUTE KVM_S390_VM_MEM_LIMIT_SIZE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) -----------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) :Parameters: in attr->addr the address for the new limit of guest memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) :Returns: -EFAULT if the given address is not accessible;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	  -EINVAL if the virtual machine is of type UCONTROL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	  -E2BIG if the given guest memory is to big for that machine;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	  -EBUSY if a vcpu is already defined;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	  -ENOMEM if not enough memory is available for a new shadow guest mapping;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	  0 otherwise.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) Allows userspace to query the actual limit and set a new limit for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) the maximum guest memory size. The limit will be rounded up to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 2048 MB, 4096 GB, 8192 TB respectively, as this limit is governed by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) the number of page table levels. In the case that there is no limit we will set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) the limit to KVM_S390_NO_MEM_LIMIT (U64_MAX).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 2. GROUP: KVM_S390_VM_CPU_MODEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) ===============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) :Architectures: s390
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 2.1. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE (r/o)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) ---------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) Allows user space to retrieve machine and kvm specific cpu related information::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65)   struct kvm_s390_vm_cpu_machine {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66)        __u64 cpuid;           # CPUID of host
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67)        __u32 ibc;             # IBC level range offered by host
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68)        __u8  pad[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69)        __u64 fac_mask[256];   # set of cpu facilities enabled by KVM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70)        __u64 fac_list[256];   # set of cpu facilities offered by host
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71)   }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) :Parameters: address of buffer to store the machine related cpu data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	     of type struct kvm_s390_vm_cpu_machine*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) :Returns:   -EFAULT if the given address is not accessible from kernel space;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	    -ENOMEM if not enough memory is available to process the ioctl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	    0 in case of success.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 2.2. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR (r/w)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) ===============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) Allows user space to retrieve or request to change cpu related information for a vcpu::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84)   struct kvm_s390_vm_cpu_processor {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)        __u64 cpuid;           # CPUID currently (to be) used by this vcpu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86)        __u16 ibc;             # IBC level currently (to be) used by this vcpu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87)        __u8  pad[6];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88)        __u64 fac_list[256];   # set of cpu facilities currently (to be) used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 			      # by this vcpu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90)   }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) KVM does not enforce or limit the cpu model data in any form. Take the information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) retrieved by means of KVM_S390_VM_CPU_MACHINE as hint for reasonable configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) setups. Instruction interceptions triggered by additionally set facility bits that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) are not handled by KVM need to by imlemented in the VM driver code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) :Parameters: address of buffer to store/set the processor related cpu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	     data of type struct kvm_s390_vm_cpu_processor*.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) :Returns:  -EBUSY in case 1 or more vcpus are already activated (only in write case);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	   -EFAULT if the given address is not accessible from kernel space;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	   -ENOMEM if not enough memory is available to process the ioctl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	   0 in case of success.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) .. _KVM_S390_VM_CPU_MACHINE_FEAT:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 2.3. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE_FEAT (r/o)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) --------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) Allows user space to retrieve available cpu features. A feature is available if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) provided by the hardware and supported by kvm. In theory, cpu features could
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) even be completely emulated by kvm.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)   struct kvm_s390_vm_cpu_feat {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	__u64 feat[16]; # Bitmap (1 = feature available), MSB 0 bit numbering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)   };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) :Parameters: address of a buffer to load the feature list from.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) :Returns:  -EFAULT if the given address is not accessible from kernel space;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	   0 in case of success.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 2.4. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR_FEAT (r/w)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) ----------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) Allows user space to retrieve or change enabled cpu features for all VCPUs of a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) VM. Features that are not available cannot be enabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) See :ref:`KVM_S390_VM_CPU_MACHINE_FEAT` for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) a description of the parameter struct.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) :Parameters: address of a buffer to store/load the feature list from.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) :Returns:   -EFAULT if the given address is not accessible from kernel space;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	    -EINVAL if a cpu feature that is not available is to be enabled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	    -EBUSY if at least one VCPU has already been defined;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	    0 in case of success.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) .. _KVM_S390_VM_CPU_MACHINE_SUBFUNC:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 2.5. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE_SUBFUNC (r/o)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) -----------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) Allows user space to retrieve available cpu subfunctions without any filtering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) done by a set IBC. These subfunctions are indicated to the guest VCPU via
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) query or "test bit" subfunctions and used e.g. by cpacf functions, plo and ptff.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) A subfunction block is only valid if KVM_S390_VM_CPU_MACHINE contains the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) STFL(E) bit introducing the affected instruction. If the affected instruction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) indicates subfunctions via a "query subfunction", the response block is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) contained in the returned struct. If the affected instruction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) indicates subfunctions via a "test bit" mechanism, the subfunction codes are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) contained in the returned struct in MSB 0 bit numbering.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)   struct kvm_s390_vm_cpu_subfunc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)        u8 plo[32];           # always valid (ESA/390 feature)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)        u8 ptff[16];          # valid with TOD-clock steering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)        u8 kmac[16];          # valid with Message-Security-Assist
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)        u8 kmc[16];           # valid with Message-Security-Assist
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)        u8 km[16];            # valid with Message-Security-Assist
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)        u8 kimd[16];          # valid with Message-Security-Assist
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)        u8 klmd[16];          # valid with Message-Security-Assist
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)        u8 pckmo[16];         # valid with Message-Security-Assist-Extension 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)        u8 kmctr[16];         # valid with Message-Security-Assist-Extension 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)        u8 kmf[16];           # valid with Message-Security-Assist-Extension 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)        u8 kmo[16];           # valid with Message-Security-Assist-Extension 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)        u8 pcc[16];           # valid with Message-Security-Assist-Extension 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)        u8 ppno[16];          # valid with Message-Security-Assist-Extension 5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)        u8 kma[16];           # valid with Message-Security-Assist-Extension 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)        u8 kdsa[16];          # valid with Message-Security-Assist-Extension 9
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)        u8 reserved[1792];    # reserved for future instructions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)   };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) :Parameters: address of a buffer to load the subfunction blocks from.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) :Returns:   -EFAULT if the given address is not accessible from kernel space;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	    0 in case of success.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 2.6. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR_SUBFUNC (r/w)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) -------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) Allows user space to retrieve or change cpu subfunctions to be indicated for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) all VCPUs of a VM. This attribute will only be available if kernel and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) hardware support are in place.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) The kernel uses the configured subfunction blocks for indication to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) the guest. A subfunction block will only be used if the associated STFL(E) bit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) has not been disabled by user space (so the instruction to be queried is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) actually available for the guest).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) As long as no data has been written, a read will fail. The IBC will be used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) to determine available subfunctions in this case, this will guarantee backward
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) compatibility.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) See :ref:`KVM_S390_VM_CPU_MACHINE_SUBFUNC` for a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) description of the parameter struct.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) :Parameters: address of a buffer to store/load the subfunction blocks from.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) :Returns:   -EFAULT if the given address is not accessible from kernel space;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	    -EINVAL when reading, if there was no write yet;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	    -EBUSY if at least one VCPU has already been defined;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	    0 in case of success.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 3. GROUP: KVM_S390_VM_TOD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) =========================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) :Architectures: s390
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 3.1. ATTRIBUTE: KVM_S390_VM_TOD_HIGH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) ------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) Allows user space to set/get the TOD clock extension (u8) (superseded by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) KVM_S390_VM_TOD_EXT).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) :Parameters: address of a buffer in user space to store the data (u8) to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) :Returns:   -EFAULT if the given address is not accessible from kernel space;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	    -EINVAL if setting the TOD clock extension to != 0 is not supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 3.2. ATTRIBUTE: KVM_S390_VM_TOD_LOW
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) -----------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) Allows user space to set/get bits 0-63 of the TOD clock register as defined in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) the POP (u64).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) :Parameters: address of a buffer in user space to store the data (u64) to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) :Returns:    -EFAULT if the given address is not accessible from kernel space
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 3.3. ATTRIBUTE: KVM_S390_VM_TOD_EXT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) -----------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) Allows user space to set/get bits 0-63 of the TOD clock register as defined in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) the POP (u64). If the guest CPU model supports the TOD clock extension (u8), it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) also allows user space to get/set it. If the guest CPU model does not support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) it, it is stored as 0 and not allowed to be set to a value != 0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) :Parameters: address of a buffer in user space to store the data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	     (kvm_s390_vm_tod_clock) to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) :Returns:   -EFAULT if the given address is not accessible from kernel space;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	    -EINVAL if setting the TOD clock extension to != 0 is not supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 4. GROUP: KVM_S390_VM_CRYPTO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) ============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) :Architectures: s390
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 4.1. ATTRIBUTE: KVM_S390_VM_CRYPTO_ENABLE_AES_KW (w/o)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) ------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) Allows user space to enable aes key wrapping, including generating a new
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) wrapping key.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) :Parameters: none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) :Returns:    0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 4.2. ATTRIBUTE: KVM_S390_VM_CRYPTO_ENABLE_DEA_KW (w/o)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) ------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) Allows user space to enable dea key wrapping, including generating a new
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) wrapping key.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) :Parameters: none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) :Returns:    0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 4.3. ATTRIBUTE: KVM_S390_VM_CRYPTO_DISABLE_AES_KW (w/o)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) -------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) Allows user space to disable aes key wrapping, clearing the wrapping key.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) :Parameters: none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) :Returns:    0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 4.4. ATTRIBUTE: KVM_S390_VM_CRYPTO_DISABLE_DEA_KW (w/o)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) -------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) Allows user space to disable dea key wrapping, clearing the wrapping key.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) :Parameters: none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) :Returns:    0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 5. GROUP: KVM_S390_VM_MIGRATION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) ===============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) :Architectures: s390
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 5.1. ATTRIBUTE: KVM_S390_VM_MIGRATION_STOP (w/o)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) ------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) Allows userspace to stop migration mode, needed for PGSTE migration.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) Setting this attribute when migration mode is not active will have no
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) effects.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) :Parameters: none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) :Returns:    0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 5.2. ATTRIBUTE: KVM_S390_VM_MIGRATION_START (w/o)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) -------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) Allows userspace to start migration mode, needed for PGSTE migration.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) Setting this attribute when migration mode is already active will have
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) no effects.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) :Parameters: none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) :Returns:   -ENOMEM if there is not enough free memory to start migration mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 	    -EINVAL if the state of the VM is invalid (e.g. no memory defined);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 	    0 in case of success.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 5.3. ATTRIBUTE: KVM_S390_VM_MIGRATION_STATUS (r/o)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) --------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) Allows userspace to query the status of migration mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) :Parameters: address of a buffer in user space to store the data (u64) to;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 	     the data itself is either 0 if migration mode is disabled or 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 	     if it is enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) :Returns:   -EFAULT if the given address is not accessible from kernel space;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 	    0 in case of success.