diff options
author | Avi Kivity <avi@qumranet.com> | 2007-01-05 16:36:38 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-05 23:55:23 -0800 |
commit | 399badf315bd4dd571b4b3b7cf666d9a2af40229 (patch) | |
tree | 5c84e0392454df650cb4ce25d6bfcb3bac843bc3 /drivers/kvm/kvm.h | |
parent | cb26b572dc39467ba0969d1a76c2f723d2d6a2a6 (diff) | |
download | linux-399badf315bd4dd571b4b3b7cf666d9a2af40229.tar.gz linux-399badf315bd4dd571b4b3b7cf666d9a2af40229.tar.bz2 linux-399badf315bd4dd571b4b3b7cf666d9a2af40229.zip |
[PATCH] KVM: Prevent stale bits in cr0 and cr4
Hardware virtualization implementations allow the guests to freely change some
of the bits in cr0 and cr4, but trap when changing the other bits. This is
useful to avoid excessive exits due to changing, for example, the ts flag.
It also means the kvm's copy of cr0 and cr4 may be stale with respect to these
bits. most of the time this doesn't matter as these bits are not very
interesting. Other times, however (for example when returning cr0 to
userspace), they are, so get the fresh contents of these bits from the guest
by means of a new arch operation.
Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r-- | drivers/kvm/kvm.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index 32023d1ac24b..e8fe1039e3b5 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h @@ -283,6 +283,7 @@ struct kvm_arch_ops { void (*set_segment)(struct kvm_vcpu *vcpu, struct kvm_segment *var, int seg); void (*get_cs_db_l_bits)(struct kvm_vcpu *vcpu, int *db, int *l); + void (*decache_cr0_cr4_guest_bits)(struct kvm_vcpu *vcpu); void (*set_cr0)(struct kvm_vcpu *vcpu, unsigned long cr0); void (*set_cr0_no_modeswitch)(struct kvm_vcpu *vcpu, unsigned long cr0); |