qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 3/4] virtio: use cpu_physical_memory_map_fast
Date: Tue,  3 May 2011 18:49:33 +0200	[thread overview]
Message-ID: <1304441374-27314-4-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1304441374-27314-1-git-send-email-pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/vhost.c  |   10 +++++-----
 hw/virtio.c |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/hw/vhost.c b/hw/vhost.c
index 14b571d..763ee4c 100644
--- a/hw/vhost.c
+++ b/hw/vhost.c
@@ -283,7 +283,7 @@ static int vhost_verify_ring_mappings(struct vhost_dev *dev,
             continue;
         }
         l = vq->ring_size;
-        p = cpu_physical_memory_map(vq->ring_phys, &l, 1);
+        p = cpu_physical_memory_map_fast(vq->ring_phys, &l);
         if (!p || l != vq->ring_size) {
             fprintf(stderr, "Unable to map ring buffer for ring %d\n", i);
             return -ENOMEM;
@@ -476,21 +476,21 @@ static int vhost_virtqueue_init(struct vhost_dev *dev,
 
     s = l = virtio_queue_get_desc_size(vdev, idx);
     a = virtio_queue_get_desc_addr(vdev, idx);
-    vq->desc = cpu_physical_memory_map(a, &l, 0);
+    vq->desc = cpu_physical_memory_map_fast(a, &l);
     if (!vq->desc || l != s) {
         r = -ENOMEM;
         goto fail_alloc_desc;
     }
     s = l = virtio_queue_get_avail_size(vdev, idx);
     a = virtio_queue_get_avail_addr(vdev, idx);
-    vq->avail = cpu_physical_memory_map(a, &l, 0);
+    vq->avail = cpu_physical_memory_map_fast(a, &l);
     if (!vq->avail || l != s) {
         r = -ENOMEM;
         goto fail_alloc_avail;
     }
     vq->used_size = s = l = virtio_queue_get_used_size(vdev, idx);
     vq->used_phys = a = virtio_queue_get_used_addr(vdev, idx);
-    vq->used = cpu_physical_memory_map(a, &l, 1);
+    vq->used = cpu_physical_memory_map_fast(a, &l);
     if (!vq->used || l != s) {
         r = -ENOMEM;
         goto fail_alloc_used;
@@ -498,7 +498,7 @@ static int vhost_virtqueue_init(struct vhost_dev *dev,
 
     vq->ring_size = s = l = virtio_queue_get_ring_size(vdev, idx);
     vq->ring_phys = a = virtio_queue_get_ring_addr(vdev, idx);
-    vq->ring = cpu_physical_memory_map(a, &l, 1);
+    vq->ring = cpu_physical_memory_map_fast(a, &l);
     if (!vq->ring || l != s) {
         r = -ENOMEM;
         goto fail_alloc_ring;
diff --git a/hw/virtio.c b/hw/virtio.c
index 6e8814c..429646a 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -372,7 +372,7 @@ void virtqueue_map_sg(struct iovec *sg, target_phys_addr_t *addr,
 
     for (i = 0; i < num_sg; i++) {
         len = sg[i].iov_len;
-        sg[i].iov_base = cpu_physical_memory_map(addr[i], &len, is_write);
+        sg[i].iov_base = cpu_physical_memory_map_fast(addr[i], &len);
         if (sg[i].iov_base == NULL || len != sg[i].iov_len) {
             error_report("virtio: trying to map MMIO memory");
             exit(1);
-- 
1.7.4.4

  parent reply	other threads:[~2011-05-03 16:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-03 16:49 [Qemu-devel] [PATCH 0/4] introduce cpu_physical_memory_map_fast Paolo Bonzini
2011-05-03 16:49 ` [Qemu-devel] [PATCH 1/4] exec: extract cpu_physical_memory_map_internal Paolo Bonzini
2011-05-03 16:49 ` [Qemu-devel] [PATCH 2/4] exec: introduce cpu_physical_memory_map_fast and cpu_physical_memory_map_check Paolo Bonzini
2011-05-03 16:49 ` Paolo Bonzini [this message]
2011-05-03 16:49 ` [Qemu-devel] [PATCH 4/4] milkymist: use cpu_physical_memory_map_fast Paolo Bonzini
2011-05-04 21:56   ` Michael Walle
2011-05-12 14:51 ` [Qemu-devel] [PATCH 0/4] introduce cpu_physical_memory_map_fast Paolo Bonzini
2011-05-31  9:16   ` Paolo Bonzini
2011-06-06 12:27     ` Paolo Bonzini
2011-06-06 12:56       ` Anthony Liguori
2011-06-06 13:09         ` Paolo Bonzini
2011-06-06 15:44           ` Anthony Liguori
2011-06-06 15:55             ` Paolo Bonzini
2011-05-12 15:32 ` Avi Kivity
2011-05-13  6:33   ` Paolo Bonzini

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=1304441374-27314-4-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).