aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm
diff options
context:
space:
mode:
Diffstat (limited to 'virt/kvm')
-rw-r--r--virt/kvm/kvm_main.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index cf6df5167af6..c41eb57ce29b 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -119,6 +119,29 @@ void kvm_flush_remote_tlbs(struct kvm *kvm)
119 smp_call_function_mask(cpus, ack_flush, NULL, 1); 119 smp_call_function_mask(cpus, ack_flush, NULL, 1);
120} 120}
121 121
122void kvm_reload_remote_mmus(struct kvm *kvm)
123{
124 int i, cpu;
125 cpumask_t cpus;
126 struct kvm_vcpu *vcpu;
127
128 cpus_clear(cpus);
129 for (i = 0; i < KVM_MAX_VCPUS; ++i) {
130 vcpu = kvm->vcpus[i];
131 if (!vcpu)
132 continue;
133 if (test_and_set_bit(KVM_REQ_MMU_RELOAD, &vcpu->requests))
134 continue;
135 cpu = vcpu->cpu;
136 if (cpu != -1 && cpu != raw_smp_processor_id())
137 cpu_set(cpu, cpus);
138 }
139 if (cpus_empty(cpus))
140 return;
141 smp_call_function_mask(cpus, ack_flush, NULL, 1);
142}
143
144
122int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id) 145int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id)
123{ 146{
124 struct page *page; 147 struct page *page;