All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Xen Devel <xen-devel@lists.xensource.com>,
	QEMU-devel <qemu-devel@nongnu.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH 4/5] xen: Fix the memory registration to reflect of what is done by Xen.
Date: Fri, 15 Jul 2011 16:55:16 +0200	[thread overview]
Message-ID: <4E2054D4.7060808@redhat.com> (raw)
In-Reply-To: <1310740376-13323-5-git-send-email-anthony.perard@citrix.com>

On 07/15/2011 04:32 PM, Anthony PERARD wrote:
> A Xen guest memory is allocated by libxc. But this memory is not
> allocated continuously, instead, it leaves the VGA IO memory space not
> allocated, same for the MMIO space (at HVM_BELOW_4G_MMIO_START of size
> HVM_BELOW_4G_MMIO_LENGTH).
>
> So to reflect that, we do not register the physical memory for this two
> holes. But we still keep only one RAMBlock for the all RAM as it is more
> easier than have two separate blocks (1 above 4G). Also this prevent QEMU
> from use the MMIO space for a ROM.
>
> Signed-off-by: Anthony PERARD<anthony.perard@citrix.com>
> ---
>   xen-all.c |   21 ++++++++++++++-------
>   1 files changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/xen-all.c b/xen-all.c
> index 2c0a62d..76d5c5c 100644
> --- a/xen-all.c
> +++ b/xen-all.c
> @@ -144,6 +144,12 @@ static void xen_ram_init(ram_addr_t ram_size)
>       new_block->host = NULL;
>       new_block->offset = 0;
>       new_block->length = ram_size;
> +    if (ram_size>= HVM_BELOW_4G_RAM_END) {
> +        /* Xen does not allocate the memory continuously, and keep a hole at
> +         * HVM_BELOW_4G_MMIO_START of HVM_BELOW_4G_MMIO_LENGTH
> +         */
> +        new_block->length += HVM_BELOW_4G_MMIO_LENGTH;
> +    }
>
>       QLIST_INSERT_HEAD(&ram_list.blocks, new_block, next);
>
> @@ -152,20 +158,21 @@ static void xen_ram_init(ram_addr_t ram_size)
>       memset(ram_list.phys_dirty + (new_block->offset>>  TARGET_PAGE_BITS),
>              0xff, new_block->length>>  TARGET_PAGE_BITS);
>
> -    if (ram_size>= 0xe0000000 ) {
> -        above_4g_mem_size = ram_size - 0xe0000000;
> -        below_4g_mem_size = 0xe0000000;
> +    if (ram_size>= HVM_BELOW_4G_RAM_END) {
> +        above_4g_mem_size = ram_size - HVM_BELOW_4G_RAM_END;
> +        below_4g_mem_size = HVM_BELOW_4G_RAM_END;
>       } else {
>           below_4g_mem_size = ram_size;
>       }
>
> -    cpu_register_physical_memory(0, below_4g_mem_size, new_block->offset);
> -#if TARGET_PHYS_ADDR_BITS>  32
> +    cpu_register_physical_memory(0, 0xa0000, 0);
> +    /* Skip of the VGA IO memory space */
> +    cpu_register_physical_memory(0xc0000, below_4g_mem_size - 0xc0000,
> +                                 0xc0000);
>       if (above_4g_mem_size>  0) {
>           cpu_register_physical_memory(0x100000000ULL, above_4g_mem_size,
> -                                     new_block->offset + below_4g_mem_size);
> +                                     0x100000000ULL);
>       }
> -#endif
>   }
>
>   void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size)

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo

WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Xen Devel <xen-devel@lists.xensource.com>,
	QEMU-devel <qemu-devel@nongnu.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Alexander Graf <agraf@suse.de>
Subject: Re: [PATCH 4/5] xen: Fix the memory registration to reflect of what is done by Xen.
Date: Fri, 15 Jul 2011 16:55:16 +0200	[thread overview]
Message-ID: <4E2054D4.7060808@redhat.com> (raw)
In-Reply-To: <1310740376-13323-5-git-send-email-anthony.perard@citrix.com>

