hello all, i am new to xen-development and currently trying to understand memory mgmt in hvm mode I am writing a hypercall which takes input of virtual address of domu. hypercall translate this address to machine and return 4kb page from thereafter. Inside hypercall, i m using paging_gva_to_gfn function but it returns -1 instead of returning valid gfn. what wrong with my approach. --------------------------------- Looking for last minute shopping deals? Find them fast with Yahoo! Search. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
At 04:54 -0800 on 29 Jan (1201582491), rajneesh rana wrote:> i am new to xen-development and currently trying to understand memory mgmt in hvm mode > I am writing a hypercall which takes input of virtual address of domu. hypercall translate this address to machine and return 4kb page from thereafter. > Inside hypercall, i m using paging_gva_to_gfn function but it returns -1 instead of returning valid gfn. > > what wrong with my approach.It should work, though I''m not sure that any other code calls paging_gva_to_gfn() with v != current. It will depend on the hardware you run on whether the function called is actually hap_gva_to_gfn_<foo> or sh_gva_to_gfn; you could try instrumenting with printk or otherwise. Cheers, Tim. -- Tim Deegan <Tim.Deegan@citrix.com> Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
thanx for suggestion printk trace shows that it using sh_gva_to_gfn. Inside guest_walk_to_gfn, a call to function guest_l1e_get_flags returns 0. I think it work only for v==current. Is there any other approach that i can take. you mentions about hap_gva_to_gfn. When hvm uses this hap_gva_to_gfn depending upon hardware. regards rajneesh rana Tim Deegan <Tim.Deegan@citrix.com> wrote: At 04:54 -0800 on 29 Jan (1201582491), rajneesh rana wrote:> i am new to xen-development and currently trying to understand memory mgmt in hvm mode > I am writing a hypercall which takes input of virtual address of domu. hypercall translate this address to machine and return 4kb page from thereafter. > Inside hypercall, i m using paging_gva_to_gfn function but it returns -1 instead of returning valid gfn. > > what wrong with my approach.It should work, though I''m not sure that any other code calls paging_gva_to_gfn() with v != current. It will depend on the hardware you run on whether the function called is actually hap_gva_to_gfn_ or sh_gva_to_gfn; you could try instrumenting with printk or otherwise. Cheers, Tim. -- Tim Deegan Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------------------------- Never miss a thing. Make Yahoo your homepage. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
At 05:28 -0800 on 30 Jan (1201670925), rajneesh rana wrote:> printk trace shows that it using sh_gva_to_gfn. Inside > guest_walk_to_gfn, a call to function guest_l1e_get_flags returns 0.That''s fine; it just means there was nothing mapped at that address in the guest pagetables. If it gets that far, then it read the l2e OK. What address are you using? Have you compared it to what a pagetable walk inside the guest OS returns? Tim. -- Tim Deegan <Tim.Deegan@citrix.com> Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
thanks for reply Tim Deegan <Tim.Deegan@citrix.com> wrote: At 05:28 -0800 on 30 Jan (1201670925), rajneesh rana wrote:> printk trace shows that it using sh_gva_to_gfn. Inside > guest_walk_to_gfn, a call to function guest_l1e_get_flags returns 0.That''s fine; it just means there was nothing mapped at that address in the guest pagetables. If it gets that far, then it read the l2e OK. What address are you using? I am running xp as domu and using va 0xc0300000 where it maps its pde and i think this page should be present and mapped Have you compared it to what a pagetable walk inside the guest OS returns? sir, can you be little descriptive here. I didn''t get your point here. Tim. -- Tim Deegan Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.] regards rajneesh rana --------------------------------- Never miss a thing. Make Yahoo your homepage. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
At 06:44 -0800 on 30 Jan (1201675491), rajneesh rana wrote:> I am running xp as domu and using va 0xc0300000 where it maps its pde > and i think this page should be present and mappedHave you checked, from inside Windows, that there is something mapped there? Also, if Windows is running in PAE mode, the pde linear map entry is at 0xc0600000. Cheers, Tim. -- Tim Deegan <Tim.Deegan@citrix.com> Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel