This is a note to let you know that I've just added the patch titled
KVM: x86: Fix kvmclock bug
to the 2.6.32-longterm tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/longterm/longterm-queue-2.6.32.git;a=summary
The filename of the patch is:
0003-KVM-x86-Fix-kvmclock-bug.patch
and it can be found in the queue-2.6.32 subdirectory.
If you, or anyone else, feels it should not be added to the 2.6.32 longterm
tree,
please let <[email protected]> know about it.
>From [email protected] Thu May 5 16:09:43 2011
From: Marcelo Tosatti <[email protected]>
Date: Wed, 04 May 2011 09:31:29 -0300
Subject: KVM: x86: Fix kvmclock bug
To: [email protected]
Cc: "Serge E. Hallyn" <[email protected]>, Zachary Amsden
<[email protected]>, Marcelo Tosatti <[email protected]>, [email protected],
[email protected]
Message-ID: <[email protected]>
Content-Disposition: inline; filename=0003-KVM-x86-Fix-kvmclock-bug.patch
From: Zachary Amsden <[email protected]>
(backported from commit 28e4639adf0c9f26f6bb56149b7ab547bf33bb95)
If preempted after kvmclock values are updated, but before hardware
virtualization is entered, the last tsc time as read by the guest is
never set. It underflows the next time kvmclock is updated if there
has not yet been a successful entry / exit into hardware virt.
Fix this by simply setting last_tsc to the newly read tsc value so
that any computed nsec advance of kvmclock is nulled.
Signed-off-by: Zachary Amsden <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>
BugLink: http://bugs.launchpad.net/bugs/714335
Signed-off-by: Serge E. Hallyn <[email protected]>
Reviewed-by: Stefan Bader <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
arch/x86/kvm/x86.c | 1 +
1 file changed, 1 insertion(+)
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -694,6 +694,7 @@ static void kvm_write_guest_time(struct
vcpu->hv_clock.tsc_timestamp = tsc_timestamp;
vcpu->hv_clock.system_time = kernel_ns + v->kvm->arch.kvmclock_offset;
vcpu->last_kernel_ns = kernel_ns;
+ vcpu->last_guest_tsc = tsc_timestamp;
/*
* The interface expects us to write an even number signaling that the
Patches currently in longterm-queue-2.6.32 which might be from
[email protected] are
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/0003-KVM-x86-Fix-kvmclock-bug.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/0001-x86-pvclock-Move-scale_delta-into-common-header.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/kvm-x86-fix-a-possible-backwards-warp-of-kvmclock.patch
_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable