All of lore.kernel.org
 help / color / mirror / Atom feed
* accessing domain's page contents from hypervisor
@ 2005-05-12  8:59 Sai Suresh
  0 siblings, 0 replies; 5+ messages in thread
From: Sai Suresh @ 2005-05-12  8:59 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 795 bytes --]

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------------------------------*/

[-- Attachment #1.2: Type: text/html, Size: 1621 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: accessing domain's page contents from hypervisor
@ 2005-05-12 10:45 Ian Pratt
  2005-05-12 15:45 ` Sai Suresh
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Pratt @ 2005-05-12 10:45 UTC (permalink / raw)
  To: Sai Suresh, xen-devel

  
> 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------------------------------*/
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: accessing domain's page contents from hypervisor
@ 2005-05-12 10:50 Pradheep K E
  0 siblings, 0 replies; 5+ messages in thread
From: Pradheep K E @ 2005-05-12 10:50 UTC (permalink / raw)
  To: xen-devel

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------------------------------*/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: accessing domain's page contents from hypervisor
  2005-05-12 10:45 Ian Pratt
@ 2005-05-12 15:45 ` Sai Suresh
  2005-05-12 15:57   ` Mark Williamson
  0 siblings, 1 reply; 5+ messages in thread
From: Sai Suresh @ 2005-05-12 15:45 UTC (permalink / raw)
  To: Ian Pratt; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1312 bytes --]

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------------------------------*/
> >
> >
>

[-- Attachment #1.2: Type: text/html, Size: 2441 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: accessing domain's page contents from hypervisor
  2005-05-12 15:45 ` Sai Suresh
@ 2005-05-12 15:57   ` Mark Williamson
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Williamson @ 2005-05-12 15:57 UTC (permalink / raw)
  To: xen-devel, Sai Suresh; +Cc: Ian Pratt

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------------------------------*/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-05-12 15:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-12  8:59 accessing domain's page contents from hypervisor Sai Suresh
  -- strict thread matches above, loose matches on Subject: below --
2005-05-12 10:45 Ian Pratt
2005-05-12 15:45 ` Sai Suresh
2005-05-12 15:57   ` Mark Williamson
2005-05-12 10:50 Pradheep K E

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.