aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/svm.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-07-11 11:17:21 -0400
committerAvi Kivity <avi@qumranet.com>2007-10-13 04:18:20 -0400
commit15ad71460d75fd7ca41bb248a2310f3f39b302ba (patch)
tree1ea549e5c5629561c121a54def146fb6b706c2d4 /drivers/kvm/svm.c
parent519ef35341b4f360f072ea74e398b70a5a2fc270 (diff)
KVM: Use the scheduler preemption notifiers to make kvm preemptible
Current kvm disables preemption while the new virtualization registers are in use. This of course is not very good for latency sensitive workloads (one use of virtualization is to offload user interface and other latency insensitive stuff to a container, so that it is easier to analyze the remaining workload). This patch re-enables preemption for kvm; preemption is now only disabled when switching the registers in and out, and during the switch to guest mode and back. Contains fixes from Shaohua Li <shaohua.li@intel.com>. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r--drivers/kvm/svm.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index 0feec8558599..3997bbd78fb7 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -625,12 +625,11 @@ static void svm_free_vcpu(struct kvm_vcpu *vcpu)
625 kfree(svm); 625 kfree(svm);
626} 626}
627 627
628static void svm_vcpu_load(struct kvm_vcpu *vcpu) 628static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
629{ 629{
630 struct vcpu_svm *svm = to_svm(vcpu); 630 struct vcpu_svm *svm = to_svm(vcpu);
631 int cpu, i; 631 int i;
632 632
633 cpu = get_cpu();
634 if (unlikely(cpu != vcpu->cpu)) { 633 if (unlikely(cpu != vcpu->cpu)) {
635 u64 tsc_this, delta; 634 u64 tsc_this, delta;
636 635
@@ -657,7 +656,6 @@ static void svm_vcpu_put(struct kvm_vcpu *vcpu)
657 wrmsrl(host_save_user_msrs[i], svm->host_user_msrs[i]); 656 wrmsrl(host_save_user_msrs[i], svm->host_user_msrs[i]);
658 657
659 rdtscll(vcpu->host_tsc); 658 rdtscll(vcpu->host_tsc);
660 put_cpu();
661} 659}
662 660
663static void svm_vcpu_decache(struct kvm_vcpu *vcpu) 661static void svm_vcpu_decache(struct kvm_vcpu *vcpu)