From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: Re: [RFC PATCH 13/16] kvm tools: keep track of registered memory banks in struct kvm Date: Tue, 20 Nov 2012 16:01:01 -0500 Message-ID: <50ABEF8D.6050707@gmail.com> References: <1352721450-11340-1-git-send-email-will.deacon@arm.com> <1352721450-11340-14-git-send-email-will.deacon@arm.com> <50A1CE92.6060803@gmail.com> <20121120171553.GI27765@mudshark.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "kvm@vger.kernel.org" , "penberg@kernel.org" , Marc Zyngier , "c.dall@virtualopensystems.com" , Matt Evans , "peter.maydell@linaro.org" To: Will Deacon Return-path: Received: from mail-qa0-f46.google.com ([209.85.216.46]:64384 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751933Ab2KTVBb (ORCPT ); Tue, 20 Nov 2012 16:01:31 -0500 Received: by mail-qa0-f46.google.com with SMTP id c11so1030162qad.19 for ; Tue, 20 Nov 2012 13:01:30 -0800 (PST) In-Reply-To: <20121120171553.GI27765@mudshark.cambridge.arm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 11/20/2012 12:15 PM, Will Deacon wrote: > Hi Sasha, > > On Tue, Nov 13, 2012 at 04:37:38AM +0000, Sasha Levin wrote: >> On 11/12/2012 06:57 AM, Will Deacon wrote: >>> struct kvm { >>> struct kvm_arch arch; >>> struct kvm_config cfg; >>> @@ -49,6 +56,7 @@ struct kvm { >>> u64 ram_size; >>> void *ram_start; >>> u64 ram_pagesize; >>> + struct list_head mem_banks; >> >> These memory banks actually look like a perfect example to use our augmented interval rb-tree, >> can we switch them to use it, or is it a list on purpose? > > I found some time to look at this today but unfortunately they're not as > ideally suited to the interval tree as they look: the problem being that we > need to search for banks by both host virtual address *and* guest physical > address depending on the translation that we're doing. > > We could have two separate tress, but that seems like overkill given the > likely number of banks. Makes sense. We can convert it later if we need to as well. Thanks, Sasha