提交 2f8311c9 编写于 作者: C Christian Borntraeger

KVM: s390: add debug tracing for cpu features of CPU model

The cpu model already traces the cpu facilities, the ibc and
guest CPU ids. We should do the same for the cpu features (on
success only).
Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: NHalil Pasic <pasic@linux.vnet.ibm.com>
Reviewed-by: NCornelia Huck <cohuck@redhat.com>
Reviewed-by: NDavid Hildenbrand <david@redhat.com>
上级 241e3ec0
...@@ -1084,7 +1084,6 @@ static int kvm_s390_set_processor_feat(struct kvm *kvm, ...@@ -1084,7 +1084,6 @@ static int kvm_s390_set_processor_feat(struct kvm *kvm,
struct kvm_device_attr *attr) struct kvm_device_attr *attr)
{ {
struct kvm_s390_vm_cpu_feat data; struct kvm_s390_vm_cpu_feat data;
int ret = -EBUSY;
if (copy_from_user(&data, (void __user *)attr->addr, sizeof(data))) if (copy_from_user(&data, (void __user *)attr->addr, sizeof(data)))
return -EFAULT; return -EFAULT;
...@@ -1094,13 +1093,18 @@ static int kvm_s390_set_processor_feat(struct kvm *kvm, ...@@ -1094,13 +1093,18 @@ static int kvm_s390_set_processor_feat(struct kvm *kvm,
return -EINVAL; return -EINVAL;
mutex_lock(&kvm->lock); mutex_lock(&kvm->lock);
if (!kvm->created_vcpus) { if (kvm->created_vcpus) {
bitmap_copy(kvm->arch.cpu_feat, (unsigned long *) data.feat, mutex_unlock(&kvm->lock);
KVM_S390_VM_CPU_FEAT_NR_BITS); return -EBUSY;
ret = 0;
} }
bitmap_copy(kvm->arch.cpu_feat, (unsigned long *) data.feat,
KVM_S390_VM_CPU_FEAT_NR_BITS);
mutex_unlock(&kvm->lock); mutex_unlock(&kvm->lock);
return ret; VM_EVENT(kvm, 3, "SET: guest feat: 0x%16.16llx.0x%16.16llx.0x%16.16llx",
data.feat[0],
data.feat[1],
data.feat[2]);
return 0;
} }
static int kvm_s390_set_processor_subfunc(struct kvm *kvm, static int kvm_s390_set_processor_subfunc(struct kvm *kvm,
...@@ -1202,6 +1206,10 @@ static int kvm_s390_get_processor_feat(struct kvm *kvm, ...@@ -1202,6 +1206,10 @@ static int kvm_s390_get_processor_feat(struct kvm *kvm,
KVM_S390_VM_CPU_FEAT_NR_BITS); KVM_S390_VM_CPU_FEAT_NR_BITS);
if (copy_to_user((void __user *)attr->addr, &data, sizeof(data))) if (copy_to_user((void __user *)attr->addr, &data, sizeof(data)))
return -EFAULT; return -EFAULT;
VM_EVENT(kvm, 3, "GET: guest feat: 0x%16.16llx.0x%16.16llx.0x%16.16llx",
data.feat[0],
data.feat[1],
data.feat[2]);
return 0; return 0;
} }
...@@ -1215,6 +1223,10 @@ static int kvm_s390_get_machine_feat(struct kvm *kvm, ...@@ -1215,6 +1223,10 @@ static int kvm_s390_get_machine_feat(struct kvm *kvm,
KVM_S390_VM_CPU_FEAT_NR_BITS); KVM_S390_VM_CPU_FEAT_NR_BITS);
if (copy_to_user((void __user *)attr->addr, &data, sizeof(data))) if (copy_to_user((void __user *)attr->addr, &data, sizeof(data)))
return -EFAULT; return -EFAULT;
VM_EVENT(kvm, 3, "GET: host feat: 0x%16.16llx.0x%16.16llx.0x%16.16llx",
data.feat[0],
data.feat[1],
data.feat[2]);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册