]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] KVM: Prevent stale bits in cr0 and cr4
authorAvi Kivity <avi@qumranet.com>
Sat, 6 Jan 2007 00:36:38 +0000 (16:36 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Sat, 6 Jan 2007 07:55:23 +0000 (23:55 -0800)
commit45e901536d44fed8da19d43ac5bfb474f438df36
tree5c84e0392454df650cb4ce25d6bfcb3bac843bc3
parent7b6e6df666d9f2c6ca700a27be03fd823abef2fe
[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>
drivers/kvm/kvm.h
drivers/kvm/kvm_main.c
drivers/kvm/svm.c
drivers/kvm/vmx.c