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

[Xen-devel] [rfc] "frame number" size in hypercall ABI


  • To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Hollis Blanchard <hollisb@xxxxxxxxxx>
  • Date: Fri, 14 Apr 2006 14:19:59 -0500
  • Delivery-date: Fri, 14 Apr 2006 12:19:33 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

A while back we were talking about how the hypercall ABI has unsigned
long in it, and specifically the p2m array does as well. I will send out
a more comprehensive mail in a bit, but I wanted to get some feedback
first...

I began by defining a "frameno_t" type (which would be 64-bit on ppc64),
then starting converting everything. There is a LOT. I attached a small
sample below so you get the idea. Of course I'm touching a ton of code I
won't be able to test.

Because the patch is so invasive, I'm now thinking it might be better to
define a new GETMEMLIST2 dom0 op that uses the new frameno_t type and a
new xc_get_pfn_list2() wrapper for it. Since PowerPC will need a new
xc_linux_build.c anyways, that will call xc_get_pfn_list2(), leaving all
the current "unsigned long" code in place for the x86 and ia64 paths. As
PowerPC starts implementing features like ptrace, migration,
libxendebug, we'll need to move over those call chains.

Thoughts?

-- 
Hollis Blanchard
IBM Linux Technology Center

diff -r 56e1802303e5 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c  Wed Apr 12 15:41:55 2006 -0500
+++ b/tools/ioemu/vl.c  Fri Apr 14 14:01:47 2006 -0500
@@ -149,11 +149,11 @@ TextConsole *vga_console;
 TextConsole *vga_console;
 CharDriverState *serial_hds[MAX_SERIAL_PORTS];
 int xc_handle;
-unsigned long *vgapage_array;
-unsigned long *freepage_array;
+frameno_t *vgapage_array;
+frameno_t *freepage_array;
 unsigned long free_pages;
 void *vtop_table;
-unsigned long toptab;
+frameno_t toptab;
 unsigned long vgaram_pages;

 /***********************************************************/
@@ -2673,7 +2673,8 @@ int main(int argc, char **argv)
     int serial_device_index;
     char qemu_dm_logfilename[64];
     const char *loadvm = NULL;
-    unsigned long nr_pages, extra_pages, ram_pages, *page_array;
+    unsigned long nr_pages, extra_pages, ram_pages;
+    frameno_t *page_array;
     xc_dominfo_t info;
     extern void *shared_page;
     extern void *shared_vram;
@@ -3156,7 +3157,7 @@ int main(int argc, char **argv)
         exit(-1);
     }

-    if ( (page_array = (unsigned long *)
+    if ( (page_array = (frameno_t *)
                         malloc(nr_pages * sizeof(unsigned long))) == NULL)
     {
         fprintf(logfile, "malloc returned error %d\n", errno);
@@ -3239,7 +3240,7 @@ int main(int argc, char **argv)
                                        page_array[0]);
 #endif

-    fprintf(logfile, "shared page at pfn:%lx, mfn: %lx\n", (nr_pages-1),
+    fprintf(logfile, "shared page at pfn:%lx, mfn: %"PRIx64"\n", (nr_pages-1),
            (page_array[nr_pages - 1]));

     /* we always create the cdrom drive, even if no disk is there */



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.