qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Xu, Anthony" <anthony.xu@intel.com>,
	Igor Mammedov <imammedo@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] Memory: use memory address space for cpu-memory
Date: Fri, 19 May 2017 11:30:17 +0200	[thread overview]
Message-ID: <551f2d35-53d3-1eda-9f39-d8b3f466f25a@redhat.com> (raw)
In-Reply-To: <4712D8F4B26E034E80552F30A67BE0B1ACCCA9@ORSMSX112.amr.corp.intel.com>



On 19/05/2017 01:28, Xu, Anthony wrote:
>> On 18/05/2017 23:48, Xu, Anthony wrote:
>>>> It should be called.  Alternatively you could try adding a new function
>>>> to mark address_space_memory as a never-destroyed AddressSpace:
>>>>
>>> This patch would do it, could you please submit this patch?
>>
>> If you have tested it (together with the change in the initialization of
>> address_space_memory), I can do that.
>>
> 
> Based on your patch, I added the change in the initialization of 
> address_space_memory. It works well in my setup, cpu-memory
> address space doesn't show up as we expected.

Thanks.

I am also thinking of resolving aliases early, and sharing the
AddressSpaceDispatch if the root memory region is the same.  This
hopefully will also reduce memory consumption and speed up AddressSpace
updates.

Paolo

> Anthony
> 
> diff --git a/exec.c b/exec.c
> index 96e3ac9..746dbbc 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -2712,7 +2712,7 @@ static void memory_map_init(void)
>      system_memory = g_malloc(sizeof(*system_memory));
> 
>      memory_region_init(system_memory, NULL, "system", UINT64_MAX);
> -    address_space_init(&address_space_memory, system_memory, "memory");
> +    address_space_init_static(&address_space_memory, system_memory, "memory");
> 
>      system_io = g_malloc(sizeof(*system_io));
>      memory_region_init_io(system_io, NULL, &unassigned_io_ops, NULL, "io",
> diff --git a/include/exec/memory.h b/include/exec/memory.h
> index b27b288..6f44b79 100644
> --- a/include/exec/memory.h
> +++ b/include/exec/memory.h
> @@ -1395,6 +1395,17 @@ MemTxResult memory_region_dispatch_write(MemoryRegion *mr,
>  void address_space_init(AddressSpace *as, MemoryRegion *root, const char *name);
> 
>  /**
> + * address_space_init_static: initializes an static address space
> + *
> + * @as: an uninitialized #AddressSpace
> + * @root: a #MemoryRegion that routes addresses for the address space
> + * @name: an address space name.  The name is only used for debugging
> + *        output.
> + */
> +void address_space_init_static(AddressSpace *as, MemoryRegion *root,
> +       const char *name);
> +
> +/**
>   * address_space_init_shareable: return an address space for a memory region,
>   *                               creating it if it does not already exist
>   *
> diff --git a/memory.c b/memory.c
> index 190cd3d..6c933d8 100644
> --- a/memory.c
> +++ b/memory.c
> @@ -2461,7 +2461,8 @@ static void do_address_space_destroy(AddressSpace *as)
>      }
>  }
> 
> -void address_space_init_static(AddressSpace *as, MemoryRegion *root, const char *name)
> +void address_space_init_static(AddressSpace *as, MemoryRegion *root,
> +       const char *name)
>  {
>      address_space_init(as, root, name);
>      as->shared = true;
> 

      reply	other threads:[~2017-05-19  9:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16 22:15 [Qemu-devel] [PATCH] Memory: use memory address space for cpu-memory Anthony Xu
2017-05-17  9:27 ` Igor Mammedov
2017-05-17 17:01   ` Xu, Anthony
2017-05-18 21:38     ` Paolo Bonzini
2017-05-18 21:48       ` Xu, Anthony
2017-05-18 21:49         ` Paolo Bonzini
2017-05-18 23:28           ` Xu, Anthony
2017-05-19  9:30             ` Paolo Bonzini [this message]

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=551f2d35-53d3-1eda-9f39-d8b3f466f25a@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=anthony.xu@intel.com \
    --cc=imammedo@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).