Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * This file is subject to the terms and conditions of the GNU General Public
0003  * License.  See the file "COPYING" in the main directory of this archive
0004  * for more details.
0005  *
0006  * KVM/MIPS: COP0 access histogram
0007  *
0008  * Copyright (C) 2012  MIPS Technologies, Inc.  All rights reserved.
0009  * Authors: Sanjay Lal <sanjayl@kymasys.com>
0010  */
0011 
0012 #include <linux/kvm_host.h>
0013 
0014 char *kvm_cop0_str[N_MIPS_COPROC_REGS] = {
0015     "Index",
0016     "Random",
0017     "EntryLo0",
0018     "EntryLo1",
0019     "Context",
0020     "PG Mask",
0021     "Wired",
0022     "HWREna",
0023     "BadVAddr",
0024     "Count",
0025     "EntryHI",
0026     "Compare",
0027     "Status",
0028     "Cause",
0029     "EXC PC",
0030     "PRID",
0031     "Config",
0032     "LLAddr",
0033     "Watch Lo",
0034     "Watch Hi",
0035     "X Context",
0036     "Reserved",
0037     "Impl Dep",
0038     "Debug",
0039     "DEPC",
0040     "PerfCnt",
0041     "ErrCtl",
0042     "CacheErr",
0043     "TagLo",
0044     "TagHi",
0045     "ErrorEPC",
0046     "DESAVE"
0047 };
0048 
0049 void kvm_mips_dump_stats(struct kvm_vcpu *vcpu)
0050 {
0051 #ifdef CONFIG_KVM_MIPS_DEBUG_COP0_COUNTERS
0052     int i, j;
0053 
0054     kvm_info("\nKVM VCPU[%d] COP0 Access Profile:\n", vcpu->vcpu_id);
0055     for (i = 0; i < N_MIPS_COPROC_REGS; i++) {
0056         for (j = 0; j < N_MIPS_COPROC_SEL; j++) {
0057             if (vcpu->arch.cop0->stat[i][j])
0058                 kvm_info("%s[%d]: %lu\n", kvm_cop0_str[i], j,
0059                      vcpu->arch.cop0->stat[i][j]);
0060         }
0061     }
0062 #endif
0063 }