From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkE9J-0003sI-JR for qemu-devel@nongnu.org; Mon, 09 Jan 2012 07:16:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RkE9I-0006aL-Kd for qemu-devel@nongnu.org; Mon, 09 Jan 2012 07:16:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55471) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkE9I-0006aA-E0 for qemu-devel@nongnu.org; Mon, 09 Jan 2012 07:16:24 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q09CGNCk011909 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 9 Jan 2012 07:16:23 -0500 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q09C5AKb026823 for ; Mon, 9 Jan 2012 07:05:10 -0500 From: Avi Kivity Date: Mon, 9 Jan 2012 14:04:52 +0200 Message-Id: <1326110694-5196-2-git-send-email-avi@redhat.com> In-Reply-To: <1326110694-5196-1-git-send-email-avi@redhat.com> References: <1326110694-5196-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH 1/3] vhost: fix incorrect userspace address List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org MemoryListener::region_add() gives us a slice of a MemoryRegion, not a region. Adjust the userspace address to reflect that. Signed-off-by: Avi Kivity --- hw/vhost.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/vhost.c b/hw/vhost.c index cd56e75..541c716 100644 --- a/hw/vhost.c +++ b/hw/vhost.c @@ -378,7 +378,7 @@ static void vhost_set_memory(MemoryListener *listener, assert(size); /* Optimize no-change case. At least cirrus_vga does this a lot at this time. */ - ram = memory_region_get_ram_ptr(section->mr); + ram = memory_region_get_ram_ptr(section->mr) + section->offset_within_region; if (add) { if (!vhost_dev_cmp_memory(dev, start_addr, size, (uintptr_t)ram)) { /* Region exists with same address. Nothing to do. */ -- 1.7.7.1