Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1722458

Re: [PATCH RFC v3 7/9] KVM: add kvm_free_vcpus and kvm_arch_free_vcpus

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Cornelia Huck <cohuck@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH RFC v3 7/9] KVM: add kvm_free_vcpus and kvm_arch_free_vcpus
Date Tue, 29 Aug 2017 15:10:03 +0200
Message-ID <ujOrg-33K-29@gated-at.bofh.it> (permalink)
References <uh1El-Dw-3@gated-at.bofh.it> <uh1Em-Dw-37@gated-at.bofh.it> <uhic9-3vV-1@gated-at.bofh.it>
X-Original-To David Hildenbrand <david@redhat.com>
Dmarc-Filter OpenDMARC Filter v1.3.2 mx1.redhat.com 5345E80F9C
Authentication-Results ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com
Organization Red Hat GmbH
MIME-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-Scanned-By MIMEDefang 2.79 on 10.5.11.12
X-Greylist Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 29 Aug 2017 13:00:57 +0000 (UTC)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 32
X-Original-Cc Radim Krčmář <rkrcmar@redhat.com>, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-mips@linux-mips.org, kvm-ppc@vger.kernel.org, linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Paolo Bonzini <pbonzini@redhat.com>, Christoffer Dall <cdall@linaro.org>, Marc Zyngier <marc.zyngier@arm.com>, Christian Borntraeger <borntraeger@de.ibm.com>, James Hogan <james.hogan@imgtec.com>, Paul Mackerras <paulus@ozlabs.org>, Alexander Graf <agraf@suse.com>
X-Original-Date Tue, 29 Aug 2017 15:00:44 +0200
X-Original-Message-ID <20170829150044.554b5288.cohuck@redhat.com>
X-Original-References <20170821203530.9266-1-rkrcmar@redhat.com> <20170821203530.9266-8-rkrcmar@redhat.com> <45e07499-e60c-5289-f439-9c51f59866ec@redhat.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1722458

Show key headers only | View raw


On Tue, 22 Aug 2017 16:18:59 +0200
David Hildenbrand <david@redhat.com> wrote:

> > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> > index 33a15e176927..0d2d8b0c785c 100644
> > --- a/virt/kvm/kvm_main.c
> > +++ b/virt/kvm/kvm_main.c
> > @@ -750,6 +750,23 @@ static void kvm_destroy_devices(struct kvm *kvm)
> >  	}
> >  }
> >  
> > +void kvm_free_vcpus(struct kvm *kvm)
> > +{
> > +	int i;
> > +
> > +	kvm_arch_free_vcpus(kvm);  
> 
> I wonder if it would be possible to get rid of kvm_arch_free_vcpus(kvm)
> completely and simply call
> 
> kvm_for_each_vcpu(i, vcpu, kvm)
> 	kvm_arch_vcpu_free(vcpu);
> 
> at that point.
> 
> Would certainly require some refactoring, and I am not sure if we could
> modify the special mmu handling for x86 ("Unpin any mmu pages first.").
> But if in doubt, that part could be moved to kvm_arch_destroy_vm(), just
> before calling kvm_free_vcpus().

Nod, that crossed my mind as well. Would avoid adding lots of
kvm_arch_free_vcpus() that do the same thing for many archs.

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH RFC v3 7/9] KVM: add kvm_free_vcpus and  kvm_arch_free_vcpus Cornelia Huck <cohuck@redhat.com> - 2017-08-29 15:10 +0200

csiph-web