All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arun Sharma <arun.sharma@intel.com>
To: Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk>
Cc: "Ling, Xiaofeng" <xiaofeng.ling@intel.com>,
	xen-devel <xen-devel@lists.xensource.com>,
	"Yu, Ke" <ke.yu@intel.com>
Subject: Re: passing hypercall parameters by pointer
Date: Wed, 17 Aug 2005 14:07:08 -0700	[thread overview]
Message-ID: <4303A6FC.6040601@intel.com> (raw)
In-Reply-To: <mailman.1124311483.4826@unix-os.sc.intel.com>

Ian Pratt wrote:
>>Many Xen hypercalls pass mlocked pointers as parameters for 
>>both input and output. For example, xc_get_pfn_list() is a 
>>nice one with multiple levels of structures/mlocking.
>>
>>Considering just the tools for the moment, those pointers are 
>>userspace addresses. Ultimately the hypervisor ends up with 
>>that userspace address, from which it reads and writes data. 
>>This is OK for x86, since userspace, kernel, and hypervisor 
>>all share the same virtual address space (and userspace has 
>>carefully mlocked the relevent memory).

This is a problem even on x86 for VMX domains which execute hypercalls 
because of para virtualized device drivers.

>>
>>On PowerPC though, the hypervisor runs in real mode (no MMU 
>>translation).  
>>Unlike x86, PowerPC exceptions arrive in real mode, and also 
>>PowerPC does not force a TLB flush when switching between 
>>real and virtual modes. So a virtual address is pretty much 
>>worthless as a hypervisor parameter; performing the MMU 
>>translation in software is infeasible.
> 
> 
> I think I'd prefer to hide all of this by co-operation between the
> kernel and the hypervisor's copy to/from user.
>

This is basically what Xiaofeng attempted to do in this patch:

http://article.gmane.org/gmane.comp.emulators.xen.devel/11107

although the virtual -> pseudo physical is also done in the hypervisor.
Please let us know if the patch is acceptable in light of your email.

> The kernel can easily translate a virtual address and length into a list
> of psuedo-phyiscal frame numbers and initial offset. Xen's copy from
> user function can then use this list when doing its work. 

The other alternative (which we talked about at OLS) is to use a couple 
of pinned pages for parameter passing - but it doesn't work very well for:

a) Multiple levels of structures/pointers
b) Arguments which may be bigger than a couple of pages 
(xc_get_pfn_list() for a bigmem domain for example).

	-Arun

  parent reply	other threads:[~2005-08-17 21:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-17 20:44 passing hypercall parameters by pointer Ian Pratt
     [not found] ` <mailman.1124311483.4826@unix-os.sc.intel.com>
2005-08-17 21:07   ` Arun Sharma [this message]
2005-08-17 22:11     ` Hollis Blanchard
2005-08-17 22:04 ` Hollis Blanchard
  -- strict thread matches above, loose matches on Subject: below --
2005-08-19 12:41 Ian Pratt
2005-08-19 11:34 Ian Pratt
2005-08-19 11:52 ` Jimi Xenidis
2005-08-19 12:17   ` Keir Fraser
2005-08-19 13:57     ` Hollis Blanchard
2005-08-19 14:35       ` Keir Fraser
2005-08-19 15:18         ` Hollis Blanchard
2005-08-19 15:31           ` Keir Fraser
2005-08-19 12:20 ` Keir Fraser
2005-08-18  6:56 Tian, Kevin
2005-08-18 15:58 ` Hollis Blanchard
2005-08-19  2:00   ` Jimi Xenidis
2005-08-19 10:32     ` Keir Fraser
2005-08-18  6:56 Tian, Kevin
2005-08-18  6:56 Tian, Kevin
2005-08-18  0:47 Ling, Xiaofeng
2005-08-17 19:51 Hollis Blanchard

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=4303A6FC.6040601@intel.com \
    --to=arun.sharma@intel.com \
    --cc=ke.yu@intel.com \
    --cc=m+Ian.Pratt@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    --cc=xiaofeng.ling@intel.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 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.