Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2)  * This file is subject to the terms and conditions of the GNU General Public
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  * License.  See the file "COPYING" in the main directory of this archive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  * for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  * KVM/MIPS: COP0 access histogram
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8)  * Copyright (C) 2012  MIPS Technologies, Inc.  All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9)  * Authors: Sanjay Lal <sanjayl@kymasys.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/kvm_host.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) char *kvm_cop0_str[N_MIPS_COPROC_REGS] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) 	"Index",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) 	"Random",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) 	"EntryLo0",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) 	"EntryLo1",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) 	"Context",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 	"PG Mask",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 	"Wired",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 	"HWREna",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 	"BadVAddr",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 	"Count",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 	"EntryHI",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 	"Compare",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 	"Status",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 	"Cause",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 	"EXC PC",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 	"PRID",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 	"Config",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 	"LLAddr",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 	"Watch Lo",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 	"Watch Hi",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 	"X Context",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 	"Reserved",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 	"Impl Dep",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 	"Debug",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 	"DEPC",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 	"PerfCnt",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 	"ErrCtl",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 	"CacheErr",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 	"TagLo",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 	"TagHi",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 	"ErrorEPC",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 	"DESAVE"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) void kvm_mips_dump_stats(struct kvm_vcpu *vcpu)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) #ifdef CONFIG_KVM_MIPS_DEBUG_COP0_COUNTERS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 	int i, j;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 	kvm_info("\nKVM VCPU[%d] COP0 Access Profile:\n", vcpu->vcpu_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 	for (i = 0; i < N_MIPS_COPROC_REGS; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 		for (j = 0; j < N_MIPS_COPROC_SEL; j++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 			if (vcpu->arch.cop0->stat[i][j])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 				kvm_info("%s[%d]: %lu\n", kvm_cop0_str[i], j,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 					 vcpu->arch.cop0->stat[i][j]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) }