Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=54810342f1372afdaf6cb9a6aea0c35df187db12
Commit:     54810342f1372afdaf6cb9a6aea0c35df187db12
Parent:     d92899a0014aa795c21d3cf726ef5ff7684399f4
Author:     Dor Laor <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 12 00:54:39 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Feb 12 09:48:40 2007 -0800

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
    Cc: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm_main.c |    3 +++
 include/linux/kvm.h    |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 099f0af..eb3931c 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)
        if (!vcpu)
                return -ENOENT;
 
+       /* re-sync apic's tpr */
+       vcpu->cr8 = kvm_run->cr8;
+
        if (kvm_run->emulated) {
                kvm_arch_ops->skip_emulated_instruction(vcpu);
                kvm_run->emulated = 0;
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 1be148f..6a5f6f4 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -65,6 +65,8 @@ struct kvm_run {
        __u8 ready_for_interrupt_injection;
        __u8 if_flag;
        __u16 padding2;
+
+       /* in (pre_kvm_run), out (post_kvm_run) */
        __u64 cr8;
        __u64 apic_base;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to