aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2017-01-18 10:01:02 -0500
committerChristian Borntraeger <borntraeger@de.ibm.com>2017-01-30 05:19:46 -0500
commita8c39dd77cb9fad0d0e5c5e6581851bdcbc1e6f6 (patch)
tree69543e0fcd101139faeef7b6249a61b8bd382db1
parentaf0f339a6c18468421a67f361a60f14bc5144345 (diff)
KVM: s390: Add debug logging to basic cpu model interface
Let's log something for changes in facilities, cpuid and ibc now that we have a cpu model in QEMU. All of these calls are pretty seldom, so we will not spill the log, the they will help to understand pontential guest issues, for example if some instructions are fenced off. As the s390 debug feature has a limited amount of parameters and strings must not go away we limit the facility printing to 3 double words, instead of building that list dynamically. This should be enough for several years. If we ever exceed 3 double words then the logging will be incomplete but no functional impact will happen. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
-rw-r--r--arch/s390/kvm/kvm-s390.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 4078ba630689..dabd3b15bf11 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -829,6 +829,13 @@ static int kvm_s390_set_processor(struct kvm *kvm, struct kvm_device_attr *attr)
829 } 829 }
830 memcpy(kvm->arch.model.fac_list, proc->fac_list, 830 memcpy(kvm->arch.model.fac_list, proc->fac_list,
831 S390_ARCH_FAC_LIST_SIZE_BYTE); 831 S390_ARCH_FAC_LIST_SIZE_BYTE);
832 VM_EVENT(kvm, 3, "SET: guest ibc: 0x%4.4x, guest cpuid: 0x%16.16llx",
833 kvm->arch.model.ibc,
834 kvm->arch.model.cpuid);
835 VM_EVENT(kvm, 3, "SET: guest faclist: 0x%16.16llx.%16.16llx.%16.16llx",
836 kvm->arch.model.fac_list[0],
837 kvm->arch.model.fac_list[1],
838 kvm->arch.model.fac_list[2]);
832 } else 839 } else
833 ret = -EFAULT; 840 ret = -EFAULT;
834 kfree(proc); 841 kfree(proc);
@@ -902,6 +909,13 @@ static int kvm_s390_get_processor(struct kvm *kvm, struct kvm_device_attr *attr)
902 proc->ibc = kvm->arch.model.ibc; 909 proc->ibc = kvm->arch.model.ibc;
903 memcpy(&proc->fac_list, kvm->arch.model.fac_list, 910 memcpy(&proc->fac_list, kvm->arch.model.fac_list,
904 S390_ARCH_FAC_LIST_SIZE_BYTE); 911 S390_ARCH_FAC_LIST_SIZE_BYTE);
912 VM_EVENT(kvm, 3, "GET: guest ibc: 0x%4.4x, guest cpuid: 0x%16.16llx",
913 kvm->arch.model.ibc,
914 kvm->arch.model.cpuid);
915 VM_EVENT(kvm, 3, "GET: guest faclist: 0x%16.16llx.%16.16llx.%16.16llx",
916 kvm->arch.model.fac_list[0],
917 kvm->arch.model.fac_list[1],
918 kvm->arch.model.fac_list[2]);
905 if (copy_to_user((void __user *)attr->addr, proc, sizeof(*proc))) 919 if (copy_to_user((void __user *)attr->addr, proc, sizeof(*proc)))
906 ret = -EFAULT; 920 ret = -EFAULT;
907 kfree(proc); 921 kfree(proc);
@@ -925,6 +939,17 @@ static int kvm_s390_get_machine(struct kvm *kvm, struct kvm_device_attr *attr)
925 S390_ARCH_FAC_LIST_SIZE_BYTE); 939 S390_ARCH_FAC_LIST_SIZE_BYTE);
926 memcpy((unsigned long *)&mach->fac_list, S390_lowcore.stfle_fac_list, 940 memcpy((unsigned long *)&mach->fac_list, S390_lowcore.stfle_fac_list,
927 sizeof(S390_lowcore.stfle_fac_list)); 941 sizeof(S390_lowcore.stfle_fac_list));
942 VM_EVENT(kvm, 3, "GET: host ibc: 0x%4.4x, host cpuid: 0x%16.16llx",
943 kvm->arch.model.ibc,
944 kvm->arch.model.cpuid);
945 VM_EVENT(kvm, 3, "GET: host facmask: 0x%16.16llx.%16.16llx.%16.16llx",
946 mach->fac_mask[0],
947 mach->fac_mask[1],
948 mach->fac_mask[2]);
949 VM_EVENT(kvm, 3, "GET: host faclist: 0x%16.16llx.%16.16llx.%16.16llx",
950 mach->fac_list[0],
951 mach->fac_list[1],
952 mach->fac_list[2]);
928 if (copy_to_user((void __user *)attr->addr, mach, sizeof(*mach))) 953 if (copy_to_user((void __user *)attr->addr, mach, sizeof(*mach)))
929 ret = -EFAULT; 954 ret = -EFAULT;
930 kfree(mach); 955 kfree(mach);