Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Move KVM specific opcodes into asm/inst.h

The header arch/mips/kvm/opcode.h defines a few extra opcodes which
aren't in arch/mips/include/uapi/asm/inst.h. There's nothing KVM
specific about them, so lets move them into inst.h where they belong and
delete the header.

Note that mfmcz_op is renamed to mfmc0_op to match the instruction set
manual, and wait_op was already added to inst.h in commit b0a3eae2b943
("MIPS: inst.h: define COP0 wait op"), merged in v3.16-rc1.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/11895/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

James Hogan and committed by
Ralf Baechle
b2c59635 f4956f62

+5 -28
+2 -1
arch/mips/include/uapi/asm/inst.h
··· 116 116 dmtc_op = 0x05, ctc_op = 0x06, 117 117 mthc0_op = 0x06, mthc_op = 0x07, 118 118 bc_op = 0x08, bc1eqz_op = 0x09, 119 - bc1nez_op = 0x0d, cop_op = 0x10, 119 + mfmc0_op = 0x0b, bc1nez_op = 0x0d, 120 + wrpgpr_op = 0x0e, cop_op = 0x10, 120 121 copm_op = 0x18 121 122 }; 122 123
+3 -4
arch/mips/kvm/emulate.c
··· 30 30 #include <asm/r4kcache.h> 31 31 #define CONFIG_MIPS_MT 32 32 33 - #include "opcode.h" 34 33 #include "interrupt.h" 35 34 #include "commpage.h" 36 35 ··· 1239 1240 er = EMULATE_FAIL; 1240 1241 break; 1241 1242 1242 - case mfmcz_op: 1243 + case mfmc0_op: 1243 1244 #ifdef KVM_MIPS_DEBUG_COP0_COUNTERS 1244 1245 cop0->stat[MIPS_CP0_STATUS][0]++; 1245 1246 #endif ··· 1248 1249 kvm_read_c0_guest_status(cop0); 1249 1250 /* EI */ 1250 1251 if (inst & 0x20) { 1251 - kvm_debug("[%#lx] mfmcz_op: EI\n", 1252 + kvm_debug("[%#lx] mfmc0_op: EI\n", 1252 1253 vcpu->arch.pc); 1253 1254 kvm_set_c0_guest_status(cop0, ST0_IE); 1254 1255 } else { 1255 - kvm_debug("[%#lx] mfmcz_op: DI\n", 1256 + kvm_debug("[%#lx] mfmc0_op: DI\n", 1256 1257 vcpu->arch.pc); 1257 1258 kvm_clear_c0_guest_status(cop0, ST0_IE); 1258 1259 }
-22
arch/mips/kvm/opcode.h
··· 1 - /* 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 - * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. 7 - * Authors: Sanjay Lal <sanjayl@kymasys.com> 8 - */ 9 - 10 - /* Define opcode values not defined in <asm/isnt.h> */ 11 - 12 - #ifndef __KVM_MIPS_OPCODE_H__ 13 - #define __KVM_MIPS_OPCODE_H__ 14 - 15 - /* COP0 Ops */ 16 - #define mfmcz_op 0x0b /* 01011 */ 17 - #define wrpgpr_op 0x0e /* 01110 */ 18 - 19 - /* COP0 opcodes (only if COP0 and CO=1): */ 20 - #define wait_op 0x20 /* 100000 */ 21 - 22 - #endif /* __KVM_MIPS_OPCODE_H__ */
-1
arch/mips/kvm/trap_emul.c
··· 16 16 17 17 #include <linux/kvm_host.h> 18 18 19 - #include "opcode.h" 20 19 #include "interrupt.h" 21 20 22 21 static gpa_t kvm_trap_emul_gva_to_gpa_cb(gva_t gva)