diff options
author | Dor Laor <dor.laor@qumranet.com> | 2007-02-12 03:54:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:40 -0500 |
commit | 54810342f1372afdaf6cb9a6aea0c35df187db12 (patch) | |
tree | 97775733e60a5875f88f30c38a69ba278479299a /drivers/kvm/kvm_main.c | |
parent | d92899a0014aa795c21d3cf726ef5ff7684399f4 (diff) |
[PATCH] kvm: Two-way apic tpr synchronization
We report the value of cr8 to userspace on an exit. Also let userspace change
cr8 when we re-enter the guest. The lets 64-bit guest code maintain the tpr
correctly.
Thanks for Yaniv Kamay for the idea.
Signed-off-by: Dor Laor <dor.laor@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/kvm/kvm_main.c')
-rw-r--r-- | drivers/kvm/kvm_main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 099f0afd394d..eb3931ca680a 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -1360,6 +1360,9 @@ static int kvm_dev_ioctl_run(struct kvm *kvm, struct kvm_run *kvm_run) | |||
1360 | if (!vcpu) | 1360 | if (!vcpu) |
1361 | return -ENOENT; | 1361 | return -ENOENT; |
1362 | 1362 | ||
1363 | /* re-sync apic's tpr */ | ||
1364 | vcpu->cr8 = kvm_run->cr8; | ||
1365 | |||
1363 | if (kvm_run->emulated) { | 1366 | if (kvm_run->emulated) { |
1364 | kvm_arch_ops->skip_emulated_instruction(vcpu); | 1367 | kvm_arch_ops->skip_emulated_instruction(vcpu); |
1365 | kvm_run->emulated = 0; | 1368 | kvm_run->emulated = 0; |