All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: alex.williamson@redhat.com,
	Anthony Liguori <anthony@codemonkey.ws>,
	qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] pc: unbreak vhost
Date: Fri, 16 Jul 2010 14:00:04 +0300	[thread overview]
Message-ID: <20100716110004.GA28018@redhat.com> (raw)

Commit 44ae28f3152138e71ccad66c201d730b93374bc2 breaks vhost
on small guests as we get a zero-sized memory slot at >4G,
which that code does not expect.
The removal of if (above_4g_size > 0) seems unintentional
(commit log only mentions allocation memory in a single chunk)
so just put it back in.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/pc.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 89bd4af..77b1592 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -920,8 +920,10 @@ void pc_memory_init(ram_addr_t ram_size,
                  below_4g_mem_size - 0x100000,
                  ram_addr + 0x100000);
 #if TARGET_PHYS_ADDR_BITS > 32
-    cpu_register_physical_memory(0x100000000ULL, above_4g_mem_size,
-                                 ram_addr + below_4g_mem_size);
+    if (above_4g_mem_size > 0) {
+        cpu_register_physical_memory(0x100000000ULL, above_4g_mem_size,
+                                     ram_addr + below_4g_mem_size);
+    }
 #endif
 
     /* BIOS load */
-- 
1.7.2.rc0.14.g41c1c

             reply	other threads:[~2010-07-16 11:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-16 11:00 Michael S. Tsirkin [this message]
2010-07-16 12:39 ` [Qemu-devel] Re: [PATCH] pc: unbreak vhost Alex Williamson
2010-07-16 13:04   ` Anthony Liguori

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=20100716110004.GA28018@redhat.com \
    --to=mst@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=anthony@codemonkey.ws \
    --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 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.