diff options
author | Avi Kivity <avi@qumranet.com> | 2007-11-25 06:41:11 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:53:18 -0500 |
commit | 298101da2f507c13eaf179ee4507a7c0fe3e7b06 (patch) | |
tree | 2c0808964e5bc04812f0379b945fb187aaf901eb /drivers/kvm/x86.h | |
parent | 4bf8ed8dd2781a5e7603a83f8ee1d4f5aa04ebc4 (diff) |
KVM: Generalize exception injection mechanism
Instead of each subarch doing its own thing, add an API for queuing an
injection, and manage failed exception injection centerally (i.e., if
an inject failed due to a shadow page fault, we need to requeue it).
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/x86.h')
-rw-r--r-- | drivers/kvm/x86.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/kvm/x86.h b/drivers/kvm/x86.h index eed796402e3b..1e71668694ea 100644 --- a/drivers/kvm/x86.h +++ b/drivers/kvm/x86.h | |||
@@ -139,6 +139,13 @@ struct kvm_vcpu { | |||
139 | struct kvm_pio_request pio; | 139 | struct kvm_pio_request pio; |
140 | void *pio_data; | 140 | void *pio_data; |
141 | 141 | ||
142 | struct kvm_queued_exception { | ||
143 | bool pending; | ||
144 | bool has_error_code; | ||
145 | u8 nr; | ||
146 | u32 error_code; | ||
147 | } exception; | ||
148 | |||
142 | struct { | 149 | struct { |
143 | int active; | 150 | int active; |
144 | u8 save_iopl; | 151 | u8 save_iopl; |
@@ -224,6 +231,9 @@ struct kvm_x86_ops { | |||
224 | unsigned char *hypercall_addr); | 231 | unsigned char *hypercall_addr); |
225 | int (*get_irq)(struct kvm_vcpu *vcpu); | 232 | int (*get_irq)(struct kvm_vcpu *vcpu); |
226 | void (*set_irq)(struct kvm_vcpu *vcpu, int vec); | 233 | void (*set_irq)(struct kvm_vcpu *vcpu, int vec); |
234 | void (*queue_exception)(struct kvm_vcpu *vcpu, unsigned nr, | ||
235 | bool has_error_code, u32 error_code); | ||
236 | bool (*exception_injected)(struct kvm_vcpu *vcpu); | ||
227 | void (*inject_pending_irq)(struct kvm_vcpu *vcpu); | 237 | void (*inject_pending_irq)(struct kvm_vcpu *vcpu); |
228 | void (*inject_pending_vectors)(struct kvm_vcpu *vcpu, | 238 | void (*inject_pending_vectors)(struct kvm_vcpu *vcpu, |
229 | struct kvm_run *run); | 239 | struct kvm_run *run); |
@@ -294,6 +304,9 @@ void kvm_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l); | |||
294 | int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata); | 304 | int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata); |
295 | int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data); | 305 | int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data); |
296 | 306 | ||
307 | void kvm_queue_exception(struct kvm_vcpu *vcpu, unsigned nr); | ||
308 | void kvm_queue_exception_e(struct kvm_vcpu *vcpu, unsigned nr, u32 error_code); | ||
309 | |||
297 | void fx_init(struct kvm_vcpu *vcpu); | 310 | void fx_init(struct kvm_vcpu *vcpu); |
298 | 311 | ||
299 | int emulator_read_std(unsigned long addr, | 312 | int emulator_read_std(unsigned long addr, |