aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/uapi/asm/kvm.h
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2016-05-18 10:03:47 -0400
committerChristian Borntraeger <borntraeger@de.ibm.com>2016-06-10 06:07:17 -0400
commit0a763c780b7cb830c250d00ead975778ab948f40 (patch)
treef7d7448dcaf8f74032a55dadc21db3f4ec4958e9 /arch/s390/include/uapi/asm/kvm.h
parent1afd43e0fbba4a92effc22977e3a7e64213ee860 (diff)
KVM: s390: interface to query and configure cpu subfunctions
We have certain instructions that indicate available subfunctions via a query subfunction (crypto functions and ptff), or via a test bit function (plo). By exposing these "subfunction blocks" to user space, we allow user space to 1) query available subfunctions and make sure subfunctions won't get lost during migration - e.g. properly indicate them via a CPU model 2) change the subfunctions to be reported to the guest (even adding unavailable ones) This mechanism works just like the way we indicate the stfl(e) list to user space. This way, user space could even emulate some subfunctions in QEMU in the future. If this is ever applicable, we have to make sure later on, that unsupported subfunctions result in an intercept to QEMU. Please note that support to indicate them to the guest is still missing and requires hardware support. Usually, the IBC takes already care of these subfunctions for migration safety. QEMU should make sure to always set these bits properly according to the machine generation to be emulated. Available subfunctions are only valid in combination with STFLE bits retrieved via KVM_S390_VM_CPU_MACHINE and enabled via KVM_S390_VM_CPU_PROCESSOR. If the applicable bits are available, the indicated subfunctions are guaranteed to be correct. Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/include/uapi/asm/kvm.h')
-rw-r--r--arch/s390/include/uapi/asm/kvm.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/s390/include/uapi/asm/kvm.h b/arch/s390/include/uapi/asm/kvm.h
index 789c4e27e294..f0818d70d73d 100644
--- a/arch/s390/include/uapi/asm/kvm.h
+++ b/arch/s390/include/uapi/asm/kvm.h
@@ -102,6 +102,26 @@ struct kvm_s390_vm_cpu_feat {
102 __u64 feat[16]; 102 __u64 feat[16];
103}; 103};
104 104
105#define KVM_S390_VM_CPU_PROCESSOR_SUBFUNC 4
106#define KVM_S390_VM_CPU_MACHINE_SUBFUNC 5
107/* for "test bit" instructions MSB 0 bit ordering, for "query" raw blocks */
108struct kvm_s390_vm_cpu_subfunc {
109 __u8 plo[32]; /* always */
110 __u8 ptff[16]; /* with TOD-clock steering */
111 __u8 kmac[16]; /* with MSA */
112 __u8 kmc[16]; /* with MSA */
113 __u8 km[16]; /* with MSA */
114 __u8 kimd[16]; /* with MSA */
115 __u8 klmd[16]; /* with MSA */
116 __u8 pckmo[16]; /* with MSA3 */
117 __u8 kmctr[16]; /* with MSA4 */
118 __u8 kmf[16]; /* with MSA4 */
119 __u8 kmo[16]; /* with MSA4 */
120 __u8 pcc[16]; /* with MSA4 */
121 __u8 ppno[16]; /* with MSA5 */
122 __u8 reserved[1824];
123};
124
105/* kvm attributes for crypto */ 125/* kvm attributes for crypto */
106#define KVM_S390_VM_CRYPTO_ENABLE_AES_KW 0 126#define KVM_S390_VM_CRYPTO_ENABLE_AES_KW 0
107#define KVM_S390_VM_CRYPTO_ENABLE_DEA_KW 1 127#define KVM_S390_VM_CRYPTO_ENABLE_DEA_KW 1