Re: [XenAccess-devel] small patch
Status: Beta
Brought to you by:
bdpayne
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 |