From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkFEl-0008On-V3 for qemu-devel@nongnu.org; Mon, 09 Jan 2012 08:26:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RkFEf-0008W3-MZ for qemu-devel@nongnu.org; Mon, 09 Jan 2012 08:26:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkFEf-0008Vs-Fy for qemu-devel@nongnu.org; Mon, 09 Jan 2012 08:26:01 -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 q09DQ09T014611 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 9 Jan 2012 08:26:00 -0500 Date: Mon, 9 Jan 2012 15:28:10 +0200 From: "Michael S. Tsirkin" Message-ID: <20120109132809.GA23401@redhat.com> References: <1326110694-5196-1-git-send-email-avi@redhat.com> <1326110694-5196-2-git-send-email-avi@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1326110694-5196-2-git-send-email-avi@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/3] vhost: fix incorrect userspace address List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org On Mon, Jan 09, 2012 at 02:04:52PM +0200, Avi Kivity wrote: > 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 Acked-by: Michael S. Tsirkin > --- > 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 >