From: Wei Liu <wei.liu2@citrix.com>
To: lmingcsce <Ming.Aaron.Liu@gmail.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
wei.liu2@citrix.com
Subject: Re: Translate virtual address to physical address
Date: Sun, 1 Jan 2012 11:51:27 +0000 [thread overview]
Message-ID: <1325418687.24422.36.camel@liuw-desktop> (raw)
In-Reply-To: <1325368336020-5112670.post@n5.nabble.com>
On Sat, 2011-12-31 at 21:52 +0000, lmingcsce wrote:
> Hi everyone, I'm working on a research project now and encounter a problem
> like this:
> I establish a new array in the tools directory and pass the address of this
> array to the hypervisor. I want to know how can I translate the virtual
> address of the array to the machine address. In this way, the hypervisor can
> modify the values in this array.
> Thanks for your help.
>
Establishing a new array in the tools *directory*? I presume the
"directory" is superfluous.
You can take a look at some hypercall implementations, e.g. multicall.
Example code can be found at xc_minios.c:minios_privcmd_hypercall and
multicall.c:do_multicall .
One thing I want to remind you is that you don't have to translate
virtual address to machine address before passing it to hypervisor.
copy_from_guest can handle that for you. But you do need to define
GUEST_HANDLE for your hypercall. (Again, check multicall implementation
for details.)
Wei.
next prev parent reply other threads:[~2012-01-01 11:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-31 21:52 Translate virtual address to physical address lmingcsce
2012-01-01 11:51 ` Wei Liu [this message]
2012-01-01 14:59 ` lmingcsce
2012-01-01 15:22 ` Wei Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1325418687.24422.36.camel@liuw-desktop \
--to=wei.liu2@citrix.com \
--cc=Ming.Aaron.Liu@gmail.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).