[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] xen_cr3_to_pfn

  • To: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "Nimgaonkar, Satyajeet" <SatyajeetNimgaonkar@xxxxxxxxxx>
  • Date: Tue, 10 May 2011 20:37:48 +0000
  • Accept-language: en-US
  • Delivery-date: Tue, 10 May 2011 13:38:48 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcwPSsmMx/ajnel1QCK2fsLO03uodA==
  • Thread-topic: xen_cr3_to_pfn

    I am trying to read the value of cr3 from a VCPU assigned to a Dom U. I am invoking a custom hypercall and then attempting to read the value of cr3 in the hypercall handler. Below is the code of my hypercall handler.
Here I am creating an object of the vcpu_guest_context and trying to read the value of ctrlreg[3] using xen_cr3_to_pfn macro. But I am getting the value of this (i.e. pgdaddr) as 0. Can anyone please tell me what am I doing wrong here.??
I also found a function called read_cr3(). And I am getting some 8 bit values for this function e.g. 27ca4000. Does this look right??
Also then what is the difference between read_cr3 and xen_cr3_to_pfn. I read in some documentation that read_cr3 is not reliable hence use xen_cr3_to_pfn.

unsigned long CR3;
unsigned long pgdaddr;
vcpu_guest_context_t ctx;

void do_jeet1(void){  

   printk ("Successfull Hypercall made to __HYPERVISOR_jeet1\n");  
   CR3 =  read_cr3();
   pgdaddr = xen_cr3_to_pfn(ctx.ctrlreg[3]);
   printk ("CR3:%lx\n", CR3);
   printk ("PGDADDR:%lx\n", pgdaddr);



Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.