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

Re: [Xen-devel] [PATCH for-4.5 v10 15/19] xen/arm: Temporarily disable mem_access for hypervisor access

On 26/09/2014 15:29, Tamas K Lengyel wrote:
As I said, I'm not sure what you are describing exactly. Based on the
p2m type we could already decide if the hypercall should be allowed to
read/write form the page. AFAIU the MMU here is only used as a fast-path
to determine if that's the case.

What I was getting at, its not a good idea to simply disable hypercalls
that use this path when there is a mem_access permission set because it
would reveal that there is a mem_access listener to the guest. So what
I'll do here is pausing the domain when access_in_use is set, temporary
disable the mem_access permissions, let the read/write through, then
re-enable + unpause the domain.

My solution is based on p2m_lookup, i.e getting the p2m type. Even if it's still slow (we can't really use the MMU translation facility), it would still be faster than pausing the domain and modifying twice the p2m. See the code skeleton below:

page = get_gva(...)
if ( !page )
   ipa = get ipa from va(va)
   mfn = p2m_lookup(d, ipa, &type);
   if ( mfn == INVALID_PADDR )
     return -EFAULT;
   page = get_page(mfn_to_page(mfn));
   if ( !page )
     return -EFAULT;

   if type check fail
     return -EFAULT;

You may have to modify a bit the skeleton above to take the p2m->look.


Julien Grall

Xen-devel mailing list



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