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 <[email protected]>
> ---
> 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
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html