From patchwork Thu Aug 27 01:20:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 44167 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7R1VqbW016595 for ; Thu, 27 Aug 2009 01:31:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754551AbZH0Bbq (ORCPT ); Wed, 26 Aug 2009 21:31:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754450AbZH0Bbq (ORCPT ); Wed, 26 Aug 2009 21:31:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17887 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754573AbZH0Bbn (ORCPT ); Wed, 26 Aug 2009 21:31:43 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7R1Vj4b025167 for ; Wed, 26 Aug 2009 21:31:45 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7R1ViRM005530; Wed, 26 Aug 2009 21:31:44 -0400 Received: from amt.cnet (vpn-51-10.sfbay.redhat.com [10.14.51.10]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7R1VgJI024682; Wed, 26 Aug 2009 21:31:43 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 944D358815C; Wed, 26 Aug 2009 22:31:08 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id n7R1V7nw007080; Wed, 26 Aug 2009 22:31:07 -0300 Message-Id: <20090827012955.402689034@localhost.localdomain> References: <20090827012000.762063112@localhost.localdomain> User-Agent: quilt/0.46-1 Date: Wed, 26 Aug 2009 22:20:04 -0300 From: Marcelo Tosatti To: kvm@vger.kernel.org Cc: Marcelo Tosatti Subject: [patch 4/5] KVM: remove make_all_cpus_request Content-Disposition: inline; filename=remove-make-all-vcpus-request X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Obsoleted by kvm_vcpus_request Signed-off-by: Marcelo Tosatti Index: kvm/virt/kvm/kvm_main.c =================================================================== --- kvm.orig/virt/kvm/kvm_main.c +++ kvm/virt/kvm/kvm_main.c @@ -142,40 +142,6 @@ void kvm_vcpu_ipi(struct kvm_vcpu *vcpu) put_cpu(); } -static void ack_flush(void *_completed) -{ -} - -static bool make_all_cpus_request(struct kvm *kvm, unsigned int req) -{ - int i, cpu, me; - cpumask_var_t cpus; - bool called = true; - struct kvm_vcpu *vcpu; - - if (alloc_cpumask_var(&cpus, GFP_ATOMIC)) - cpumask_clear(cpus); - - spin_lock(&kvm->requests_lock); - me = smp_processor_id(); - kvm_for_each_vcpu(i, vcpu, kvm) { - if (test_and_set_bit(req, &vcpu->requests)) - continue; - cpu = vcpu->cpu; - if (cpus != NULL && cpu != -1 && cpu != me) - cpumask_set_cpu(cpu, cpus); - } - if (unlikely(cpus == NULL)) - smp_call_function_many(cpu_online_mask, ack_flush, NULL, 1); - else if (!cpumask_empty(cpus)) - smp_call_function_many(cpus, ack_flush, NULL, 1); - else - called = false; - spin_unlock(&kvm->requests_lock); - free_cpumask_var(cpus); - return called; -} - static int kvm_req_wait(void *unused) { cpu_relax(); @@ -415,7 +381,6 @@ static struct kvm *kvm_create_vm(void) kvm->mm = current->mm; atomic_inc(&kvm->mm->mm_count); spin_lock_init(&kvm->mmu_lock); - spin_lock_init(&kvm->requests_lock); kvm_io_bus_init(&kvm->pio_bus); kvm_eventfd_init(kvm); mutex_init(&kvm->lock); Index: kvm/include/linux/kvm_host.h =================================================================== --- kvm.orig/include/linux/kvm_host.h +++ kvm/include/linux/kvm_host.h @@ -157,7 +157,6 @@ struct kvm_irq_routing_table {}; struct kvm { spinlock_t mmu_lock; - spinlock_t requests_lock; struct rw_semaphore slots_lock; struct mm_struct *mm; /* userspace tied to this vm */ int nmemslots;