debuggers.hg

view xen/include/asm-x86/hvm/svm/svm.h @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
children 62cf917432fa
line source
1 /*
2 * svm.h: SVM Architecture related definitions
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, write to the Free Software Foundation, Inc., 59 Temple
17 * Place - Suite 330, Boston, MA 02111-1307 USA.
18 *
19 */
21 #ifndef __ASM_X86_HVM_SVM_H__
22 #define __ASM_X86_HVM_SVM_H__
24 #include <xen/sched.h>
25 #include <asm/types.h>
26 #include <asm/regs.h>
27 #include <asm/processor.h>
28 #include <asm/hvm/svm/vmcb.h>
29 #include <asm/i387.h>
31 void svm_dump_vmcb(const char *from, struct vmcb_struct *vmcb);
33 #define SVM_REG_EAX (0)
34 #define SVM_REG_ECX (1)
35 #define SVM_REG_EDX (2)
36 #define SVM_REG_EBX (3)
37 #define SVM_REG_ESP (4)
38 #define SVM_REG_EBP (5)
39 #define SVM_REG_ESI (6)
40 #define SVM_REG_EDI (7)
41 #define SVM_REG_R8 (8)
42 #define SVM_REG_R9 (9)
43 #define SVM_REG_R10 (10)
44 #define SVM_REG_R11 (11)
45 #define SVM_REG_R12 (12)
46 #define SVM_REG_R13 (13)
47 #define SVM_REG_R14 (14)
48 #define SVM_REG_R15 (15)
50 static inline void svm_vmload(void *vmcb)
51 {
52 asm volatile (
53 ".byte 0x0f,0x01,0xda" /* vmload */
54 : : "a" (__pa(vmcb)) : "memory" );
55 }
57 static inline void svm_vmsave(void *vmcb)
58 {
59 asm volatile (
60 ".byte 0x0f,0x01,0xdb" /* vmsave */
61 : : "a" (__pa(vmcb)) : "memory" );
62 }
64 extern u32 svm_feature_flags;
66 #define SVM_FEATURE_NPT 0
67 #define SVM_FEATURE_LBRV 1
68 #define SVM_FEATURE_SVML 2
69 #define SVM_FEATURE_NRIPS 3
71 #define cpu_has_svm_npt test_bit(SVM_FEATURE_NPT, &svm_feature_flags)
72 #define cpu_has_svm_lbrv test_bit(SVM_FEATURE_LBRV, &svm_feature_flags)
73 #define cpu_has_svm_svml test_bit(SVM_FEATURE_SVML, &svm_feature_flags)
74 #define cpu_has_svm_nrips test_bit(SVM_FEATURE_NRIPS, &svm_feature_flags)
76 #endif /* __ASM_X86_HVM_SVM_H__ */