From: Glauber Costa <[EMAIL PROTECTED]>

In situations, like, cpu hotplugging, a cpu can arrive
later on the game and register its paravirt clock
while everything else is already running, which will lead to
breakage, since the time readings will return bogus values.

To prevent this, we write system time as soon as the guest
registers its clock

Signed-off-by: Glauber Costa <[EMAIL PROTECTED]>
---
 arch/x86/kvm/x86.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 5dfc21f..03c0c6d 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -595,6 +595,8 @@ int kvm_set_msr_common(struct kvm_vcpu *
 
                if (is_error_page(vcpu->arch.time_page))
                        vcpu->arch.time_page = NULL;
+
+               kvm_write_guest_time(vcpu);
                break;
        }
        default:
-- 
1.4.2


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to