KVM: s390: sigp: instruction counters for all sigp orders
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Fri, 23 May 2014 10:25:11 +0000 (12:25 +0200)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Tue, 28 Oct 2014 12:09:13 +0000 (13:09 +0100)
This patch introduces instruction counters for all known sigp orders and also a
separate one for unknown orders that are passed to user space.

Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/include/asm/kvm_host.h
arch/s390/kvm/kvm-s390.c
arch/s390/kvm/sigp.c

index 584b820eeaf8188a938807f478a491f0a6a3a1e2..7e02d77f8ecc8c5846b5572173ff6c479a360cb0 100644 (file)
@@ -226,10 +226,17 @@ struct kvm_vcpu_stat {
        u32 instruction_sigp_sense_running;
        u32 instruction_sigp_external_call;
        u32 instruction_sigp_emergency;
+       u32 instruction_sigp_cond_emergency;
+       u32 instruction_sigp_start;
        u32 instruction_sigp_stop;
+       u32 instruction_sigp_stop_store_status;
+       u32 instruction_sigp_store_status;
        u32 instruction_sigp_arch;
        u32 instruction_sigp_prefix;
        u32 instruction_sigp_restart;
+       u32 instruction_sigp_init_cpu_reset;
+       u32 instruction_sigp_cpu_reset;
+       u32 instruction_sigp_unknown;
        u32 diagnose_10;
        u32 diagnose_44;
        u32 diagnose_9c;
index 3e83d4b357b914df6683818341222c0e65fd0d82..06878bdf0c6b4e6c3cd1dd4e3ebca0a0ecb49a1d 100644 (file)
@@ -81,10 +81,17 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
        { "instruction_sigp_sense_running", VCPU_STAT(instruction_sigp_sense_running) },
        { "instruction_sigp_external_call", VCPU_STAT(instruction_sigp_external_call) },
        { "instruction_sigp_emergency", VCPU_STAT(instruction_sigp_emergency) },
+       { "instruction_sigp_cond_emergency", VCPU_STAT(instruction_sigp_cond_emergency) },
+       { "instruction_sigp_start", VCPU_STAT(instruction_sigp_start) },
        { "instruction_sigp_stop", VCPU_STAT(instruction_sigp_stop) },
+       { "instruction_sigp_stop_store_status", VCPU_STAT(instruction_sigp_stop_store_status) },
+       { "instruction_sigp_store_status", VCPU_STAT(instruction_sigp_store_status) },
        { "instruction_sigp_set_arch", VCPU_STAT(instruction_sigp_arch) },
        { "instruction_sigp_set_prefix", VCPU_STAT(instruction_sigp_prefix) },
        { "instruction_sigp_restart", VCPU_STAT(instruction_sigp_restart) },
+       { "instruction_sigp_cpu_reset", VCPU_STAT(instruction_sigp_cpu_reset) },
+       { "instruction_sigp_init_cpu_reset", VCPU_STAT(instruction_sigp_init_cpu_reset) },
+       { "instruction_sigp_unknown", VCPU_STAT(instruction_sigp_unknown) },
        { "diagnose_10", VCPU_STAT(diagnose_10) },
        { "diagnose_44", VCPU_STAT(diagnose_44) },
        { "diagnose_9c", VCPU_STAT(diagnose_9c) },
index a9e17397305efaf0ded5c034ce11ba720cd5b7d7..9ee63e4d8a248bed3ab43bafb803dcb2f0d33267 100644 (file)
@@ -344,11 +344,12 @@ static int handle_sigp_dst(struct kvm_vcpu *vcpu, u8 order_code,
                rc = __sigp_stop(vcpu, dst_vcpu, ACTION_STOP_ON_STOP);
                break;
        case SIGP_STOP_AND_STORE_STATUS:
-               vcpu->stat.instruction_sigp_stop++;
+               vcpu->stat.instruction_sigp_stop_store_status++;
                rc = __sigp_stop(vcpu, dst_vcpu, ACTION_STORE_ON_STOP |
                                                 ACTION_STOP_ON_STOP);
                break;
        case SIGP_STORE_STATUS_AT_ADDRESS:
+               vcpu->stat.instruction_sigp_store_status++;
                rc = __sigp_store_status_at_addr(vcpu, dst_vcpu, parameter,
                                                 status_reg);
                break;
@@ -357,6 +358,7 @@ static int handle_sigp_dst(struct kvm_vcpu *vcpu, u8 order_code,
                rc = __sigp_set_prefix(vcpu, dst_vcpu, parameter, status_reg);
                break;
        case SIGP_COND_EMERGENCY_SIGNAL:
+               vcpu->stat.instruction_sigp_cond_emergency++;
                rc = __sigp_conditional_emergency(vcpu, dst_vcpu, parameter,
                                                  status_reg);
                break;
@@ -365,6 +367,7 @@ static int handle_sigp_dst(struct kvm_vcpu *vcpu, u8 order_code,
                rc = __sigp_sense_running(vcpu, dst_vcpu, status_reg);
                break;
        case SIGP_START:
+               vcpu->stat.instruction_sigp_start++;
                rc = __prepare_sigp_re_start(vcpu, dst_vcpu, order_code);
                break;
        case SIGP_RESTART:
@@ -372,12 +375,15 @@ static int handle_sigp_dst(struct kvm_vcpu *vcpu, u8 order_code,
                rc = __prepare_sigp_re_start(vcpu, dst_vcpu, order_code);
                break;
        case SIGP_INITIAL_CPU_RESET:
+               vcpu->stat.instruction_sigp_init_cpu_reset++;
                rc = __prepare_sigp_cpu_reset(vcpu, dst_vcpu, order_code);
                break;
        case SIGP_CPU_RESET:
+               vcpu->stat.instruction_sigp_cpu_reset++;
                rc = __prepare_sigp_cpu_reset(vcpu, dst_vcpu, order_code);
                break;
        default:
+               vcpu->stat.instruction_sigp_unknown++;
                rc = __prepare_sigp_unknown(vcpu, dst_vcpu);
        }