WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [qemu-xen-unstable] use new (replacement) mmap-batch ioc

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [qemu-xen-unstable] use new (replacement) mmap-batch ioctl
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Thu, 14 Jan 2010 10:35:02 -0800
Delivery-date: Thu, 14 Jan 2010 10:37:23 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
commit a0066d08514ecfec34c717c7184250e95519f39c
Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Date:   Thu Jan 14 18:27:13 2010 +0000

    use new (replacement) mmap-batch ioctl
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
    
    From:
    [PATCH, RFC 3/4] qemu: use new (replacement) mmap-batch ioctl
---
 hw/xen_machine_fv.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/hw/xen_machine_fv.c b/hw/xen_machine_fv.c
index d839411..d02e23f 100644
--- a/hw/xen_machine_fv.c
+++ b/hw/xen_machine_fv.c
@@ -95,7 +95,8 @@ static void qemu_remap_bucket(struct map_cache *entry,
                               unsigned long address_index)
 {
     uint8_t *vaddr_base;
-    unsigned long pfns[MCACHE_BUCKET_SIZE >> XC_PAGE_SHIFT];
+    xen_pfn_t pfns[MCACHE_BUCKET_SIZE >> XC_PAGE_SHIFT];
+    int err[MCACHE_BUCKET_SIZE >> XC_PAGE_SHIFT];
     unsigned int i, j;
 
     if (entry->vaddr_base != NULL) {
@@ -109,10 +110,11 @@ static void qemu_remap_bucket(struct map_cache *entry,
     for (i = 0; i < MCACHE_BUCKET_SIZE >> XC_PAGE_SHIFT; i++)
         pfns[i] = (address_index << (MCACHE_BUCKET_SHIFT-XC_PAGE_SHIFT)) + i;
 
-    vaddr_base = xc_map_foreign_batch(xc_handle, domid, PROT_READ|PROT_WRITE,
-                                      pfns, MCACHE_BUCKET_SIZE >> 
XC_PAGE_SHIFT);
+    vaddr_base = xc_map_foreign_bulk(xc_handle, domid, PROT_READ|PROT_WRITE,
+                                     pfns, err,
+                                     MCACHE_BUCKET_SIZE >> XC_PAGE_SHIFT);
     if (vaddr_base == NULL) {
-        fprintf(logfile, "xc_map_foreign_batch error %d\n", errno);
+        fprintf(logfile, "xc_map_foreign_bulk error %d\n", errno);
         exit(-1);
     }
 
@@ -124,7 +126,7 @@ static void qemu_remap_bucket(struct map_cache *entry,
         j = ((i + BITS_PER_LONG) > (MCACHE_BUCKET_SIZE >> XC_PAGE_SHIFT)) ?
             (MCACHE_BUCKET_SIZE >> XC_PAGE_SHIFT) % BITS_PER_LONG : 
BITS_PER_LONG;
         while (j > 0)
-            word = (word << 1) | (((pfns[i + --j] >> 28) & 0xf) != 0xf);
+            word = (word << 1) | !err[i + --j];
         entry->valid_mapping[i / BITS_PER_LONG] = word;
     }
 }
@@ -347,11 +349,11 @@ static void xen_init_fv(ram_addr_t ram_size, int 
vga_ram_size,
                 (STORE_PAGE_START >> XC_PAGE_SHIFT); 
     }
 
-    phys_ram_base = xc_map_foreign_batch(xc_handle, domid,
+    phys_ram_base = xc_map_foreign_pages(xc_handle, domid,
                                          PROT_READ|PROT_WRITE,
                                          page_array, nr_pages);
     if (phys_ram_base == 0) {
-        fprintf(logfile, "xc_map_foreign_batch returned error %d\n", errno);
+        fprintf(logfile, "xc_map_foreign_pages returned error %d\n", errno);
         exit(-1);
     }
     free(page_array);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [qemu-xen-unstable] use new (replacement) mmap-batch ioctl, Ian Jackson <=