Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103761
b: refs/heads/master
c: 597a5f5
h: refs/heads/master
i:
  103759: 73885bb
v: v3
  • Loading branch information
Avi Kivity committed Jul 20, 2008
1 parent 8dcf302 commit 0f81745
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 722c05f2192070bac0208b2c16ce13929b32d92f
refs/heads/master: 597a5f551ec4cd0aa0966e4fff4684ecc8c31c0d
18 changes: 12 additions & 6 deletions trunk/virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,11 @@ static void ack_flush(void *_completed)

void kvm_flush_remote_tlbs(struct kvm *kvm)
{
int i, cpu;
int i, cpu, me;
cpumask_t cpus;
struct kvm_vcpu *vcpu;

me = get_cpu();
cpus_clear(cpus);
for (i = 0; i < KVM_MAX_VCPUS; ++i) {
vcpu = kvm->vcpus[i];
Expand All @@ -117,21 +118,24 @@ void kvm_flush_remote_tlbs(struct kvm *kvm)
if (test_and_set_bit(KVM_REQ_TLB_FLUSH, &vcpu->requests))
continue;
cpu = vcpu->cpu;
if (cpu != -1 && cpu != raw_smp_processor_id())
if (cpu != -1 && cpu != me)
cpu_set(cpu, cpus);
}
if (cpus_empty(cpus))
return;
goto out;
++kvm->stat.remote_tlb_flush;
smp_call_function_mask(cpus, ack_flush, NULL, 1);
out:
put_cpu();
}

void kvm_reload_remote_mmus(struct kvm *kvm)
{
int i, cpu;
int i, cpu, me;
cpumask_t cpus;
struct kvm_vcpu *vcpu;

me = get_cpu();
cpus_clear(cpus);
for (i = 0; i < KVM_MAX_VCPUS; ++i) {
vcpu = kvm->vcpus[i];
Expand All @@ -140,12 +144,14 @@ void kvm_reload_remote_mmus(struct kvm *kvm)
if (test_and_set_bit(KVM_REQ_MMU_RELOAD, &vcpu->requests))
continue;
cpu = vcpu->cpu;
if (cpu != -1 && cpu != raw_smp_processor_id())
if (cpu != -1 && cpu != me)
cpu_set(cpu, cpus);
}
if (cpus_empty(cpus))
return;
goto out;
smp_call_function_mask(cpus, ack_flush, NULL, 1);
out:
put_cpu();
}


Expand Down

0 comments on commit 0f81745

Please sign in to comment.