diff options
author | Dongxiao Xu <dongxiao.xu@intel.com> | 2010-05-11 06:29:42 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-08-01 03:35:42 -0400 |
commit | 92fe13be74303a7b80dc3c99e22e12a87d41bd5f (patch) | |
tree | 0861769205fb4c1ca4ce6adb40daf9aedbb65d15 /arch/x86/kvm/vmx.c | |
parent | 7725b89414836df492d6222b1d3cacb0ca576d77 (diff) |
KVM: VMX: Some minor changes to code structure
Do some preparations for vmm coexistence support.
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r-- | arch/x86/kvm/vmx.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 823288821444..0d281dbc008f 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -845,15 +845,8 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu) | |||
845 | struct vcpu_vmx *vmx = to_vmx(vcpu); | 845 | struct vcpu_vmx *vmx = to_vmx(vcpu); |
846 | u64 tsc_this, delta, new_offset; | 846 | u64 tsc_this, delta, new_offset; |
847 | 847 | ||
848 | if (vcpu->cpu != cpu) { | 848 | if (vcpu->cpu != cpu) |
849 | vcpu_clear(vmx); | 849 | vcpu_clear(vmx); |
850 | kvm_migrate_timers(vcpu); | ||
851 | set_bit(KVM_REQ_TLB_FLUSH, &vcpu->requests); | ||
852 | local_irq_disable(); | ||
853 | list_add(&vmx->local_vcpus_link, | ||
854 | &per_cpu(vcpus_on_cpu, cpu)); | ||
855 | local_irq_enable(); | ||
856 | } | ||
857 | 850 | ||
858 | if (per_cpu(current_vmcs, cpu) != vmx->vmcs) { | 851 | if (per_cpu(current_vmcs, cpu) != vmx->vmcs) { |
859 | per_cpu(current_vmcs, cpu) = vmx->vmcs; | 852 | per_cpu(current_vmcs, cpu) = vmx->vmcs; |
@@ -864,6 +857,13 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu) | |||
864 | struct desc_ptr dt; | 857 | struct desc_ptr dt; |
865 | unsigned long sysenter_esp; | 858 | unsigned long sysenter_esp; |
866 | 859 | ||
860 | kvm_migrate_timers(vcpu); | ||
861 | set_bit(KVM_REQ_TLB_FLUSH, &vcpu->requests); | ||
862 | local_irq_disable(); | ||
863 | list_add(&vmx->local_vcpus_link, | ||
864 | &per_cpu(vcpus_on_cpu, cpu)); | ||
865 | local_irq_enable(); | ||
866 | |||
867 | vcpu->cpu = cpu; | 867 | vcpu->cpu = cpu; |
868 | /* | 868 | /* |
869 | * Linux uses per-cpu TSS and GDT, so set these when switching | 869 | * Linux uses per-cpu TSS and GDT, so set these when switching |