Commit 92fe13be authored by Dongxiao Xu's avatar Dongxiao Xu Committed by Avi Kivity

KVM: VMX: Some minor changes to code structure

Do some preparations for vmm coexistence support.
Signed-off-by: default avatarDongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent 7725b894
...@@ -845,15 +845,8 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu) ...@@ -845,15 +845,8 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
struct vcpu_vmx *vmx = to_vmx(vcpu); struct vcpu_vmx *vmx = to_vmx(vcpu);
u64 tsc_this, delta, new_offset; u64 tsc_this, delta, new_offset;
if (vcpu->cpu != cpu) { if (vcpu->cpu != cpu)
vcpu_clear(vmx); vcpu_clear(vmx);
kvm_migrate_timers(vcpu);
set_bit(KVM_REQ_TLB_FLUSH, &vcpu->requests);
local_irq_disable();
list_add(&vmx->local_vcpus_link,
&per_cpu(vcpus_on_cpu, cpu));
local_irq_enable();
}
if (per_cpu(current_vmcs, cpu) != vmx->vmcs) { if (per_cpu(current_vmcs, cpu) != vmx->vmcs) {
per_cpu(current_vmcs, cpu) = vmx->vmcs; per_cpu(current_vmcs, cpu) = vmx->vmcs;
...@@ -864,6 +857,13 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu) ...@@ -864,6 +857,13 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
struct desc_ptr dt; struct desc_ptr dt;
unsigned long sysenter_esp; unsigned long sysenter_esp;
kvm_migrate_timers(vcpu);
set_bit(KVM_REQ_TLB_FLUSH, &vcpu->requests);
local_irq_disable();
list_add(&vmx->local_vcpus_link,
&per_cpu(vcpus_on_cpu, cpu));
local_irq_enable();
vcpu->cpu = cpu; vcpu->cpu = cpu;
/* /*
* Linux uses per-cpu TSS and GDT, so set these when switching * Linux uses per-cpu TSS and GDT, so set these when switching
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment