]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: Additional TSC-offset handling
authorNadav Har'El <nyh@il.ibm.com>
Wed, 25 May 2011 20:15:39 +0000 (23:15 +0300)
committerAvi Kivity <avi@redhat.com>
Tue, 12 Jul 2011 08:45:19 +0000 (11:45 +0300)
commit59500507efb9248a8653ea0090efa01109c94f1c
tree6d9a09a6175a3f607737680525ba9486ac95dbab
parent85a04f988e372e493385aa5960887ad528cd9b3e
KVM: nVMX: Additional TSC-offset handling

In the unlikely case that L1 does not capture MSR_IA32_TSC, L0 needs to
emulate this MSR write by L2 by modifying vmcs02.tsc_offset. We also need to
set vmcs12.tsc_offset, for this change to survive the next nested entry (see
prepare_vmcs02()).
Additionally, we also need to modify vmx_adjust_tsc_offset: The semantics
of this function is that the TSC of all guests on this vcpu, L1 and possibly
several L2s, need to be adjusted. To do this, we need to adjust vmcs01's
tsc_offset (this offset will also apply to each L2s we enter). We can't set
vmcs01 now, so we have to remember this adjustment and apply it when we
later exit to L1.

Signed-off-by: Nadav Har'El <nyh@il.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/vmx.c