aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2017-11-09 04:00:45 -0500
committerChristian Borntraeger <borntraeger@de.ibm.com>2017-11-09 10:48:51 -0500
commitda9a1446d248f673a8560ce46251ff620214ab7b (patch)
tree1ad9a5e7c71c4c31536e0a532339ec759a2ad0e8
parent4dd6f17eb913d3d23dd6c07950627ac2c3068dca (diff)
KVM: s390: provide a capability for AIS state migration
The AIS capability was introduced in 4.12, while the interface to migrate the state was added in 4.13. Unfortunately it is not possible for userspace to detect the migration capability without creating a flic kvm device. As in QEMU the cpu model detection runs on the "none" machine this will result in cpu model issues regarding the "ais" capability. To get the "ais" capability properly let's add a new KVM capability that tells userspace that AIS states can be migrated. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Acked-by: Halil Pasic <pasic@linux.vnet.ibm.com>
-rw-r--r--Documentation/virtual/kvm/api.txt9
-rw-r--r--Documentation/virtual/kvm/devices/s390_flic.txt2
-rw-r--r--arch/s390/kvm/kvm-s390.c1
-rw-r--r--include/uapi/linux/kvm.h1
4 files changed, 13 insertions, 0 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index e63a35fafef0..49540e53c4bd 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -4347,3 +4347,12 @@ This capability indicates that userspace can load HV_X64_MSR_VP_INDEX msr. Its
4347value is used to denote the target vcpu for a SynIC interrupt. For 4347value is used to denote the target vcpu for a SynIC interrupt. For
4348compatibilty, KVM initializes this msr to KVM's internal vcpu index. When this 4348compatibilty, KVM initializes this msr to KVM's internal vcpu index. When this
4349capability is absent, userspace can still query this msr's value. 4349capability is absent, userspace can still query this msr's value.
4350
43518.13 KVM_CAP_S390_AIS_MIGRATION
4352
4353Architectures: s390
4354Parameters: none
4355
4356This capability indicates if the flic device will be able to get/set the
4357AIS states for migration via the KVM_DEV_FLIC_AISM_ALL attribute and allows
4358to discover this without having to create a flic device.
diff --git a/Documentation/virtual/kvm/devices/s390_flic.txt b/Documentation/virtual/kvm/devices/s390_flic.txt
index 27ad53c7149d..a4e20a090174 100644
--- a/Documentation/virtual/kvm/devices/s390_flic.txt
+++ b/Documentation/virtual/kvm/devices/s390_flic.txt
@@ -151,6 +151,8 @@ struct kvm_s390_ais_all {
151 to an ISC (MSB0 bit 0 to ISC 0 and so on). The combination of simm bit and 151 to an ISC (MSB0 bit 0 to ISC 0 and so on). The combination of simm bit and
152 nimm bit presents AIS mode for a ISC. 152 nimm bit presents AIS mode for a ISC.
153 153
154 KVM_DEV_FLIC_AISM_ALL is indicated by KVM_CAP_S390_AIS_MIGRATION.
155
154Note: The KVM_SET_DEVICE_ATTR/KVM_GET_DEVICE_ATTR device ioctls executed on 156Note: The KVM_SET_DEVICE_ATTR/KVM_GET_DEVICE_ATTR device ioctls executed on
155FLIC with an unknown group or attribute gives the error code EINVAL (instead of 157FLIC with an unknown group or attribute gives the error code EINVAL (instead of
156ENXIO, as specified in the API documentation). It is not possible to conclude 158ENXIO, as specified in the API documentation). It is not possible to conclude
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index de6a5b790da0..8f4b655f65d7 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -395,6 +395,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
395 case KVM_CAP_S390_USER_INSTR0: 395 case KVM_CAP_S390_USER_INSTR0:
396 case KVM_CAP_S390_CMMA_MIGRATION: 396 case KVM_CAP_S390_CMMA_MIGRATION:
397 case KVM_CAP_S390_AIS: 397 case KVM_CAP_S390_AIS:
398 case KVM_CAP_S390_AIS_MIGRATION:
398 r = 1; 399 r = 1;
399 break; 400 break;
400 case KVM_CAP_S390_MEM_OP: 401 case KVM_CAP_S390_MEM_OP:
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 838887587411..b60595696836 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -930,6 +930,7 @@ struct kvm_ppc_resize_hpt {
930#define KVM_CAP_PPC_SMT_POSSIBLE 147 930#define KVM_CAP_PPC_SMT_POSSIBLE 147
931#define KVM_CAP_HYPERV_SYNIC2 148 931#define KVM_CAP_HYPERV_SYNIC2 148
932#define KVM_CAP_HYPERV_VP_INDEX 149 932#define KVM_CAP_HYPERV_VP_INDEX 149
933#define KVM_CAP_S390_AIS_MIGRATION 150
933 934
934#ifdef KVM_CAP_IRQ_ROUTING 935#ifdef KVM_CAP_IRQ_ROUTING
935 936