MIPS: KVM: Add FP exception handling
[linux-2.6-block.git] / arch / mips / kvm / stats.c
CommitLineData
3c20ef52 1/*
d116e812
DCZ
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * KVM/MIPS: COP0 access histogram
7 *
8 * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
9 * Authors: Sanjay Lal <sanjayl@kymasys.com>
10 */
3c20ef52
SL
11
12#include <linux/kvm_host.h>
13
14char *kvm_mips_exit_types_str[MAX_KVM_MIPS_EXIT_TYPES] = {
15 "WAIT",
16 "CACHE",
17 "Signal",
18 "Interrupt",
19 "COP0/1 Unusable",
20 "TLB Mod",
21 "TLB Miss (LD)",
22 "TLB Miss (ST)",
23 "Address Err (ST)",
24 "Address Error (LD)",
25 "System Call",
26 "Reserved Inst",
27 "Break Inst",
0a560427 28 "Trap Inst",
1c0cd66a 29 "FPE",
3c20ef52
SL
30 "D-Cache Flushes",
31};
32
33char *kvm_cop0_str[N_MIPS_COPROC_REGS] = {
34 "Index",
35 "Random",
36 "EntryLo0",
37 "EntryLo1",
38 "Context",
39 "PG Mask",
40 "Wired",
41 "HWREna",
42 "BadVAddr",
43 "Count",
44 "EntryHI",
45 "Compare",
46 "Status",
47 "Cause",
48 "EXC PC",
49 "PRID",
50 "Config",
51 "LLAddr",
52 "Watch Lo",
53 "Watch Hi",
54 "X Context",
55 "Reserved",
56 "Impl Dep",
57 "Debug",
58 "DEPC",
59 "PerfCnt",
60 "ErrCtl",
61 "CacheErr",
62 "TagLo",
63 "TagHi",
64 "ErrorEPC",
65 "DESAVE"
66};
67
d98403a5 68void kvm_mips_dump_stats(struct kvm_vcpu *vcpu)
3c20ef52
SL
69{
70#ifdef CONFIG_KVM_MIPS_DEBUG_COP0_COUNTERS
71 int i, j;
72
6ad78a5c 73 kvm_info("\nKVM VCPU[%d] COP0 Access Profile:\n", vcpu->vcpu_id);
3c20ef52
SL
74 for (i = 0; i < N_MIPS_COPROC_REGS; i++) {
75 for (j = 0; j < N_MIPS_COPROC_SEL; j++) {
76 if (vcpu->arch.cop0->stat[i][j])
6ad78a5c
DCZ
77 kvm_info("%s[%d]: %lu\n", kvm_cop0_str[i], j,
78 vcpu->arch.cop0->stat[i][j]);
3c20ef52
SL
79 }
80 }
81#endif
3c20ef52 82}