1 /*
2 * emulate.h: SVM instruction emulation bits.
3 * Copyright (c) 2005, AMD Corporation.
4 * Copyright (c) 2004, Intel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #ifndef __ASM_X86_HVM_SVM_EMULATE_H__
20 #define __ASM_X86_HVM_SVM_EMULATE_H__
21
22 /* Enumerate some standard instructions that we support */
23 enum instruction_index {
24 INSTR_INVD,
25 INSTR_WBINVD,
26 INSTR_CPUID,
27 INSTR_RDMSR,
28 INSTR_WRMSR,
29 INSTR_VMCALL,
30 INSTR_HLT,
31 INSTR_INT3,
32 INSTR_RDTSC,
33 INSTR_PAUSE,
34 INSTR_XSETBV,
35 INSTR_VMRUN,
36 INSTR_VMLOAD,
37 INSTR_VMSAVE,
38 INSTR_STGI,
39 INSTR_CLGI,
40 INSTR_INVLPGA,
41 INSTR_MAX_COUNT /* Must be last - Number of instructions supported */
42 };
43
44 struct vcpu;
45
46 int __get_instruction_length_from_list(
47 struct vcpu *, const enum instruction_index *, unsigned int list_count);
48
__get_instruction_length(struct vcpu * v,enum instruction_index instr)49 static inline int __get_instruction_length(
50 struct vcpu *v, enum instruction_index instr)
51 {
52 return __get_instruction_length_from_list(v, &instr, 1);
53 }
54
55 #endif /* __ASM_X86_HVM_SVM_EMULATE_H__ */
56
57 /*
58 * Local variables:
59 * mode: C
60 * c-file-style: "BSD"
61 * c-basic-offset: 4
62 * tab-width: 4
63 * indent-tabs-mode: nil
64 * End:
65 */
66