xenaccess-devel Mailing List for XenAccess Library (Page 3)
Status: Beta
Brought to you by:
bdpayne
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(6) |
Jul
(21) |
Aug
(13) |
Sep
(5) |
Oct
(1) |
Nov
|
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(9) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(13) |
Sep
|
Oct
|
Nov
(4) |
Dec
(8) |
2008 |
Jan
(14) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Bryan D. P. <br...@th...> - 2007-01-08 19:09:28
|
In case people are trying to use XenAccess with Xen 3.0.4, I wanted to provide this update. The currently released version of XenAccess (0.3) will work with Xen 3.0.3. However, there was a change in Xen 3.0.4 that breaks the XenAccess HVM support (PV support works fine). I have already fixed the problem and the updated code is in the subversion repository. The fix allows the code to work with Xen 3.0.4, but not Xen 3.0.3. In short, Xen and XenAccess versions are linked as follows: Xen 3.0.3 --> XenAccess 0.3. Xen 3.0.4 --> XenAccess via subversion. I will look into adding automatic version detection so that XenAccess can detect what version of Xen you are running and automatically do the right now. But for now, stick with the recommendations above. Thanks, bryan - Bryan D. Payne Graduate Student, Computer Science Georgia Tech Information Security Center http://www.bryanpayne.org |
From: Bryan D. P. <br...@th...> - 2007-01-02 21:35:46
|
Happy new year to everyone. I just wanted to let you know that XenAccess version 0.3 (with support for HVM domains) is now available. Check it out and let me know what you think! http://xenaccess.sourceforge.net/ Cheers, bryan - Bryan D. Payne Graduate Student, Computer Science Georgia Tech Information Security Center http://www.bryanpayne.org |
From: Bryan D. P. <br...@th...> - 2007-01-02 20:52:20
|
Hi Tomas, > I am trying to understand internals of xenaccess and while reading > the code I fixed some things: > > - added documentation for configuration file > - added checking of libxenctrl and libxenstore > - added comments to functions in xa_private.h > - simpler offset counting in linux_access_machine_address_rw Thanks! I just patched the code in subversion. This was a big help :-) > 1) In xa_cache.c shouldn't the memory pointed by mach_address be > munmapped when > releasing cache item? mach_address is just the address, there is no mapped memory in the cache. After getting the mach_address out of the cache, XenAccess maps the memory. In effect, you can think of the cache as a TLB. > 2) in xenaccess/xa_memory.c in function xa_mmap_pfn() why is there > XC_PAGE_SIZE instead of > 1 The third argument to xc_map_foreign_range is the size of the page to map. > 3) Why do you do page translation via linux_pagetable_lookup() in > xenaccess/linux_memory.c? > I think I see the principle but there is the > xc_translate_foreign_address() function used in > xa_access_virtual_address() in commented test code. Why don't you > use it? Are there any caveats > or advantages of your approach that I don't see? :) I've been playing with the xc_translate_foreign_address function a bit. It uses the CR3 register value from the vcpu to locate the page table. However, this gives me some trouble for looking up user-space virtual addresses because CR3 could be pointing to one process' address table when I'm interested in another. By writing my own page table lookup code, I'm able to avoid this issue. I think that future versions of XenAccess will make use of xc_translate_foreign_address as much as possible, I just need to learn how to best utilize it first :-) Thanks again for your patch. Let me know if you have any additional questions. -bryan - Bryan D. Payne Graduate Student, Computer Science Georgia Tech Information Security Center http://www.bryanpayne.org |
From: <to...@ji...> - 2006-12-25 21:57:45
|
Hi, I am trying to understand internals of xenaccess and while reading the code I fixed some things: - added documentation for configuration file - added checking of libxenctrl and libxenstore - added comments to functions in xa_private.h - simpler offset counting in linux_access_machine_address_rw Btw.: 1) In xa_cache.c shouldn't the memory pointed by mach_address be munmapped when releasing cache item? 2) in xenaccess/xa_memory.c in function xa_mmap_pfn() why is there XC_PAGE_SIZE instead of 1 3) Why do you do page translation via linux_pagetable_lookup() in xenaccess/linux_memory.c? I think I see the principle but there is the xc_translate_foreign_address() function used in xa_access_virtual_address() in commented test code. Why don't you use it? Are there any caveats or advantages of your approach that I don't see? :) Thanks in advance for answers. -- Tomas Kouba |
From: Bryan D. P. <br...@th...> - 2006-12-04 14:44:52
|
Stephan, I've made some changes to the build system over the past couple of days, so I wouldn't be surprised if there are bugs. However, I'm not sure what the problem is on your system based on the output you provided. Your compiler is pretty bleeding edge, but mine isn't too far behind and I don't have this problem. For what it's worth, here's the versions on my devel machine: gcc version 4.1.1 20061011 automake version 1.9.6 autoconf version 2.59 make version 3.81 Here's something to try as a sanity check: (1) make distclean (2) ./reconf.sh (3) ./configure (4) make I expect that you will get the same results. If not, then there's something wrong with what I have checked into SVN. Either way, I'll look into it deeper at this end so that hopefully we can get to the root of the problem. Thanks, bryan PS... Did you get similar errors with the 0.2 version? On Dec 4, 2006, at 7:32 AM, Stephan Creutz wrote: > Hi, > > when I try to compile any version (I tried 0.2 and the latest svn > version) of xenaccess I get the following errors: > > make all-recursive > make[1]: Entering directory `/home/stephan/xenaccess/libxa' > Making all in xenaccess > make[2]: Entering directory `/home/stephan/xenaccess/libxa/xenaccess' > make[3]: Entering directory `/home/stephan/xenaccess/libxa/xenaccess' > if /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. > -I. -I.. - I.. -I/usr/local/include/xen -g -O2 -MT > linux_domain_info.lo -MD -MP -MF ".dep s/linux_domain_info.Tpo" -c -o > linux_domain_info.lo linux_domain_info.c; \ then mv -f > ".deps/linux_domain_info.Tpo" ".deps/linux_domain_info.Plo"; else > rm -f > ".deps/linux_domain_info.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. > -I.. -I.. -I/usr/local/include/xen -g -O2 -MT linux _domain_info.lo > -MD > -MP -MF .deps/linux_domain_info.Tpo -c linux_domain_info.c -fPIC - > DPIC > -o .libs/linux_domain_info.o In file included from > linux_domain_info.c:34: /usr/include/stdlib.h:96: error: expected '=', > ',', ';', 'asm' or '__attribute__ ' before '__BEGIN_NAMESPACE_STD' > /usr/include/stdlib.h:140: error: expected '=', ',', ';', 'asm' or > '__attribute_ _' before 'extern' > /usr/include/stdlib.h:145: error: expected '=', ',', ';', 'asm' or > '__attribute_ _' before 'extern' > /usr/include/stdlib.h: In function 'atoi': > /usr/include/stdlib.h:149: error: expected declaration specifiers > before > '__THRO W' > /usr/include/stdlib.h:152: error: expected '=', ',', ';', 'asm' or > '__attribute_ _' before '__THROW' > /usr/include/stdlib.h:153: error: expected declaration specifiers > before > '__END_ NAMESPACE_STD' > /usr/include/stdlib.h:167: error: expected declaration specifiers > before > '__END_ NAMESPACE_STD' > /usr/include/stdlib.h:189: error: expected '=', ',', ';', 'asm' or > '__attribute_ _' before '__THROW' > /usr/include/stdlib.h:190: error: expected declaration specifiers > before > '__END_ NAMESPACE_C99' > /usr/include/stdlib.h:282: error: expected '=', ',', ';', 'asm' or > '__attribute_ _' before '__THROW' > /usr/include/stdlib.h:285: error: expected '=', ',', ';', 'asm' or > '__attribute_ _' before '__THROW' > /usr/include/stdlib.h:290: error: expected '=', ',', ';', 'asm' or > '__attribute_ _' before '__THROW' > /usr/include/stdlib.h:297: error: expected '=', ',', ';', 'asm' or > '__attribute_ _' before '__THROW' > /usr/include/stdlib.h:302: error: expected declaration specifiers > before > '__exte nsion__' > /usr/include/stdlib.h:310: error: expected declaration specifiers > before > '__exte nsion__' > /usr/include/stdlib.h:491: error: expected declaration specifiers > before > '__BEGI N_NAMESPACE_STD' > /usr/include/stdlib.h:495: error: expected '=', ',', ';', 'asm' or > '__attribute_ _' before '__THROW' > /usr/include/stdlib.h:496: error: expected declaration specifiers > before > '__END_ NAMESPACE_STD' > [...] > > I use Debian Testing with the following compiler: > > # gcc -v > Using built-in specs. > Target: i486-linux-gnu > Configured with: ../src/configure -v > --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr > --enable-shared --with-system-zlib --libexecdir=/usr/lib > --without-included-gettext --enable-threads=posix --enable-nls > --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu > --enable-libstdcxx-debug --enable-mpfr --with-tune=i686 > --enable-checking=release i486-linux-gnu Thread model: posix > gcc version 4.1.2 20061028 (prerelease) (Debian 4.1.1-19) > > Regards, > Stephan Creutz > ---------------------------------------------------------------------- > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV________________________________ > _______________ > XenAccess-devel mailing list > Xen...@li... > https://lists.sourceforge.net/lists/listinfo/xenaccess-devel - Bryan D. Payne Graduate Student, Computer Science Georgia Tech Information Security Center http://www.bryanpayne.org |
From: Stephan C. <ste...@in...> - 2006-12-04 12:32:31
|
Hi, when I try to compile any version (I tried 0.2 and the latest svn version) of xenaccess I get the following errors: make all-recursive make[1]: Entering directory `/home/stephan/xenaccess/libxa' Making all in xenaccess make[2]: Entering directory `/home/stephan/xenaccess/libxa/xenaccess' make[3]: Entering directory `/home/stephan/xenaccess/libxa/xenaccess' if /bin/sh ../libtool --tag=3DCC --mode=3Dcompile gcc -DHAVE_CONFIG_H -I. -I. -I.. - I.. -I/usr/local/include/xen -g -O2 -MT linux_domain_info.lo -MD -MP -MF ".dep s/linux_domain_info.Tpo" -c -o linux_domain_info.lo linux_domain_info.c; \ then mv -f ".deps/linux_domain_info.Tpo" ".deps/linux_domain_info.Plo"; else rm -f ".deps/linux_domain_info.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I/usr/local/include/xen -g -O2 -MT linux _domain_info.lo -MD -MP -MF .deps/linux_domain_info.Tpo -c linux_domain_info.c -fPIC -DPIC -o .libs/linux_domain_info.o In file included from linux_domain_info.c:34: /usr/include/stdlib.h:96: error: expected '=3D', ',', ';', 'asm' or '__attribute__ ' before '__BEGIN_NAMESPACE_STD' /usr/include/stdlib.h:140: error: expected '=3D', ',', ';', 'asm' or '__attribute_ _' before 'extern' /usr/include/stdlib.h:145: error: expected '=3D', ',', ';', 'asm' or '__attribute_ _' before 'extern' /usr/include/stdlib.h: In function 'atoi': /usr/include/stdlib.h:149: error: expected declaration specifiers before '__THRO W' /usr/include/stdlib.h:152: error: expected '=3D', ',', ';', 'asm' or '__attribute_ _' before '__THROW' /usr/include/stdlib.h:153: error: expected declaration specifiers before '__END_ NAMESPACE_STD' /usr/include/stdlib.h:167: error: expected declaration specifiers before '__END_ NAMESPACE_STD' /usr/include/stdlib.h:189: error: expected '=3D', ',', ';', 'asm' or '__attribute_ _' before '__THROW' /usr/include/stdlib.h:190: error: expected declaration specifiers before '__END_ NAMESPACE_C99' /usr/include/stdlib.h:282: error: expected '=3D', ',', ';', 'asm' or '__attribute_ _' before '__THROW' /usr/include/stdlib.h:285: error: expected '=3D', ',', ';', 'asm' or '__attribute_ _' before '__THROW' /usr/include/stdlib.h:290: error: expected '=3D', ',', ';', 'asm' or '__attribute_ _' before '__THROW' /usr/include/stdlib.h:297: error: expected '=3D', ',', ';', 'asm' or '__attribute_ _' before '__THROW' /usr/include/stdlib.h:302: error: expected declaration specifiers before '__exte nsion__' /usr/include/stdlib.h:310: error: expected declaration specifiers before '__exte nsion__' /usr/include/stdlib.h:491: error: expected declaration specifiers before '__BEGI N_NAMESPACE_STD' /usr/include/stdlib.h:495: error: expected '=3D', ',', ';', 'asm' or '__attribute_ _' before '__THROW' /usr/include/stdlib.h:496: error: expected declaration specifiers before '__END_ NAMESPACE_STD' [...] I use Debian Testing with the following compiler: # gcc -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=3Dc,c++,fortran,objc,obj-c++,treelang --prefix=3D/usr --enable-shared --with-system-zlib --libexecdir=3D/usr/lib --without-included-gettext --enable-threads=3Dposix --enable-nls --program-suffix=3D-4.1 --enable-__cxa_atexit --enable-clocale=3Dgnu --enable-libstdcxx-debug --enable-mpfr --with-tune=3Di686 --enable-checking=3Drelease i486-linux-gnu Thread model: posix gcc version 4.1.2 20061028 (prerelease) (Debian 4.1.1-19) Regards, Stephan Creutz |
From: Bryan D. P. <br...@th...> - 2006-10-26 18:43:56
|
Just a quick update on XenAccess... I have just checked code into subversion that removes the libvirt dependency (and, therefore, also removes the dependency on libxml2). This was done with the goal of making things simpler all around. The only remaining dependencies are installed when you install xen (libxc, libxenstore). Also note that the next release is just around the corner. I'm debugging the final pieces of hvm support right now. Once that's working, I'll push out v0.3. As always, feedback on desired features, bugs, and anything else is appreciated :-) Cheers, bryan - Bryan D. Payne Graduate Student, Computer Science Georgia Tech Information Security Center http://www.bryanpayne.org |
From: Bryan D. P. <br...@th...> - 2006-09-06 13:54:16
|
Very cool. Thanks for keeping me posted. And I'm glad that fixed the problem b/c I was still having trouble generating that problem over here. Sounds like it was just a case of a library not getting installed or uninstalled completely... -bryan On Sep 6, 2006, at 9:39 AM, Daniele Sgandurra wrote: > I've just installed libvirt version 0.14: it seems > that the problem is not present anymore. > Cheers - Bryan D. Payne Graduate Student, Computer Science Georgia Tech Information Security Center http://www.bryanpayne.org |
From: Daniele S. <da...@ya...> - 2006-09-06 13:40:54
|
I've just installed libvirt version 0.14: it seems that the problem is not present anymore. Cheers ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it |
From: Bryan D. P. <br...@th...> - 2006-09-05 13:25:08
|
> 2) Patch the current code to use proper types (pid_t, > pgd_t, void *, ptrint_t). I would prefer to go this route. It seems like the cleaner option in the long run. > What do you think? If you're willing to put a patch together for this, I'm happy to drop it into CVS. I actually have a 64-bit machine available for development & testing, but time often gets in the way. So I certainly appreciate any help you can provide in this area. Cheers, bryan - Bryan D. Payne Graduate Student, Computer Science Georgia Tech Information Security Center http://www.bryanpayne.org |
From: Tomas K. <to...@ji...> - 2006-09-05 12:58:49
|
Hi, the library is very i386 specific. Lots of addresses are just uint_32t which cause errors on 64bit architecture. I would like to port it on x86_64. I see two ways how this can be done: 1) Take x86_64 as another architecture supported by xenaccess. Add branch to e.g. xa_memory.c and implement functions such as linux64_access_kernel_symbol() with different prototype. 2) Patch the current code to use proper types (pid_t, pgd_t, void *, ptrint_t). What do you think? -- Tomas Kouba |
From: Daniele S. <da...@ya...> - 2006-09-01 09:51:28
|
>Could you provide some additional information on the versions of software that you are running? XenAccess = latest from SVN Xen = 3.0.2-2 libxml2 = 2.6.26 libvirt = 0.1.3 This is a snapshot of the output I have after the segmentation fault: ======= Memory map: ======== 00176000-00179000 r-xp 00000000 03:02 3600067 /usr/lib/libxenstore.so ... 0019a000-001ac000 r-xp 00000000 03:02 3592368 /usr/lib/libz.so.1.2.3 ... 00221000-00223000 r-xp 00000000 03:02 196446 /lib/libdl-2.4.so ... 002cd000-002d7000 r-xp 00000000 03:02 3582724 /usr/lib/libxenctrl.so.3.0.0 ... 00324000-00450000 r-xp 00000000 03:02 3572902 /usr/lib/libxml2.so.2.6.26 ... 0050b000-0050f000 r-xp 00000000 03:02 70097 /home/daniele/xen/xenaccess/current/libxenaccess.so ... 0052e000-00545000 r-xp 00000000 03:02 2456168 /lib/ld-2.4.so ... 0054f000-0055a000 r-xp 00000000 03:02 198509 /lib/libgcc_s-4.1.1-20060525.so.1 ... 00677000-00798000 r-xp 00000000 03:02 196439 /lib/libc-2.4.so ... 008b2000-008b3000 rwxp 0000f000 03:02 196464 /lib/libpthread-2.4.so ... 009e4000-009f5000 r-xp 00000000 03:02 3590456 /usr/local/lib/libvirt.so.0.1.3 ... 00e51000-00e75000 r-xp 00000000 03:02 196448 /lib/libm-2.4.so I really don't know what it could be, probably a misconfiguration when installing different versions of the same software while not updgrading the linked libraries, even if it seems they are all up-to-date. Thanks! __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it |
From: Bryan D. P. <br...@th...> - 2006-08-31 15:49:23
|
> The problem is that sometime everything just works > fine! > I hope that can help you! I've been trying to reproduce this on my machine without much luck. Each time, I just get the printout of 0 ... 99 and then the program exits (i.e., it appears to work just fine). Could you provide some additional information on the versions of software that you are running? XenAccess Xen Libvirt Libxml2 Thanks, bryan - Bryan D. Payne Graduate Student, Computer Science Georgia Tech Information Security Center http://www.bryanpayne.org |
From: Tomas K. <to...@ji...> - 2006-08-29 11:49:45
|
Hi, is there a reason why all xenaccess is compiled with -m32 option? I am trying to build it on FC5 on x86_64 architecture and ld complains a lot. If I remove the -m32 everything compiles ok. I am afraid of hidden problems that can show up later. -- Tomas Kouba |
From: Daniele S. <da...@ya...> - 2006-08-28 08:01:12
|
> > Have you been able to reproduce this problem without > the python > ctypes library? I've been trying these days to locate the problem: I don't know very well how to use ctypes. But I've been able to reproduce the same problem in C; the file is process-data.c: again, the "main" has been renamed to "process-data" and I've removed all the printf statements: -------------------------process-data.c------------------------- #include <stdlib.h> #include <string.h> #include <errno.h> #include <sys/mman.h> #include <stdio.h> #include "../xenaccess.h" #include "../xa_private.h" int process_data (int argc, char **argv) { xa_instance_t xai; xa_linux_taskaddr_t taskaddr; unsigned char *memory = NULL; uint32_t offset = 0; /* this is the domain ID that we are looking at */ uint32_t dom = atoi(argv[1]); /* This is the pid that we are looking at, passed as an argument on the command line. */ int pid = atoi(argv[2]); /* initialize the xen access library */ if (xa_init(dom, &xai) == XA_FAILURE){ perror("failed to init XenAccess library"); goto error_exit; } /* get the relavent addresses for this process */ if (xa_linux_get_taskaddr(&xai, pid, &taskaddr) == XA_FAILURE){ perror("failed to get task addresses"); goto error_exit; } /* grab the memory at the start of the code segment for this process and print it out */ memory = xa_access_user_virtual_address( &xai, taskaddr.start_code, &offset, pid); if (NULL == memory){ perror("failed to map memory"); goto error_exit; } error_exit: /* cleanup any memory associated with the XenAccess instance */ xa_destroy(&xai); /* sanity check to unmap shared pages */ if (memory) munmap(memory, XA_PAGE_SIZE); return 0; } int main (int argc, char **argv) { int i; for(i=0; i<100; i++) { printf("%d ", i); process_data(argc, argv); } return 0; } ------------------------------------------------------------------- [root@dhcp12 example]# xm list Name ID Mem(MiB) VCPUs State Time(s) Debian1 1 64 1 -b---- 12.7 Domain-0 0 419 1 r----- 74.4 [root@dhcp12 example]# ./run ./process-data 1 1 Entity: line 1: parser error : Start tag expected, '<' not found ^ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ERROR: could not parse xml data for domain id 1 *** glibc detected *** ./process-data: double free or corruption (!prev): 0x08ed3d30 *** ======= Backtrace: ========= /lib/libc.so.6[0xdd0d0a] /lib/libc.so.6(__libc_free+0x70)[0xdd3f48] ../libxenaccess.so(linux_get_kernel_name+0x127)[0xd6e287] ../libxenaccess.so(linux_predict_sysmap_name+0x1f)[0xd6e34f] ../libxenaccess.so(linux_system_map_symbol_to_address+0x28)[0xd6d7b8] ../libxenaccess.so(linux_access_kernel_symbol+0x75)[0xd6dfd5] ../libxenaccess.so(xa_access_kernel_symbol+0x34)[0xd6ca14] ../libxenaccess.so(helper_init+0xfb)[0xd6c88b] ../libxenaccess.so(xa_init+0x42)[0xd6c922] ./process-data[0x80486a2] ./process-data[0x804878f] /lib/libc.so.6(__libc_start_main+0xc6)[0xd8670e] ./process-data[0x80485a1] ..... The problem is that sometime everything just works fine! I hope that can help you! Thanks!!! Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com |
From: Bryan D. P. <br...@th...> - 2006-08-25 12:03:04
|
> One final point: I'm trying to use Xenaccess under > Python using ctypes library (it allows to load a C > library and call it from Python). A little disclaimer, I'm not very familiar with the ctypes library :-) So my thoughts below could be very wrong... > I've traced back the problem to the function > "linux_get_kernel_name": in fact, simply commenting > the last line before the return statement ("if > (xml_data) free(xml_data);"), fixed the problem, but > it's a brutal fix: in fact, if between the two calls a This sounds a lot like a memory corruption issue. The thing is, I'm not seeing where the corruption would be occurring by looking at the XenAccess code. One guess would be if python had a bad implementation of one of these libc functions. But that would be surprising to me. Have you been able to reproduce this problem without the python ctypes library? -bryan - Bryan D. Payne Graduate Student, Computer Science Georgia Tech Information Security Center http://www.bryanpayne.org |
From: Daniele S. <da...@ya...> - 2006-08-25 09:22:41
|
The fix is already in the > repository, in case > you'd like to try it out. Great, I've downloaded the latest files and now it works :) One final point: I'm trying to use Xenaccess under Python using ctypes library (it allows to load a C library and call it from Python). So, I've made a file called my_lib.c that contains your examples (that, instead of being "main" functions, are "normal" functions like: char **process_list(uint32_t dom, int *proc_num)), and than adding the line "SRCS += my_lib.c" to the Makefile and recompiling, it is possible to load libxenaccess.so from Python. I also add the line "LDFLAGS += -lxenctrl" in the Xenaccess Makefile or ctypes complained about the fact that some functions were undefined. The only problem I have, it's if I try to call the same function two times (like in the previous message), Python exits with something like: Entity: line 1: parser error : Start tag expected, '<' not found ERROR: could not parse xml data for domain id 1 linux_get_kernel_name free up memory *** glibc detected *** python: corrupted double-linked list: 0x09061a80 *** ======= Backtrace: ========= /lib/i686/nosegneg/libc.so.6[0x882907] /lib/i686/nosegneg/libc.so.6(__libc_free+0x79)[0x885fbe] ./libxenaccess.so(linux_get_kernel_name+0x135)[0xb1a495] ./libxenaccess.so(linux_predict_sysmap_name+0x2d)[0xb1a58d] .... I've traced back the problem to the function "linux_get_kernel_name": in fact, simply commenting the last line before the return statement ("if (xml_data) free(xml_data);"), fixed the problem, but it's a brutal fix: in fact, if between the two calls a call to a libvirt function is made (again, from Python), there is a similar error about xml "Entity: line 1: parser error : Start tag expected, '<' not found ". Hope that can help it! Cheers Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com |
From: Bryan D. P. <br...@th...> - 2006-08-24 12:44:13
|
Looks like you have uncovered a bug :-) I looked at it this morning and found the cause. I wasn't doing proper cleanup on the cache when xa_destroy was called. The fix is already in the repository, in case you'd like to try it out. Thanks for reporting this... -bryan On Aug 24, 2006, at 7:12 AM, Daniele Sgandurra wrote: > Hi! > I've tried to build a simple library, sort of a > wrapper for your examples (process-list, > process-data). It seems there are little problems when > calling two times the same function. For example, if I > modify the file process-list.c, in this way (I've > replaced the name "main" with "mainb" and created > another "main" that calls two times "mainb"): > > int mainb (int argc, char **argv) > { > xa_instance_t xai; > unsigned char *memory = NULL; > uint32_t offset, next_process, list_head; > char *name = NULL; > int pid = 0; > > ...... > } > > int main (int argc, char **argv) > { > printf("first\n"); > mainb(argc, argv); > printf("second\n"); > mainb(argc, argv); > return 0; > } > > I get a segmentation fault error: > > [examples]# ./run ./process-list 1 > first > [ 1] init > [ 2] migration/0 > [ 3] ksoftirqd/0 > [ 4] watchdog/0 > [ 5] events/0 > [ 6] khelper > [ 7] kthread > [ 8] xenwatch > [ 9] xenbus > [ 16] kblockd/0 > [ 20] khubd > [ 58] pdflush > [ 59] pdflush > [ 61] aio/0 > [ 60] kswapd0 > [ 577] kseriod > [ 657] kpsmoused > [ 660] nash-hotplug > [ 678] kjournald > [ 1098] syslogd > [ 1104] klogd > [ 1148] exim4 > [ 1154] inetd > [ 1163] sshd > [ 1180] atd > [ 1183] cron > [ 1198] login > [ 1199] getty > [ 1200] getty > [ 1201] getty > [ 1202] getty > [ 1203] getty > [ 1204] bash > [ 1218] sshd > [ 1222] sftp-server > second > ./run: line 4: 6347 Segmentation fault $@ > [examples]# > > I'm using Xenaccess 0.2 on Fedora 5, with Xen 3.0.2-2. > I 've tried to find the problem and probably it's > something with xa_access_kernel_symbol routine. > Thanks > > > > Chiacchiera con i tuoi amici in tempo reale! > http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com > > ---------------------------------------------------------------------- > --- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > XenAccess-devel mailing list > Xen...@li... > https://lists.sourceforge.net/lists/listinfo/xenaccess-devel - Bryan D. Payne Graduate Student, Computer Science Georgia Tech Information Security Center http://www.bryanpayne.org |
From: Daniele S. <da...@ya...> - 2006-08-24 11:12:26
|
Hi! I've tried to build a simple library, sort of a wrapper for your examples (process-list, process-data). It seems there are little problems when calling two times the same function. For example, if I modify the file process-list.c, in this way (I've replaced the name "main" with "mainb" and created another "main" that calls two times "mainb"): int mainb (int argc, char **argv) { xa_instance_t xai; unsigned char *memory = NULL; uint32_t offset, next_process, list_head; char *name = NULL; int pid = 0; ...... } int main (int argc, char **argv) { printf("first\n"); mainb(argc, argv); printf("second\n"); mainb(argc, argv); return 0; } I get a segmentation fault error: [examples]# ./run ./process-list 1 first [ 1] init [ 2] migration/0 [ 3] ksoftirqd/0 [ 4] watchdog/0 [ 5] events/0 [ 6] khelper [ 7] kthread [ 8] xenwatch [ 9] xenbus [ 16] kblockd/0 [ 20] khubd [ 58] pdflush [ 59] pdflush [ 61] aio/0 [ 60] kswapd0 [ 577] kseriod [ 657] kpsmoused [ 660] nash-hotplug [ 678] kjournald [ 1098] syslogd [ 1104] klogd [ 1148] exim4 [ 1154] inetd [ 1163] sshd [ 1180] atd [ 1183] cron [ 1198] login [ 1199] getty [ 1200] getty [ 1201] getty [ 1202] getty [ 1203] getty [ 1204] bash [ 1218] sshd [ 1222] sftp-server second ./run: line 4: 6347 Segmentation fault $@ [examples]# I'm using Xenaccess 0.2 on Fedora 5, with Xen 3.0.2-2. I 've tried to find the problem and probably it's something with xa_access_kernel_symbol routine. Thanks Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com |
From: Steve B. <st...@at...> - 2006-08-11 20:34:24
|
> Interesting. So it looks to me like these values are wrong. > Specifically, the value for swapper_pg_dir should match what you see > in the System.map file. It looks like the value is getting truncated > somewhere (perhaps just formatted wrong in printf?). Also, > XA_PAGE_OFFSET is defined in xenaccess.h and should not be zero > (again, perhaps a printf formatting issue?). Silly me, it was a printf formatting mistake as you suspected (%hx instead of %x had cut off the first 4 hex digits). So now the output is: # ./run ./module_list 16 dom!=NULL kernel_name=hvm sysmap=/boot/System.map-2.6.17 swapper_pg_dir=c044e000 XA_PAGE_OFFSET=c00000000 memory=NULL failed to init XenAccess library: Bad address > If the values are correct, then I'm a little confused as I would have > expected it to work from there. But I'll research how xen handles > memory in a HVM domain while you look into the variable values. > Hopefully one of us will find something :-) My above output is using a Knoppix DVD as a guest domain. I also tried A vanilla Fedora Core 5 install as a guest and got the same results (the only difference is a different System.map name and a different address for Swapper_pg_dir). So possibly there must be a fundamental difference in how HVM domain memory is treated, which I take it is what you're looking into now. :) - Steve |
From: Bryan D. P. <br...@th...> - 2006-08-11 03:47:01
|
> This seems to be the crux. HVM domains do NOT boot off a kernel > stored in > dom0. This is why you can run a Windows guest for example. It > acts more > like VMware: all the files are in the guest's image, including the / > boot > directory. The image is partitioned as if it were a separate hard > drive, > with separate /boot and / partitions and file systems. Ok, this makes sense. > I now see that XenAccess opens the System map file on the host, and > I have > no idea how to have it grab a file from inside the guest. So I > copied the > guest's System.map onto the host and with some hacking of your code > and some Yes, I think that this is the only way (at least for the near term). > extra printf's I've gotten this far: > > # ./run ./module_list 16 > dom!=NULL > kernel_name=hvm > sysmap=/boot/System.map-2.6.17 > swapper_pg_dir=e000 > XA_PAGE_OFFSET=0 > memory=NULL > failed to init XenAccess library: Bad address > > As you say, where are we at now? I don't know if > swapper_pg_dir=e000 is > correct of if it should have been c044e000. I also don't know if the > XA_PAGE_OFFSET should be 0 or not. It seems that either: > > (1) these values are correct and the method you/libvirt use to get > memory > from a guest only works for paravirtualized VMs, or > (2) these values are incorrect, and the memory access method may or > may not > work for HVMs. Interesting. So it looks to me like these values are wrong. Specifically, the value for swapper_pg_dir should match what you see in the System.map file. It looks like the value is getting truncated somewhere (perhaps just formatted wrong in printf?). Also, XA_PAGE_OFFSET is defined in xenaccess.h and should not be zero (again, perhaps a printf formatting issue?). > Either way, where do you think I should go from here? The next step is to figure out why those two values appear wrong in the printout. If it's just printf, then that's simple. But if the values are wrong, then we will need to figure out why. If the values are correct, then I'm a little confused as I would have expected it to work from there. But I'll research how xen handles memory in a HVM domain while you look into the variable values. Hopefully one of us will find something :-) Cheers, bryan - Bryan D. Payne Graduate Student, Computer Science Georgia Tech Information Security Center http://www.bryanpayne.org |
From: Steve B. <st...@at...> - 2006-08-09 21:13:59
|
> The error that you are getting is (most likely) because XenAccess > cannot find the System map file. Looking at the xml output that you > provided, it looks as if libvirt doesn't have guest kernel > information for an HVM domain. Normally, XenAccess would use this > information to guess the location of the System map file. However, > without this information, it won't find the System map file. > > One question, for HVM domains do you still boot off a kernel stored > in dom0? If so, I wonder why the kernel info isn't included in > libvirt's output. If not, then we may have to manually install the > System map file into dom0 and find some way to point XenAccess to the > appropriate file. This seems to be the crux. HVM domains do NOT boot off a kernel stored in dom0. This is why you can run a Windows guest for example. It acts more like VMware: all the files are in the guest's image, including the /boot directory. The image is partitioned as if it were a separate hard drive, with separate /boot and / partitions and file systems. I now see that XenAccess opens the System map file on the host, and I have no idea how to have it grab a file from inside the guest. So I copied the guest's System.map onto the host and with some hacking of your code and some extra printf's I've gotten this far: # ./run ./module_list 16 dom!=NULL kernel_name=hvm sysmap=/boot/System.map-2.6.17 swapper_pg_dir=e000 XA_PAGE_OFFSET=0 memory=NULL failed to init XenAccess library: Bad address These the last few debug statements are from helper_init() inside of xa_core.c. I looked up swapper_pg_dir in the System.map and it's at 0xc044e000. What fails is the call to linux_access_physical_address(). > Once we have the System map file, we can see where we are at :-) > But, I'm hopeful that the critical functions that I use from Xen will > behave the same in HVM domains. If that turns out to be the case, > then we are very close to getting this working. As you say, where are we at now? I don't know if swapper_pg_dir=e000 is correct of if it should have been c044e000. I also don't know if the XA_PAGE_OFFSET should be 0 or not. It seems that either: (1) these values are correct and the method you/libvirt use to get memory from a guest only works for paravirtualized VMs, or (2) these values are incorrect, and the memory access method may or may not work for HVMs. Either way, where do you think I should go from here? Thanks, - Steve |
From: Bryan D. P. <br...@th...> - 2006-08-05 01:33:51
|
> I previously reported on this list that xenaccess-0.1 with > libvirt-0.1.1 did > not work with Xen HVM guests. Here is the error it generated at > the time: Thanks for continuing to look into this :-) > # ./run ./module-list 8 > ERROR: failed to lookup 'swapper_pg_dir' address > failed to init XenAccess library: Bad address > > > Now we're getting into stuff I can't easily understand. I have no > idea if > an how we're getting a hold of the guest's System.map-2.6.17 file. > And if > we are, I don't know if or how we're getting the address for > swapper_pg_dir. The error that you are getting is (most likely) because XenAccess cannot find the System map file. Looking at the xml output that you provided, it looks as if libvirt doesn't have guest kernel information for an HVM domain. Normally, XenAccess would use this information to guess the location of the System map file. However, without this information, it won't find the System map file. Note: here's the precise list of potential causes for that error message in what I believe is the order of likelihood for each error -- most likely first (Note to self, I should probably enable more descriptive error messages!): * cannot find system map file * cannot find 'swapper_pg_dir' symbol in the System map file * cannot allocate enough memory to look for the symbol in the System map file One question, for HVM domains do you still boot off a kernel stored in dom0? If so, I wonder why the kernel info isn't included in libvirt's output. If not, then we may have to manually install the System map file into dom0 and find some way to point XenAccess to the appropriate file. > I'm not looking for a general solution just yet. I simply want to > proof-of-concept the ability to get module lists from an HVM. > Bryan, can > you give me any ideas on how to proceed? I'm attaching an .rtf > that, if > opened in MS Word, compares the xml formats for paravirtualized and > hvms, > for what it's worth. Oh, and thanks for version 0.2! I think that the first step is to think about the question that I asked above. We need to get access to the correct System map file for the HVM domain. It appears that my normal way of getting that information may not work for HVM domains. Once we have the System map file, we can see where we are at :-) But, I'm hopeful that the critical functions that I use from Xen will behave the same in HVM domains. If that turns out to be the case, then we are very close to getting this working. Cheers, bryan - Bryan D. Payne Graduate Student, Computer Science Georgia Tech Information Security Center http://www.bryanpayne.org |
From: Steve B. <st...@at...> - 2006-08-04 22:42:56
|
I previously reported on this list that xenaccess-0.1 with libvirt-0.1.1 did not work with Xen HVM guests. Here is the error it generated at the time: # ./run ./module-list libvir: Xen Daemon error : internal error domain information incomplete, missing kernel ERROR: failed to get domain info for domain id 1 ERROR: could not get kernel name for domain id 1 failed to init XenAccess library: bad address Now I'm trying XenAccess 0.2 along with libvirt-0.1.3. Since libvirt states the following about HVM domains, I was hoping things would work. Here are the relevant changes from the libvirt changelog: * docs/format.html docs/libvir.html docs/news.html: updated the XML format documentation to cover the new HVM domains. * src/xend_internal.c src/xml.c: patches from Jim Fehlig for HVM guests, plus XML format changes and merge from Mark McLoughlin However, rebuilding libvirt and xenaccess I get a new error: # ./run ./module-list 8 Entity: line 7: parser error : Unescaped '<' not allowed in attributes values <boot dev='/dev/cdro </os> ^ Entity: line 7: parser error : attributes construct error <boot dev='/dev/cdro </os> ^ Entity: line 7: parser error : Couldn't find end of Start Tag boot line 7 <boot dev='/dev/cdro </os> ERROR: could not parse xml data for domain id 8 ERROR: could not get kernel name for domain id 8 ERROR: failed to lookup 'swapper_pg_dir' address failed to init XenAccess library: Bad address Now we're getting closer. I fixed a bug in a libvirt source file (xend_internal.c) and got a bit further: # ./run ./module-list 8 ERROR: could not get kernel name for domain id 8 ERROR: failed to lookup 'swapper_pg_dir' address failed to init XenAccess library: Bad address So I modifed xenaccess's file linux_domain_info.c to account for hvms, knowing I was running vmlinuz-2.6.17 inside my VM: # ./run ./module-list 8 ERROR: failed to lookup 'swapper_pg_dir' address failed to init XenAccess library: Bad address Now we're getting into stuff I can't easily understand. I have no idea if an how we're getting a hold of the guest's System.map-2.6.17 file. And if we are, I don't know if or how we're getting the address for swapper_pg_dir. I'm not looking for a general solution just yet. I simply want to proof-of-concept the ability to get module lists from an HVM. Bryan, can you give me any ideas on how to proceed? I'm attaching an .rtf that, if opened in MS Word, compares the xml formats for paravirtualized and hvms, for what it's worth. Oh, and thanks for version 0.2! Thanks, Steve Brueckner, ATC-NY |
From: Daniele S. <da...@ya...> - 2006-08-01 09:12:21
|
> I'll go ahead and push out the 0.2 release this > evening. > I've just downloaded the 0.2 release, and now everything is ok. In fact the addresses are the same as shown by other utilities. Cheers Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com |