KVM: s390: add exit io request stats and simplify code
authorChristian Borntraeger <borntraeger@de.ibm.com>
Fri, 23 Feb 2018 07:57:33 +0000 (07:57 +0000)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Wed, 14 Mar 2018 19:21:11 +0000 (19:21 +0000)
We want to count IO exit requests in kvm_stat. At the same time
we can get rid of the handle_noop function.

Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/include/asm/kvm_host.h
arch/s390/kvm/intercept.c
arch/s390/kvm/kvm-s390.c

index 27918b15a8ba25660434743e6aea0e3d4665fd36..22615af0b6e62d0386539307917e33a117283358 100644 (file)
@@ -294,6 +294,7 @@ struct kvm_vcpu_stat {
        u64 exit_userspace;
        u64 exit_null;
        u64 exit_external_request;
+       u64 exit_io_request;
        u64 exit_external_interrupt;
        u64 exit_stop_request;
        u64 exit_validity;
index 07c6e81163bf5e248c1b744f69b75548aeae5d44..a389fa85cca2d4bcb2ff6f715ffd5ffe682eb965 100644 (file)
@@ -50,18 +50,6 @@ u8 kvm_s390_get_ilen(struct kvm_vcpu *vcpu)
        return ilen;
 }
 
-static int handle_noop(struct kvm_vcpu *vcpu)
-{
-       switch (vcpu->arch.sie_block->icptcode) {
-       case 0x10:
-               vcpu->stat.exit_external_request++;
-               break;
-       default:
-               break; /* nothing */
-       }
-       return 0;
-}
-
 static int handle_stop(struct kvm_vcpu *vcpu)
 {
        struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
@@ -465,8 +453,11 @@ int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu)
 
        switch (vcpu->arch.sie_block->icptcode) {
        case ICPT_EXTREQ:
+               vcpu->stat.exit_external_request++;
+               return 0;
        case ICPT_IOREQ:
-               return handle_noop(vcpu);
+               vcpu->stat.exit_io_request++;
+               return 0;
        case ICPT_INST:
                rc = handle_instruction(vcpu);
                break;
index 957be1c51a4b3e7e69bccb7f8c9423171f49ecfc..41adcfe169a9190d25456f98179fbf68bf81a135 100644 (file)
@@ -64,6 +64,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
        { "exit_validity", VCPU_STAT(exit_validity) },
        { "exit_stop_request", VCPU_STAT(exit_stop_request) },
        { "exit_external_request", VCPU_STAT(exit_external_request) },
+       { "exit_io_request", VCPU_STAT(exit_io_request) },
        { "exit_external_interrupt", VCPU_STAT(exit_external_interrupt) },
        { "exit_instruction", VCPU_STAT(exit_instruction) },
        { "exit_pei", VCPU_STAT(exit_pei) },