On 07/15/2011 04:32 PM, Anthony PERARD wrote:
> A Xen guest memory is allocated by libxc. But this memory is not
> allocated continuously, instead, it leaves the VGA IO memory space not
> allocated, same for the MMIO space (at HVM_BELOW_4G_MMIO_START of size
> HVM_BELOW_4G_MMIO_LENGTH).
>
> So to reflect that, we do not register the physical memory for this two
> holes. But we still keep only one RAMBlock for the all RAM as it is more
> easier than have two separate blocks (1 above 4G). Also this prevent QEMU
> from use the MMIO space for a ROM.
>
> Signed-off-by: Anthony PERARD<anthony.perard@citrix.com>
> ---
>   xen-all.c |   21 ++++++++++++++-------
>   1 files changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/xen-all.c b/xen-all.c
> index 2c0a62d..76d5c5c 100644
> --- a/xen-all.c
> +++ b/xen-all.c
> @@ -144,6 +144,12 @@ static void xen_ram_init(ram_addr_t ram_size)
>       new_block->host = NULL;
>       new_block->offset = 0;
>       new_block->length = ram_size;
> +    if (ram_size>= HVM_BELOW_4G_RAM_END) {
> +        /* Xen does not allocate the memory continuously, and keep a hole at
> +         * HVM_BELOW_4G_MMIO_START of HVM_BELOW_4G_MMIO_LENGTH
> +         */
> +        new_block->length += HVM_BELOW_4G_MMIO_LENGTH;
> +    }
>
>       QLIST_INSERT_HEAD(&ram_list.blocks, new_block, next);
>
> @@ -152,20 +158,21 @@ static void xen_ram_init(ram_addr_t ram_size)
>       memset(ram_list.phys_dirty + (new_block->offset>>  TARGET_PAGE_BITS),
>              0xff, new_block->length>>  TARGET_PAGE_BITS);
>
> -    if (ram_size>= 0xe0000000 ) {
> -        above_4g_mem_size = ram_size - 0xe0000000;
> -        below_4g_mem_size = 0xe0000000;
> +    if (ram_size>= HVM_BELOW_4G_RAM_END) {
> +        above_4g_mem_size = ram_size - HVM_BELOW_4G_RAM_END;
> +        below_4g_mem_size = HVM_BELOW_4G_RAM_END;
>       } else {
>           below_4g_mem_size = ram_size;
>       }
>
> -    cpu_register_physical_memory(0, below_4g_mem_size, new_block->offset);
> -#if TARGET_PHYS_ADDR_BITS>  32
> +    cpu_register_physical_memory(0, 0xa0000, 0);
> +    /* Skip of the VGA IO memory space */
> +    cpu_register_physical_memory(0xc0000, below_4g_mem_size - 0xc0000,
> +                                 0xc0000);
>       if (above_4g_mem_size>  0) {
>           cpu_register_physical_memory(0x100000000ULL, above_4g_mem_size,
> -                                     new_block->offset + below_4g_mem_size);
> +                                     0x100000000ULL);
>       }
> -#endif
>   }
>
>   void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size)

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo

  reply	other threads:[~2011-07-15 14:55 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-15 14:32 [Qemu-devel] [PATCH 0/5] Enable QEMU to handle more than 2GB with Xen Anthony PERARD
2011-07-15 14:32 ` Anthony PERARD
2011-07-15 14:32 ` [Qemu-devel] [PATCH 1/5] xen: Fix xen_enabled() Anthony PERARD
2011-07-15 14:32   ` Anthony PERARD
2011-07-15 14:46   ` [Qemu-devel] " Paolo Bonzini
2011-07-15 14:46     ` Paolo Bonzini
2011-07-18 12:43   ` [Qemu-devel] " Alexander Graf
2011-07-18 12:43     ` Alexander Graf
2011-07-15 14:32 ` [Qemu-devel] [PATCH 2/5] exec.c: Use ram_addr_t in cpu_physical_memory_rw(...) Anthony PERARD
2011-07-15 14:32   ` Anthony PERARD
2011-07-15 14:46   ` [Qemu-devel] " Paolo Bonzini
2011-07-15 14:46     ` Paolo Bonzini
2011-07-15 14:32 ` [Qemu-devel] [PATCH 3/5] cpu-common: Have a ram_addr_t of uint64 with Xen Anthony PERARD
2011-07-15 14:32   ` Anthony PERARD
2011-07-18 12:30   ` [Qemu-devel] " Alexander Graf
2011-07-18 12:30     ` Alexander Graf
2011-07-18 14:46     ` [Qemu-devel] [Xen-devel] " Anthony PERARD
2011-07-18 14:46       ` Anthony PERARD
2011-07-18 19:42       ` [Qemu-devel] [Xen-devel] " Anthony PERARD
2011-07-18 19:42         ` Anthony PERARD
2011-07-15 14:32 ` [Qemu-devel] [PATCH 4/5] xen: Fix the memory registration to reflect of what is done by Xen Anthony PERARD
2011-07-15 14:32   ` Anthony PERARD
2011-07-15 14:55   ` Paolo Bonzini [this message]
2011-07-15 14:55     ` Paolo Bonzini
2011-07-15 17:05   ` [Qemu-devel] " Stefano Stabellini
2011-07-15 17:05     ` Stefano Stabellini
2011-07-15 17:51     ` [Qemu-devel] [Xen-devel] " Anthony PERARD
2011-07-15 17:51       ` Anthony PERARD
2011-07-18 11:14       ` [Qemu-devel] [Xen-devel] " Stefano Stabellini
2011-07-18 11:14         ` Stefano Stabellini
2011-07-18 15:29         ` [Qemu-devel] [Xen-devel] " Anthony PERARD
2011-07-18 15:29           ` Anthony PERARD
2011-07-18 16:14   ` [Qemu-devel] " Stefano Stabellini
2011-07-18 16:14     ` Stefano Stabellini
2011-07-15 14:32 ` [Qemu-devel] [PATCH 5/5] vl.c: Check the asked ram_size later Anthony PERARD
2011-07-15 14:32   ` Anthony PERARD
2011-07-15 14:52   ` [Qemu-devel] " Paolo Bonzini
2011-07-15 14:52     ` Paolo Bonzini
2011-07-15 17:05 ` [Qemu-devel] [PATCH 0/5] Enable QEMU to handle more than 2GB with Xen Stefano Stabellini
2011-07-15 17:05   ` Stefano Stabellini
2011-07-18 12:32   ` [Qemu-devel] " Alexander Graf
2011-07-18 12:32     ` Alexander Graf
2011-07-22  7:20 ` jiageng_yu
2011-07-22 11:22   ` Anthony PERARD

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=4E2054D4.7060808@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=agraf@suse.de \
    --cc=anthony.perard@citrix.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.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.