diff options
author | Avi Kivity <avi@qumranet.com> | 2007-06-14 09:27:40 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-06-15 05:30:59 -0400 |
commit | 7702fd1f6fea57921f2e643d27a23a2d0394499c (patch) | |
tree | 9a5275fb2f5eaccc491bfe5d9617c3da7f69aa5a /drivers/kvm/kvm.h | |
parent | 22b1a9203ea634ac0ee5240e021613da3328275f (diff) |
KVM: Prevent guest fpu state from leaking into the host
The lazy fpu changes did not take into account that some vmexit handlers
can sleep. Move loading the guest state into the inner loop so that it
can be reloaded if necessary, and move loading the host state into
vmx_vcpu_put() so it can be performed whenever we relinquish the vcpu.
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r-- | drivers/kvm/kvm.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index 1c040d80c641..152312c1fafa 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h | |||
@@ -304,6 +304,7 @@ struct kvm_vcpu { | |||
304 | char *host_fx_image; | 304 | char *host_fx_image; |
305 | char *guest_fx_image; | 305 | char *guest_fx_image; |
306 | int fpu_active; | 306 | int fpu_active; |
307 | int guest_fpu_loaded; | ||
307 | 308 | ||
308 | int mmio_needed; | 309 | int mmio_needed; |
309 | int mmio_read_completed; | 310 | int mmio_read_completed; |
@@ -508,6 +509,8 @@ void fx_init(struct kvm_vcpu *vcpu); | |||
508 | void load_msrs(struct vmx_msr_entry *e, int n); | 509 | void load_msrs(struct vmx_msr_entry *e, int n); |
509 | void save_msrs(struct vmx_msr_entry *e, int n); | 510 | void save_msrs(struct vmx_msr_entry *e, int n); |
510 | void kvm_resched(struct kvm_vcpu *vcpu); | 511 | void kvm_resched(struct kvm_vcpu *vcpu); |
512 | void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); | ||
513 | void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); | ||
511 | 514 | ||
512 | int kvm_read_guest(struct kvm_vcpu *vcpu, | 515 | int kvm_read_guest(struct kvm_vcpu *vcpu, |
513 | gva_t addr, | 516 | gva_t addr, |