]> git.hungrycats.org Git - linux/commit
KVM: x86: move steal time initialization to vcpu entry time
authorMarcelo Tosatti <mtosatti@redhat.com>
Wed, 14 Oct 2015 22:33:09 +0000 (19:33 -0300)
committerZefan Li <lizefan@huawei.com>
Mon, 21 Mar 2016 01:17:59 +0000 (09:17 +0800)
commit6d470d7cebd87e956e255b242d6c7f4a7d5b62b5
treee1e34641c2148f22788d07eb51a977c05269ac85
parent24fa51bde52b3671afa476c96d63bcf8a4e8a307
KVM: x86: move steal time initialization to vcpu entry time

commit 7cae2bedcbd4680b155999655e49c27b9cf020fa upstream.

As reported at https://bugs.launchpad.net/qemu/+bug/1494350,
it is possible to have vcpu->arch.st.last_steal initialized
from a thread other than vcpu thread, say the iothread, via
KVM_SET_MSRS.

Which can cause an overflow later (when subtracting from vcpu threads
sched_info.run_delay).

To avoid that, move steal time accumulation to vcpu entry time,
before copying steal time data to guest.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Reviewed-by: David Matlack <dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Zefan Li <lizefan@huawei.com>
arch/x86/kvm/x86.c