Sai Suresh
2005-May-12 08:59 UTC
[Xen-devel] accessing domain''s page contents from hypervisor
Hi, I was trying to read the contents of a domain''s L1 page table page from hypervisor. The system reboots whenever I dereference the contents of a page. I use the map_domain_mem and unmap_domain_mem functions before and after I dereference it. Any suggestions on the possible reasons would be really helpful. Thanks, Sai /*----------------------code---start------------------------------*/ unsigned long * pg; int i; list_for_each_entry(page, &d->page_list, list) { if ( (page->u.inuse.type_info & PGT_type_mask) == PGT_l1_page_table){ pg = (unsigned long *) map_domain_mem(domain_id); for(i=0; i<1024; i++) { if( ( pg != NULL) && (pg[i] & 0x00000041) ) count++; } } unmap_domain_mem(pg); } /*----------------------code---end------------------------------*/ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Pratt
2005-May-12 10:45 UTC
RE: [Xen-devel] accessing domain''s page contents from hypervisor
> I was trying to read the contents of a domain''s L1 page table > page from hypervisor. > The system reboots whenever I dereference the contents of a page. > I use the map_domain_mem and unmap_domain_mem functions > before and after I dereference it. > Any suggestions on the possible reasons would be really helpful.map_domain_mem takes a machine address Ian> /*----------------------code---start------------------------------*/ > unsigned long * pg; > int i; > list_for_each_entry(page, &d->page_list, list) > { > if ( (page->u.inuse.type_info & PGT_type_mask) == > PGT_l1_page_table){ > > pg = (unsigned long *) map_domain_mem(domain_id); > for(i=0; i<1024; i++) { > if( ( pg != NULL) && (pg[i] & 0x00000041) ) > count++; > } > } > unmap_domain_mem(pg); > } > /*----------------------code---end------------------------------*/ > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Pradheep K E
2005-May-12 10:50 UTC
Re: [Xen-devel] accessing domain''s page contents from hypervisor
I have seen a very similar situation too. When I tried to dereference a domain''s page from Xen, after mapping it to a virtual address is Xen, my machine also booted. I think, this means some locked data structure is being accessed. Anyone, any ideas? ---------------------------------------------------------------------------------------------------> Hi,I was trying to read the contents of a domain''s L1 page table page from hypervisor. The system reboots whenever I dereference the contents of a page. I use the map_domain_mem and unmap_domain_mem functions before and after I dereference it. Any suggestions on the possible reasons would be really helpful. Thanks, Sai /*----------------------code---start------------------------------*/ unsigned long * pg; int i; list_for_each_entry(page, &d->page_list, list) { if ( (page->u.inuse.type_info & PGT_type_mask) == PGT_l1_page_table){ pg = (unsigned long *) map_domain_mem(domain_id); for(i=0; i<1024; i++) { if( ( pg != NULL) && (pg[i] & 0x00000041) ) count++; } } unmap_domain_mem(pg); } /*----------------------code---end------------------------------*/ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Sai Suresh
2005-May-12 15:45 UTC
Re: [Xen-devel] accessing domain''s page contents from hypervisor
Actually, I was passing the machine address in that variable :) I was using the code to debug, and didnt bother to change the variable name. Its type is unsigned long. It seems to contain a valid machine address, as it fell in the range between alloc_start and alloc_end that is allocated to a domain. On 5/12/05, Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk> wrote:> > > > I was trying to read the contents of a domain''s L1 page table > > page from hypervisor. > > The system reboots whenever I dereference the contents of a page. > > I use the map_domain_mem and unmap_domain_mem functions > > before and after I dereference it. > > Any suggestions on the possible reasons would be really helpful. > > map_domain_mem takes a machine address > > Ian > > > /*----------------------code---start------------------------------*/ > > unsigned long * pg; > > int i; > > list_for_each_entry(page, &d->page_list, list) > > { > > if ( (page->u.inuse.type_info & PGT_type_mask) => > PGT_l1_page_table){ > > > > pg = (unsigned long *) map_domain_mem(domain_id); > > for(i=0; i<1024; i++) { > > if( ( pg != NULL) && (pg[i] & 0x00000041) ) > > count++; > > } > > } > > unmap_domain_mem(pg); > > } > > /*----------------------code---end------------------------------*/ > > > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Mark Williamson
2005-May-12 15:57 UTC
Re: [Xen-devel] accessing domain''s page contents from hypervisor
Are you sure you weren''t passing a domain "physical" address rather than a real "machine" address? Cheers, Mark On Thursday 12 May 2005 16:45, Sai Suresh wrote:> Actually, I was passing the machine address in that variable :) I was using > the code to debug, and didnt bother to change the variable name. Its type > is unsigned long. It seems to contain a valid machine address, as it fell > in the range between alloc_start and alloc_end that is allocated to a > domain. > > On 5/12/05, Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk> wrote: > > > I was trying to read the contents of a domain''s L1 page table > > > page from hypervisor. > > > The system reboots whenever I dereference the contents of a page. > > > I use the map_domain_mem and unmap_domain_mem functions > > > before and after I dereference it. > > > Any suggestions on the possible reasons would be really helpful. > > > > map_domain_mem takes a machine address > > > > Ian > > > > > /*----------------------code---start------------------------------*/ > > > unsigned long * pg; > > > int i; > > > list_for_each_entry(page, &d->page_list, list) > > > { > > > if ( (page->u.inuse.type_info & PGT_type_mask) => > > PGT_l1_page_table){ > > > > > > pg = (unsigned long *) map_domain_mem(domain_id); > > > for(i=0; i<1024; i++) { > > > if( ( pg != NULL) && (pg[i] & 0x00000041) ) > > > count++; > > > } > > > } > > > unmap_domain_mem(pg); > > > } > > > /*----------------------code---end------------------------------*/_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel