aboutsummaryrefslogtreecommitdiff
path: root/drivers/kvm/kvm.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-06-14 16:27:40 +0300
committerAvi Kivity <avi@qumranet.com>2007-06-15 12:30:59 +0300
commit7702fd1f6fea57921f2e643d27a23a2d0394499c (patch)
tree9a5275fb2f5eaccc491bfe5d9617c3da7f69aa5a /drivers/kvm/kvm.h
parent22b1a9203ea634ac0ee5240e021613da3328275f (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.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 1c040d80c64..152312c1faf 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,