c2537ed9fb
Add guest exception handling for MIPS SIMD Architecture (MSA) floating point exceptions and MSA disabled exceptions. MSA floating point exceptions from the guest need passing to the guest kernel, so for these a guest MSAFPE is emulated. MSA disabled exceptions are normally handled by passing a reserved instruction exception to the guest (because no guest MSA was supported), but the hypervisor can now handle them if the guest has MSA by passing an MSA disabled exception to the guest, or if the guest has MSA enabled by transparently restoring the guest MSA context and enabling MSA and the FPU. Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Paul Burton <paul.burton@imgtec.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Gleb Natapov <gleb@kernel.org> Cc: linux-mips@linux-mips.org Cc: kvm@vger.kernel.org
84 lines
1.5 KiB
C
84 lines
1.5 KiB
C
/*
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
* for more details.
|
|
*
|
|
* KVM/MIPS: COP0 access histogram
|
|
*
|
|
* Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
|
|
* Authors: Sanjay Lal <sanjayl@kymasys.com>
|
|
*/
|
|
|
|
#include <linux/kvm_host.h>
|
|
|
|
char *kvm_mips_exit_types_str[MAX_KVM_MIPS_EXIT_TYPES] = {
|
|
"WAIT",
|
|
"CACHE",
|
|
"Signal",
|
|
"Interrupt",
|
|
"COP0/1 Unusable",
|
|
"TLB Mod",
|
|
"TLB Miss (LD)",
|
|
"TLB Miss (ST)",
|
|
"Address Err (ST)",
|
|
"Address Error (LD)",
|
|
"System Call",
|
|
"Reserved Inst",
|
|
"Break Inst",
|
|
"Trap Inst",
|
|
"MSA FPE",
|
|
"FPE",
|
|
"MSA Disabled",
|
|
"D-Cache Flushes",
|
|
};
|
|
|
|
char *kvm_cop0_str[N_MIPS_COPROC_REGS] = {
|
|
"Index",
|
|
"Random",
|
|
"EntryLo0",
|
|
"EntryLo1",
|
|
"Context",
|
|
"PG Mask",
|
|
"Wired",
|
|
"HWREna",
|
|
"BadVAddr",
|
|
"Count",
|
|
"EntryHI",
|
|
"Compare",
|
|
"Status",
|
|
"Cause",
|
|
"EXC PC",
|
|
"PRID",
|
|
"Config",
|
|
"LLAddr",
|
|
"Watch Lo",
|
|
"Watch Hi",
|
|
"X Context",
|
|
"Reserved",
|
|
"Impl Dep",
|
|
"Debug",
|
|
"DEPC",
|
|
"PerfCnt",
|
|
"ErrCtl",
|
|
"CacheErr",
|
|
"TagLo",
|
|
"TagHi",
|
|
"ErrorEPC",
|
|
"DESAVE"
|
|
};
|
|
|
|
void kvm_mips_dump_stats(struct kvm_vcpu *vcpu)
|
|
{
|
|
#ifdef CONFIG_KVM_MIPS_DEBUG_COP0_COUNTERS
|
|
int i, j;
|
|
|
|
kvm_info("\nKVM VCPU[%d] COP0 Access Profile:\n", vcpu->vcpu_id);
|
|
for (i = 0; i < N_MIPS_COPROC_REGS; i++) {
|
|
for (j = 0; j < N_MIPS_COPROC_SEL; j++) {
|
|
if (vcpu->arch.cop0->stat[i][j])
|
|
kvm_info("%s[%d]: %lu\n", kvm_cop0_str[i], j,
|
|
vcpu->arch.cop0->stat[i][j]);
|
|
}
|
|
}
|
|
#endif
|
|
}
|