KVM: SVM: Fix tsc offset adjustment when running nested
commit89cc56416e963a723b568157e53fa4c796ffefa5
authorJoerg Roedel <joerg.roedel@amd.com>
Mon, 12 Oct 2009 09:41:51 +0000 (12 11:41 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 12 Oct 2009 19:40:18 +0000 (12 12:40 -0700)
tree500fd703a27241c4a022422c24564d11b351851c
parentddf2acb72f3df470ce15eb23ee97cd3be23016f8
KVM: SVM: Fix tsc offset adjustment when running nested

commit 77b1ab1732feb5e3dcbaf31d2f7547c5229f5f3a upstream.

When svm_vcpu_load is called while the vcpu is running in
guest mode the tsc adjustment made there is lost on the next
emulated #vmexit. This causes the tsc running backwards in
the guest. This patch fixes the issue by also adjusting the
tsc_offset in the emulated hsave area so that it will not
get lost.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kvm/svm.c