qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC v9 06/27] virtio-blk: Take PCI memory range into accou


From: Stefan Hajnoczi
Subject: [Qemu-devel] [RFC v9 06/27] virtio-blk: Take PCI memory range into account
Date: Wed, 18 Jul 2012 16:07:33 +0100

Support >4 GB physical memory accesses.

Signed-off-by: Stefan Hajnoczi <address@hidden>
---
 hw/virtio-blk.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index abd9386..99654f1 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -64,6 +64,13 @@ static VirtIOBlock *to_virtio_blk(VirtIODevice *vdev)
  */
 static inline void *phys_to_host(VirtIOBlock *s, target_phys_addr_t phys)
 {
+    /* Adjust for 3.6-4 GB PCI memory range */
+    if (phys >= 0x100000000) {
+        phys -= 0x100000000 - 0xe0000000;
+    } else if (phys >= 0xe0000000) {
+        fprintf(stderr, "phys_to_host bad physical address in PCI range 
%#lx\n", phys);
+        exit(1);
+    }
     return s->phys_mem_zero_host_ptr + phys;
 }
 
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]