From: Sasha Levin <levinsasha928@gmail.com>
To: Will Deacon <will.deacon@arm.com>
Cc: kvm@vger.kernel.org, penberg@kernel.org, marc.zyngier@arm.com,
c.dall@virtualopensystems.com, matt.evans@arm.com,
peter.maydell@linaro.org
Subject: Re: [RFC PATCH 13/16] kvm tools: keep track of registered memory banks in struct kvm
Date: Mon, 12 Nov 2012 23:37:38 -0500 [thread overview]
Message-ID: <50A1CE92.6060803@gmail.com> (raw)
In-Reply-To: <1352721450-11340-14-git-send-email-will.deacon@arm.com>
On 11/12/2012 06:57 AM, Will Deacon wrote:
> When registering memory banks for a guest, it is useful to keep the
> range information around for translating between guest and host address
> spaces.
>
> This patch adds a list of kvm_mem_bank structures to struct kvm, which
> is updated when a new bank is registered.
>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
> ---
> tools/kvm/include/kvm/kvm.h | 8 ++++++++
> tools/kvm/kvm.c | 23 ++++++++++++++++++++++-
> 2 files changed, 30 insertions(+), 1 deletions(-)
>
> diff --git a/tools/kvm/include/kvm/kvm.h b/tools/kvm/include/kvm/kvm.h
> index cf959ea..96dd81b 100644
> --- a/tools/kvm/include/kvm/kvm.h
> +++ b/tools/kvm/include/kvm/kvm.h
> @@ -35,6 +35,13 @@ struct kvm_ext {
> int code;
> };
>
> +struct kvm_mem_bank {
> + struct list_head list;
> + unsigned long guest_phys_addr;
> + void *host_addr;
> + unsigned long size;
> +};
Can we just reuse struct kvm_userspace_memory_region here? We're also using different
data types for guest_phys_addr and size than whats in kvm_userspace_memory_region - that
can't be good.
> 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?
Thanks,
Sasha
next prev parent reply other threads:[~2012-11-13 4:38 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-12 11:57 [RFC PATCH 00/16] kvm tools: add support for ARMv7 processors Will Deacon
2012-11-12 11:57 ` [RFC PATCH 01/16] kvm tools: include arch uapi/asm directories in include path Will Deacon
2012-11-12 11:57 ` [RFC PATCH 02/16] kvm tools: only enable LTO if supported by GCC Will Deacon
2012-11-12 11:57 ` [RFC PATCH 03/16] kvm tools: avoid linking dynamically against libbfd Will Deacon
2012-11-12 11:57 ` [RFC PATCH 04/16] kvm tools: specify compiler by name when overriding make default Will Deacon
2012-11-12 11:57 ` [RFC PATCH 05/16] kvm tools: don't bother including linux/compiler.h Will Deacon
2012-11-13 7:26 ` Pekka Enberg
2012-11-16 10:06 ` Will Deacon
2012-11-16 22:01 ` Pekka Enberg
2012-11-19 10:33 ` Will Deacon
2012-11-19 11:42 ` Pekka Enberg
2012-11-12 11:57 ` [RFC PATCH 06/16] kvm tools: don't pass -Wcast-align to the compiler Will Deacon
2012-11-12 11:57 ` [RFC PATCH 07/16] kvm tools: die if init_list__init returns failure Will Deacon
2012-11-12 11:57 ` [RFC PATCH 08/16] kvm tools: add generic device registration mechanism Will Deacon
2012-11-13 4:29 ` Sasha Levin
2012-11-13 10:24 ` Will Deacon
2012-11-12 11:57 ` [RFC PATCH 09/16] kvm tools: make _FDT macro usable by other architectures Will Deacon
2012-11-12 11:57 ` [RFC PATCH 10/16] kvm tools: virtio-mmio: use subsys_id instead of pci device ID Will Deacon
2012-11-12 11:57 ` [RFC PATCH 11/16] kvm tools: virtio: add dummy set_size_vq implementations Will Deacon
2012-11-12 11:57 ` [RFC PATCH 12/16] kvm tools: allow arch to specify default virtio transport Will Deacon
2012-11-12 11:57 ` [RFC PATCH 13/16] kvm tools: keep track of registered memory banks in struct kvm Will Deacon
2012-11-13 4:37 ` Sasha Levin [this message]
2012-11-13 12:16 ` Will Deacon
2012-11-13 16:09 ` Sasha Levin
2012-11-13 16:21 ` Will Deacon
2012-11-20 17:15 ` Will Deacon
2012-11-20 21:01 ` Sasha Levin
2012-11-12 11:57 ` [RFC PATCH 14/16] kvm tools: teach guest_flat_to_host about memory banks starting above 0 Will Deacon
2012-11-13 4:47 ` Sasha Levin
2012-11-12 11:57 ` [RFC PATCH 15/16] kvm tools: provide a mechanism for translating host to guest addresses Will Deacon
2012-11-12 11:57 ` [RFC PATCH 16/16] kvm tools: add support for ARMv7 processors Will Deacon
2012-11-13 7:39 ` Pekka Enberg
2012-11-13 10:21 ` Matt Evans
2012-11-13 10:28 ` Pekka Enberg
2012-11-13 18:34 ` Will Deacon
2012-11-12 12:18 ` [RFC PATCH 00/16] " Christoffer Dall
2012-11-12 12:27 ` Will Deacon
2012-11-12 12:52 ` Christoffer Dall
2012-11-12 22:40 ` Christoffer Dall
2012-11-13 10:27 ` Will Deacon
2012-11-13 7:37 ` Pekka Enberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50A1CE92.6060803@gmail.com \
--to=levinsasha928@gmail.com \
--cc=c.dall@virtualopensystems.com \
--cc=kvm@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=matt.evans@arm.com \
--cc=penberg@kernel.org \
--cc=peter.maydell@linaro.org \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.