From: rajneesh rana Subject: Re: address translation in hvm mode Date: Wed, 30 Jan 2008 05:28:45 -0800 (PST) Message-ID: <588223.93343.qm@web50807.mail.re2.yahoo.com> References: <20080129155839.GA24771@york.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0774506521==" Return-path: In-Reply-To: <20080129155839.GA24771@york.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Tim Deegan Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --===============0774506521== Content-Type: multipart/alternative; boundary="0-1483300008-1201699725=:93343" Content-Transfer-Encoding: 8bit --0-1483300008-1201699725=:93343 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 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. --0-1483300008-1201699725=:93343 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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. hy percall 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. --0-1483300008-1201699725=:93343-- --===============0774506521== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0774506521==--