diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-03-18 09:20:16 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-05-17 05:16:14 -0400 |
commit | 2dafc6c234b6064189405f42e1602e9a0abe5a44 (patch) | |
tree | 43ac5a6ead7a4fad9627d500b9e91a69e8ad7e8b /arch/x86/include/asm/kvm_emulate.h | |
parent | aca06a83071e4e4c9150751db7ea6a46240734fc (diff) |
KVM: x86 emulator: Provide more callbacks for x86 emulator.
Provide get_cached_descriptor(), set_cached_descriptor(),
get_segment_selector(), set_segment_selector(), get_gdt(),
write_std() callbacks.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/include/asm/kvm_emulate.h')
-rw-r--r-- | arch/x86/include/asm/kvm_emulate.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h index 07657258af8f..f901467a18b0 100644 --- a/arch/x86/include/asm/kvm_emulate.h +++ b/arch/x86/include/asm/kvm_emulate.h | |||
@@ -63,6 +63,15 @@ struct x86_emulate_ops { | |||
63 | unsigned int bytes, struct kvm_vcpu *vcpu, u32 *error); | 63 | unsigned int bytes, struct kvm_vcpu *vcpu, u32 *error); |
64 | 64 | ||
65 | /* | 65 | /* |
66 | * write_std: Write bytes of standard (non-emulated/special) memory. | ||
67 | * Used for descriptor writing. | ||
68 | * @addr: [IN ] Linear address to which to write. | ||
69 | * @val: [OUT] Value write to memory, zero-extended to 'u_long'. | ||
70 | * @bytes: [IN ] Number of bytes to write to memory. | ||
71 | */ | ||
72 | int (*write_std)(unsigned long addr, void *val, | ||
73 | unsigned int bytes, struct kvm_vcpu *vcpu, u32 *error); | ||
74 | /* | ||
66 | * fetch: Read bytes of standard (non-emulated/special) memory. | 75 | * fetch: Read bytes of standard (non-emulated/special) memory. |
67 | * Used for instruction fetch. | 76 | * Used for instruction fetch. |
68 | * @addr: [IN ] Linear address from which to read. | 77 | * @addr: [IN ] Linear address from which to read. |
@@ -108,6 +117,13 @@ struct x86_emulate_ops { | |||
108 | const void *new, | 117 | const void *new, |
109 | unsigned int bytes, | 118 | unsigned int bytes, |
110 | struct kvm_vcpu *vcpu); | 119 | struct kvm_vcpu *vcpu); |
120 | bool (*get_cached_descriptor)(struct desc_struct *desc, | ||
121 | int seg, struct kvm_vcpu *vcpu); | ||
122 | void (*set_cached_descriptor)(struct desc_struct *desc, | ||
123 | int seg, struct kvm_vcpu *vcpu); | ||
124 | u16 (*get_segment_selector)(int seg, struct kvm_vcpu *vcpu); | ||
125 | void (*set_segment_selector)(u16 sel, int seg, struct kvm_vcpu *vcpu); | ||
126 | void (*get_gdt)(struct desc_ptr *dt, struct kvm_vcpu *vcpu); | ||
111 | ulong (*get_cr)(int cr, struct kvm_vcpu *vcpu); | 127 | ulong (*get_cr)(int cr, struct kvm_vcpu *vcpu); |
112 | void (*set_cr)(int cr, ulong val, struct kvm_vcpu *vcpu); | 128 | void (*set_cr)(int cr, ulong val, struct kvm_vcpu *vcpu); |
113 | int (*cpl)(struct kvm_vcpu *vcpu); | 129 | int (*cpl)(struct kvm_vcpu *vcpu); |