From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTUU0-0006P6-10 for qemu-devel@nongnu.org; Fri, 28 Mar 2014 06:58:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTUTr-0003iM-MS for qemu-devel@nongnu.org; Fri, 28 Mar 2014 06:57:55 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:43706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTUTr-0003iD-77 for qemu-devel@nongnu.org; Fri, 28 Mar 2014 06:57:47 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 28 Mar 2014 10:57:46 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id DD4FA219004D for ; Fri, 28 Mar 2014 10:57:38 +0000 (GMT) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s2SAvWUF52756710 for ; Fri, 28 Mar 2014 10:57:32 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s2SAvhiX006831 for ; Fri, 28 Mar 2014 04:57:44 -0600 From: Greg Kurz Date: Fri, 28 Mar 2014 11:57:41 +0100 Message-ID: <20140328105740.21018.82087.stgit@bahia.local> In-Reply-To: <20140328105709.21018.88000.stgit@bahia.local> References: <20140328105709.21018.88000.stgit@bahia.local> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH v6 4/8] virtio-balloon: use virtio wrappers to access page frame numbers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: afaerber@suse.de Cc: kwolf@redhat.com, peter.maydell@linaro.org, thuth@linux.vnet.ibm.com, mst@redhat.com, marc.zyngier@arm.com, rusty@rustcorp.com.au, agraf@suse.de, qemu-devel@nongnu.org, stefanha@redhat.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, anthony@codemonkey.ws From: Rusty Russell Signed-off-by: Rusty Russell Reviewed-by: Anthony Liguori [ use per-device needs_byteswap flag, Greg Kurz ] Signed-off-by: Greg Kurz --- hw/virtio/virtio-balloon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index a470a0b..e0b31ba 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -30,6 +30,7 @@ #endif #include "hw/virtio/virtio-bus.h" +#include "hw/virtio/virtio-access.h" static void balloon_page(void *addr, int deflate) { @@ -192,7 +193,8 @@ static void virtio_balloon_handle_output(VirtIODevice *vdev, VirtQueue *vq) ram_addr_t pa; ram_addr_t addr; - pa = (ram_addr_t)ldl_p(&pfn) << VIRTIO_BALLOON_PFN_SHIFT; + pa = (ram_addr_t)virtio_ldl_p(&pfn, + vdev) << VIRTIO_BALLOON_PFN_SHIFT; offset += 4; /* FIXME: remove get_system_memory(), but how? */