Thread: [XenAccess-devel] What's allocated on top 1M region of domU?
Status: Beta
Brought to you by:
bdpayne
From: Ryo K. <kan...@hp...> - 2007-12-02 10:12:33
Attachments:
phys-access-from-head.c
|
Hi all. I'm now try to read and write puseud physical memory of domU from Dom0 with xa_access_physical_address() using my snippet code(phys-access-from-head.c). #for writ access, I modified xa_access_physical_address to access memory with PROT_WRITE flag. Now, I'm succeeded read and writing almost of the memory. But It fails when I try to access top 1M region and some bit regions. To be precise, xc_map_foreign_range() of libxc returns error code 14. What's allocated on top 1M region of domU? #and , Can I get a document about memory allocation of dom0 and DomU somewhere? regards. ---environment---- xen: Xen 3.1.0 xenaccess: head revision of subversion repository processor type: 32bit PAE Entire Memory: 2G DomU type: paravirtualized DomU Memory size: 512M ---using snippet--- #2 is DomU domain number, 0x0c000000 is arbitrary address accessible ./phys-access-from-head.out 2 0x0c000000 **************************************** HPCS lab 4th grade student of Colledge of Information Science, University of Tsukuba Ryo Kanbayashi -- **************************************** 筑波大学第三学群情報学類4年 HPCS研究室 神林 亮 |
From: Bryan D. P. <br...@th...> - 2007-12-02 14:33:40
|
> Now, I'm succeeded read and writing almost of the memory. But > It fails when I try to access top 1M region and some bit regions. > To be precise, xc_map_foreign_range() of libxc returns error code 14. This is where Xen locates itself. So that would explain why it is not letting you map it. The rest of the guest memory should be laid out as you would expect for whatever operating system you are looking at. > #and , Can I get a document about memory allocation of dom0 and DomU > somewhere? I'm not sure if I understand this question. If you are curious about how Xen allocates the memory, then I don't know of any good documentation on that. If you are curious about how the guest OS uses its memory, then you can check out a reference book about the operating system (e.g., Windows Internals or Understanding the Linux Kernel). -bryan -- Bryan D. Payne Graduate Student, Computer Science Georgia Tech Information Security Center http://www.bryanpayne.org |
From: Ryo K. <kan...@hp...> - 2007-12-03 16:43:51
|
very very thanks Bryan :-) #I've tried to find a answer of this question for a week. >> Now, I'm succeeded read and writing almost of the memory. But >> It fails when I try to access top 1M region and some bit regions. >> To be precise, xc_map_foreign_range() of libxc returns error code 14. >> > > This is where Xen locates itself. So that would explain why it is not > letting you map it. The rest of the guest memory should be laid out > as you would expect for whatever operating system you are looking at. > > Though I mean pseudo physical memory, this answer is correct? #I know xen is replaced on virtual address space of DomU. Ok. If your answer is what I intended, top 1M region problem is solved. But there are some bit regions I can't access. What are they? #some regions can't be accessed continuously and some regions can't be accessed often. #incidentally, I access to domU while it being paused. <javascript:goWordLink("incidentally")> >> #and , Can I get a document about memory allocation of dom0 and DomU >> somewhere? >> > > I'm not sure if I understand this question. If you are curious about > how Xen allocates the memory, then I don't know of any good > documentation on that. If you are curious about how the guest OS uses > its memory, then you can check out a reference book about the > operating system (e.g., Windows Internals or Understanding the Linux > Kernel). > > I meant the former. thank you for your suggestion :-) regards. **************************************** HPCS lab 4th grade student of Colledge of Information Science, University of Tsukuba Ryo Kanbayashi |
From: Bryan D. P. <br...@th...> - 2007-12-03 22:31:13
|
> Though I mean pseudo physical memory, this answer is correct? > #I know xen is replaced on virtual address space of DomU. Ahh yes, this is just for the virtual address spaces. I'm not sure what you would be seeing at the top of the physical address space, unless that just happens to be how Xen implements its location in the domain. I'd have to poke through the Xen source code to know for sure... > Ok. If your answer is what I intended, top 1M region problem is solved. > But there are some bit regions I can't access. What are they? > #some regions can't be accessed continuously and some regions can't be > accessed often. > #incidentally, I access to domU while it being paused. It is possible that there are regions of physical memory that you won't always be able to access. This is likely very dependent on your system, but I can imagine you seeing this type of behavior when memory is swapped to disk, for example. If you can find the page table entries associated with these "missing" pieces of memory, you can check the flags in the PTE and probably learn more about why the memory is not there. Just scanning through all physical addresses offers no guarantee that you will be able to access every page. This is one reason why it is usually more useful to access memory via virtual address instead of physical address. -bryan -- Bryan D. Payne Graduate Student, Computer Science Georgia Tech Information Security Center http://www.bryanpayne.org |