diff options
author | Avi Kivity <avi@qumranet.com> | 2007-06-14 16:27:40 +0300 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-06-15 12:30:59 +0300 |
commit | 7702fd1f6fea57921f2e643d27a23a2d0394499c (patch) | |
tree | 9a5275fb2f5eaccc491bfe5d9617c3da7f69aa5a /drivers/kvm/kvm.h | |
parent | 22b1a9203ea634ac0ee5240e021613da3328275f (diff) | |
download | op-kernel-dev-7702fd1f6fea57921f2e643d27a23a2d0394499c.zip op-kernel-dev-7702fd1f6fea57921f2e643d27a23a2d0394499c.tar.gz |
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 1c040d8..152312c 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h @@ -304,6 +304,7 @@ struct kvm_vcpu { char *host_fx_image; char *guest_fx_image; int fpu_active; + int guest_fpu_loaded; int mmio_needed; int mmio_read_completed; @@ -508,6 +509,8 @@ void fx_init(struct kvm_vcpu *vcpu); void load_msrs(struct vmx_msr_entry *e, int n); void save_msrs(struct vmx_msr_entry *e, int n); void kvm_resched(struct kvm_vcpu *vcpu); +void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); +void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); int kvm_read_guest(struct kvm_vcpu *vcpu, gva_t addr, |