KVM: Migrate lapic hrtimer when vcpu moves to another cpu
This reduces overhead by accessing cachelines from the wrong node, as well as simplifying locking. [Qing: fix for inactive or expired one-shot timer] Signed-off-by: Yaozu (Eddie) Dong <Eddie.Dong@intel.com> Signed-off-by: Qing He <qing.he@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
This commit is contained in:
@@ -441,8 +441,10 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
|
||||
u64 phys_addr = __pa(vmx->vmcs);
|
||||
u64 tsc_this, delta;
|
||||
|
||||
if (vcpu->cpu != cpu)
|
||||
if (vcpu->cpu != cpu) {
|
||||
vcpu_clear(vmx);
|
||||
kvm_migrate_apic_timer(vcpu);
|
||||
}
|
||||
|
||||
if (per_cpu(current_vmcs, cpu) != vmx->vmcs) {
|
||||
u8 error;
|
||||
|
Reference in New Issue
Block a user